瀏覽代碼

cln16sidh: add point addition benchmark

trials/prep_p503_trial3
Henry de Valence 7 年之前
父節點
當前提交
c26f169fae
共有 1 個檔案被更改,包括 12 行新增0 行删除
  1. +12
    -0
      curve_test.go

+ 12
- 0
curve_test.go 查看文件

@@ -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}



Loading…
取消
儲存