Pārlūkot izejas kodu

cln16sidh: add point addition benchmark

trials/prep_p503_trial3
Henry de Valence pirms 7 gadiem
vecāks
revīzija
c26f169fae
1 mainītis faili ar 12 papildinājumiem un 0 dzēšanām
  1. +12
    -0
      curve_test.go

+ 12
- 0
curve_test.go Parādīt failu

@@ -118,6 +118,18 @@ func TestPointTripleVersusAddDouble(t *testing.T) {
}
}

func BenchmarkPointAddition(b *testing.B) {
var xP = ProjectivePoint{x: curve_A, z: curve_C}
var xP2, xP3 ProjectivePoint
// This is an incorrect use of the API (wrong curve
// parameters), but it doesn't affect the benchmark.
xP2.Double(&xP, &curve_A, &curve_C)

for n := 0; n < b.N; n++ {
xP3.Add(&xP2, &xP, &xP)
}
}

func BenchmarkPointDouble(b *testing.B) {
var xP = ProjectivePoint{x: curve_A, z: curve_C}



Notiek ielāde…
Atcelt
Saglabāt