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:
10
field.go
10
field.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user