Debian Codegraph @

dh/sidh/p751/arith_test.go

raw symbols SCIP
1 package p751scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/
2
3 import (
4 . "github.com/henrydcase/nobs/dh/sidh/internal/isogenyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/"
5 "math/bigscip-go gomod github.com/golang/go/src go1.12 `math/big`/"
6 "testingscip-go gomod github.com/golang/go/src go1.12 testing/"
7 "testing/quickscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/"
8 )
9
10 func TestPrimeFieldElementToBigIntscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/TestPrimeFieldElementToBigInt().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) {
11 // Chosen so that p < xR < 2p
12 x := primeFieldElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#{Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#A.: FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#{
13 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 140737488355328,
14 }}
15 // Computed using Sage:
16 // sage: p = 2^372 * 3^239 - 1
17 // sage: R = 2^768
18 // sage: from_radix_64 = lambda xs: sum((xi * (2**64)**i for i,xi in enumerate(xs)))
19 // sage: xR = from_radix_64([1]*11 + [2^47])
20 // sage: assert(p < xR)
21 // sage: assert(xR < 2*p)
22 // sage: (xR / R) % p
23 xBig, _ := new(bigscip-go gomod github.com/golang/go/src go1.12 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.12 `math/big`/Int#).SetStringscip-go gomod github.com/golang/go/src go1.12 `math/big`/Int#SetString().("4469946751055876387821312289373600189787971305258234719850789711074696941114031433609871105823930699680637820852699269802003300352597419024286385747737509380032982821081644521634652750355306547718505685107272222083450567982240", 10)
24 if xBig.Cmpscip-go gomod github.com/golang/go/src go1.12 `math/big`/Int#Cmp().(toBigIntscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/toBigInt().(&x.Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#A.)) != 0 {
25 t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().("Expected", xBig, "found", toBigIntscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/toBigInt().(&x.Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#A.))
26 }
27 }
28
29 //------------------------------------------------------------------------------
30 // Extended Field
31 //------------------------------------------------------------------------------
32
33 func TestOneFp2ToBytesscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/TestOneFp2ToBytes().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) {
34 var x = P751OneFp2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/P751OneFp2.
35 var xBytes [188]byte
36
37 kCurveOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kCurveOps..Fp2ToBytesscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/CurveOperations#Fp2ToBytes().(xBytes[:], &x)
38 if xBytes[0] != 1 {
39 t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().("Expected 1, got", xBytes[0])
40 }
41 for i := 1; i < 188; i++ {
42 if xBytes[i] != 0 {
43 t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().("Expected 0, got", xBytes[0])
44 }
45 }
46 }
47
48 func TestFp2ElementToBytesRoundTripscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/TestFp2ElementToBytesRoundTrip().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) {
49 roundTrips := func(x GeneratedTestParamsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#) bool {
50 var xBytes [188]byte
51 var xPrime Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#
52 kCurveOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kCurveOps..Fp2ToBytesscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/CurveOperations#Fp2ToBytes().(xBytes[:], &x.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
53 kCurveOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kCurveOps..Fp2FromBytesscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/CurveOperations#Fp2FromBytes().(&xPrime, xBytes[:])
54
55 return VartimeEqFp2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/VartimeEqFp2().(&xPrime, &x.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
56 }
57
58 if err := quickscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/.Checkscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Check().(roundTrips, quickCheckConfigscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/quickCheckConfig.); err != nil {
59 t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().(err)
60 }
61 }
62
63 func TestFp2ElementMulDistributesOverAddscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/TestFp2ElementMulDistributesOverAdd().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) {
64 mulDistributesOverAdd := func(x, y, z GeneratedTestParamsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#) bool {
65 // Compute t1 = (x+y)*z
66 t1 := new(Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#)
67 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Addscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Add.(t1, &x.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem., &y.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
68 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Mul.(t1, t1, &z.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
69
70 // Compute t2 = x*z + y*z
71 t2 := new(Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#)
72 t3 := new(Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#)
73 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Mul.(t2, &x.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem., &z.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
74 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Mul.(t3, &y.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem., &z.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
75 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Addscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Add.(t2, t2, t3)
76
77 return VartimeEqFp2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/VartimeEqFp2().(t1, t2)
78 }
79
80 if err := quickscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/.Checkscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Check().(mulDistributesOverAdd, quickCheckConfigscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/quickCheckConfig.); err != nil {
81 t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().(err)
82 }
83 }
84
85 func TestFp2ElementMulIsAssociativescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/TestFp2ElementMulIsAssociative().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) {
86 isAssociative := func(x, y, z GeneratedTestParamsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#) bool {
87 // Compute t1 = (x*y)*z
88 t1 := new(Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#)
89 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Mul.(t1, &x.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem., &y.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
90 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Mul.(t1, t1, &z.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
91
92 // Compute t2 = (y*z)*x
93 t2 := new(Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#)
94 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Mul.(t2, &y.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem., &z.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
95 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Mul.(t2, t2, &x.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
96
97 return VartimeEqFp2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/VartimeEqFp2().(t1, t2)
98 }
99
100 if err := quickscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/.Checkscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Check().(isAssociative, quickCheckConfigscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/quickCheckConfig.); err != nil {
101 t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().(err)
102 }
103 }
104
105 func TestFp2ElementSquareMatchesMulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/TestFp2ElementSquareMatchesMul().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) {
106 sqrMatchesMul := func(x GeneratedTestParamsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#) bool {
107 // Compute t1 = (x*x)
108 t1 := new(Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#)
109 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Mul.(t1, &x.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem., &x.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
110
111 // Compute t2 = x^2
112 t2 := new(Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#)
113 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Squarescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Square.(t2, &x.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
114
115 return VartimeEqFp2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/VartimeEqFp2().(t1, t2)
116 }
117
118 if err := quickscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/.Checkscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Check().(sqrMatchesMul, quickCheckConfigscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/quickCheckConfig.); err != nil {
119 t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().(err)
120 }
121 }
122
123 func TestFp2ElementInvscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/TestFp2ElementInv().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) {
124 inverseIsCorrect := func(x GeneratedTestParamsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#) bool {
125 z := new(Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#)
126 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Invscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Inv.(z, &x.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
127
128 // Now z = (1/x), so (z * x) * x == x
129 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Mul.(z, z, &x.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
130 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Mul.(z, z, &x.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
131
132 return VartimeEqFp2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/VartimeEqFp2().(z, &x.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
133 }
134
135 // This is more expensive; run fewer tests
136 var quickCheckConfig = &quickscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/.Configscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Config#{MaxCountscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Config#MaxCount.: (1 << (8 + quickCheckScaleFactorscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/quickCheckScaleFactor.))}
137 if err := quickscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/.Checkscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Check().(inverseIsCorrect, quickCheckConfig); err != nil {
138 t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().(err)
139 }
140 }
141
142 func TestFp2ElementBatch3Invscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/TestFp2ElementBatch3Inv().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) {
143 batchInverseIsCorrect := func(x1, x2, x3 GeneratedTestParamsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#) bool {
144 var x1Inv, x2Inv, x3Inv Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#
145 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Invscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Inv.(&x1Inv, &x1.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
146 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Invscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Inv.(&x2Inv, &x2.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
147 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Invscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Inv.(&x3Inv, &x3.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem.)
148
149 var y1, y2, y3 Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#
150 kCurveOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kCurveOps..Fp2Batch3Invscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/CurveOperations#Fp2Batch3Inv().(&x1.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem., &x2.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem., &x3.ExtElemscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/GeneratedTestParams#ExtElem., &y1, &y2, &y3)
151
152 return (VartimeEqFp2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/VartimeEqFp2().(&x1Inv, &y1) && VartimeEqFp2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/VartimeEqFp2().(&x2Inv, &y2) && VartimeEqFp2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/VartimeEqFp2().(&x3Inv, &y3))
153 }
154
155 // This is more expensive; run fewer tests
156 var quickCheckConfig = &quickscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/.Configscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Config#{MaxCountscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Config#MaxCount.: (1 << (5 + quickCheckScaleFactorscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/quickCheckScaleFactor.))}
157 if err := quickscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/.Checkscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Check().(batchInverseIsCorrect, quickCheckConfig); err != nil {
158 t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().(err)
159 }
160 }
161
162 //------------------------------------------------------------------------------
163 // Prime Field
164 //------------------------------------------------------------------------------
165
166 func TestPrimeFieldElementMulVersusBigIntscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/TestPrimeFieldElementMulVersusBigInt().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) {
167 mulMatchesBigInt := func(x, y primeFieldElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#) bool {
168 z := new(primeFieldElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#)
169 z.Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#Mul().(&x, &y)
170
171 check := new(bigscip-go gomod github.com/golang/go/src go1.12 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.12 `math/big`/Int#)
172 check.Mulscip-go gomod github.com/golang/go/src go1.12 `math/big`/Int#Mul().(toBigIntscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/toBigInt().(&x.Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#A.), toBigIntscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/toBigInt().(&y.Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#A.))
173 check.Modscip-go gomod github.com/golang/go/src go1.12 `math/big`/Int#Mod().(check, cln16primescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/cln16prime.)
174
175 return check.Cmpscip-go gomod github.com/golang/go/src go1.12 `math/big`/Int#Cmp().(toBigIntscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/toBigInt().(&z.Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#A.)) == 0
176 }
177
178 if err := quickscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/.Checkscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Check().(mulMatchesBigInt, quickCheckConfigscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/quickCheckConfig.); err != nil {
179 t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().(err)
180 }
181 }
182
183 func TestPrimeFieldElementP34VersusBigIntscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/TestPrimeFieldElementP34VersusBigInt().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) {
184 var p34, _ = new(bigscip-go gomod github.com/golang/go/src go1.12 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.12 `math/big`/Int#).SetStringscip-go gomod github.com/golang/go/src go1.12 `math/big`/Int#SetString().("2588679435442326313244442059466701330356847411387267792529047419763669735170619711625720724140266678406138302904710050596300977994130638598261040117192787954244176710019728333589599932738193731745058771712747875468166412894207", 10)
185 p34MatchesBigInt := func(x primeFieldElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#) bool {
186 z := new(primeFieldElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#)
187 z.P34scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#P34().(&x)
188
189 check := toBigIntscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/toBigInt().(&x.Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#A.)
190 check.Expscip-go gomod github.com/golang/go/src go1.12 `math/big`/Int#Exp().(check, p34, cln16primescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/cln16prime.)
191
192 return check.Cmpscip-go gomod github.com/golang/go/src go1.12 `math/big`/Int#Cmp().(toBigIntscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/toBigInt().(&z.Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#A.)) == 0
193 }
194
195 // This is more expensive; run fewer tests
196 var quickCheckConfig = &quickscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/.Configscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Config#{MaxCountscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Config#MaxCount.: (1 << (8 + quickCheckScaleFactorscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/quickCheckScaleFactor.))}
197 if err := quickscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/.Checkscip-go gomod github.com/golang/go/src go1.12 `testing/quick`/Check().(p34MatchesBigInt, quickCheckConfig); err != nil {
198 t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().(err)
199 }
200 }
201
202 func BenchmarkFp2ElementMulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp2ElementMul().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
203 z := &Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#{Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#A.: bench_xscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_x., Bscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#B.: bench_yscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_y.}
204 w := new(Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#)
205
206 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
207 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Mul.(w, z, z)
208 }
209 }
210
211 func BenchmarkFp2ElementInvscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp2ElementInv().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
212 z := &Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#{Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#A.: bench_xscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_x., Bscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#B.: bench_yscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_y.}
213 w := new(Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#)
214
215 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
216 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Invscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Inv.(w, z)
217 }
218 }
219
220 func BenchmarkFp2ElementSquarescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp2ElementSquare().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
221 z := &Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#{Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#A.: bench_xscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_x., Bscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#B.: bench_yscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_y.}
222 w := new(Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#)
223
224 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
225 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Squarescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Square.(w, z)
226 }
227 }
228
229 func BenchmarkFp2ElementAddscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp2ElementAdd().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
230 z := &Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#{Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#A.: bench_xscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_x., Bscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#B.: bench_yscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_y.}
231 w := new(Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#)
232
233 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
234 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Addscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Add.(w, z, z)
235 }
236 }
237
238 func BenchmarkFp2ElementSubscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp2ElementSub().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
239 z := &Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#{Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#A.: bench_xscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_x., Bscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#B.: bench_yscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_y.}
240 w := new(Fp2Elementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/Fp2Element#)
241
242 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
243 kFieldOpsscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/kFieldOps..Subscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FieldOps#Sub.(w, z, z)
244 }
245 }
246
247 func BenchmarkPrimeFieldElementMulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkPrimeFieldElementMul().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
248 z := &primeFieldElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#{Ascip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#A.: bench_xscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_x.}
249 w := new(primeFieldElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#)
250
251 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
252 w.Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/primeFieldElement#Mul().(z, z)
253 }
254 }
255
256 // --- field operation functions
257
258 func BenchmarkFp751Multiplyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp751Multiply().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
259 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
260 fp751Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751Mul().(&benchmarkFpElementX2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/benchmarkFpElementX2., &bench_xscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_x., &bench_yscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_y.)
261 }
262 }
263
264 func BenchmarkFp751MontgomeryReducescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp751MontgomeryReduce().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
265 z := bench_zscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_z.
266
267 // This benchmark actually computes garbage, because
268 // fp751MontgomeryReduce mangles its input, but since it's
269 // constant-time that shouldn't matter for the benchmarks.
270 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
271 fp751MontgomeryReducescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751MontgomeryReduce().(&benchmarkFpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/benchmarkFpElement., &z)
272 }
273 }
274
275 func BenchmarkFp751AddReducedscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp751AddReduced().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
276 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
277 fp751AddReducedscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751AddReduced().(&benchmarkFpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/benchmarkFpElement., &bench_xscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_x., &bench_yscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_y.)
278 }
279 }
280
281 func BenchmarkFp751SubReducedscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp751SubReduced().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
282 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
283 fp751SubReducedscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751SubReduced().(&benchmarkFpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/benchmarkFpElement., &bench_xscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_x., &bench_yscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_y.)
284 }
285 }
286
287 func BenchmarkFp751ConditionalSwapscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp751ConditionalSwap().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
288 x, y := bench_xscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_x., bench_yscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_y.
289 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
290 fp751ConditionalSwapscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751ConditionalSwap().(&x, &y, 1)
291 fp751ConditionalSwapscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751ConditionalSwap().(&x, &y, 0)
292 }
293 }
294
295 func BenchmarkFp751StrongReducescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp751StrongReduce().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
296 x := bench_xscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_x.
297 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
298 fp751StrongReducescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751StrongReduce().(&x)
299 }
300 }
301
302 func BenchmarkFp751AddLazyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp751AddLazy().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
303 var z FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#
304 x, y := bench_xscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_x., bench_yscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_y.
305 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
306 fp751AddLazyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751AddLazy().(&z, &x, &y)
307 }
308 }
309
310 func BenchmarkFp751X2AddLazyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp751X2AddLazy().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
311 x, y, z := bench_zscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_z., bench_zscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_z., bench_zscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_z.
312 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
313 fp751X2AddLazyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751X2AddLazy().(&x, &y, &z)
314 }
315 }
316
317 func BenchmarkFp751X2SubLazyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/BenchmarkFp751X2SubLazy().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) {
318 x, y, z := bench_zscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_z., bench_zscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_z., bench_zscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/bench_z.
319 for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ {
320 fp751X2SubLazyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751X2SubLazy().(&x, &y, &z)
321 }
322 }