Add benchmark results and performance analysis for ECDSA and ECDH operations

This commit introduces two new files: `BENCHMARK_RESULTS.md` and `benchmark_results.txt`, which document the performance metrics of various cryptographic operations, including ECDSA signing, verification, and ECDH key exchange. The results provide insights into operation times, memory allocations, and comparisons with C implementations. Additionally, new test files for ECDSA and ECDH functionalities have been added, ensuring comprehensive coverage and validation of the implemented algorithms. This enhances the overall robustness and performance understanding of the secp256k1 implementation.
This commit is contained in:
2025-11-01 20:17:24 +00:00
parent 5416381478
commit 3966183137
18 changed files with 2455 additions and 126 deletions

View File

@@ -219,6 +219,16 @@ func (r *FieldElement) isOdd() bool {
return r.n[0]&1 == 1
}
// normalizesToZeroVar checks if the field element normalizes to zero
// This is a variable-time check (not constant-time)
// A field element normalizes to zero if all limbs are zero or if it equals the modulus
func (r *FieldElement) normalizesToZeroVar() bool {
var t FieldElement
t = *r
t.normalize()
return t.isZero()
}
// equal returns true if two field elements are equal
func (r *FieldElement) equal(a *FieldElement) bool {
// Both must be normalized for comparison