| 1 | package edwards25519_testscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/ |
| 2 | |
| 3 | import ( |
| 4 | "math/bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/" |
| 5 | "math/randscip-go gomod github.com/golang/go/src go1.13 `math/rand`/" |
| 6 | "osscip-go gomod github.com/golang/go/src go1.13 os/" |
| 7 | "testingscip-go gomod github.com/golang/go/src go1.13 testing/" |
| 8 | |
| 9 | "github.com/bwesterb/go-ristretto/edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/" |
| 10 | ) |
| 11 | |
| 12 | var bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519. bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 13 | var biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/biL. bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 14 | |
| 15 | var rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd. *randscip-go gomod github.com/golang/go/src go1.13 `math/rand`/.Randscip-go gomod github.com/golang/go/src go1.13 `math/rand`/Rand# |
| 16 | |
| 17 | func TestFeBigIntPackingscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/TestFeBigIntPacking().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 18 | var bi bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 19 | var fe edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 20 | for i := 0; i < 100; i++ { |
| 21 | bi.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 22 | fe.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi) |
| 23 | if fe.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi) != 0 { |
| 24 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("BigInt o SetBigInt != id (%v != %v)", &bi, fe.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#BigInt().()) |
| 25 | } |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func TestFePackingscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/TestFePacking().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 30 | var bi bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 31 | var fe1, fe2 edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 32 | for i := 0; i < 100; i++ { |
| 33 | bi.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 34 | fe1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi) |
| 35 | buf := fe1.Bytesscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Bytes().() |
| 36 | fe2.SetBytesscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBytes().(&buf) |
| 37 | if !fe1.Equalsscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Equals().(&fe2) { |
| 38 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("SetBytes o Bytes != id (%v != %v)", &fe1, &fe2) |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | // TODO test unnormalized field elements |
| 44 | func TestFeMulscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/TestFeMul().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 45 | var bi1, bi2, bi3 bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 46 | var fe1, fe2, fe3 edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 47 | for i := 0; i < 100; i++ { |
| 48 | bi1.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 49 | bi2.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 50 | bi3.Mulscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mul().(&bi1, &bi2) |
| 51 | bi3.Modscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mod().(&bi3, &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 52 | fe1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi1) |
| 53 | fe2.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi2) |
| 54 | if fe3.Mulscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Mul().(&fe1, &fe2).BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi3) != 0 { |
| 55 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("%v * %v = %v != %v", &bi1, &bi2, &bi3, &fe3) |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | func TestFeSquarescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/TestFeSquare().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 61 | var bi1, bi2 bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 62 | var fe1, fe2 edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 63 | for i := 0; i < 100; i++ { |
| 64 | bi1.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 65 | bi2.Mulscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mul().(&bi1, &bi1) |
| 66 | bi2.Modscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mod().(&bi2, &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 67 | fe1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi1) |
| 68 | if fe2.Squarescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Square().(&fe1).BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi2) != 0 { |
| 69 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("%v^2 = %v != %v", &bi1, &bi2, &fe2) |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | func TestFeSubscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/TestFeSub().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 75 | var bi1, bi2, bi3 bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 76 | var fe1, fe2, fe3 edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 77 | for i := 0; i < 100; i++ { |
| 78 | bi1.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 79 | bi2.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 80 | bi3.Subscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Sub().(&bi1, &bi2) |
| 81 | bi3.Modscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mod().(&bi3, &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 82 | fe1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi1) |
| 83 | fe2.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi2) |
| 84 | if fe3.Subscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Sub().(&fe1, &fe2).BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi3) != 0 { |
| 85 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("%v - %v = %v != %v", &bi1, &bi2, &bi3, &fe3) |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | func TestFeAddscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/TestFeAdd().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 91 | var bi1, bi2, bi3 bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 92 | var fe1, fe2, fe3 edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 93 | for i := 0; i < 100; i++ { |
| 94 | bi1.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 95 | bi2.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 96 | bi3.Addscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Add().(&bi1, &bi2) |
| 97 | bi3.Modscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mod().(&bi3, &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 98 | fe1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi1) |
| 99 | fe2.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi2) |
| 100 | if fe3.Addscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Add().(&fe1, &fe2).BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi3) != 0 { |
| 101 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("%v + %v = %v != %v", &bi1, &bi2, &bi3, &fe3) |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | func TestFeInversescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/TestFeInverse().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 107 | var bi1, bi2 bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 108 | var fe1, fe2 edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 109 | for i := 0; i < 100; i++ { |
| 110 | bi1.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 111 | bi2.ModInversescip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#ModInverse().(&bi1, &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 112 | fe1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi1) |
| 113 | if fe2.Inversescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Inverse().(&fe1).BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi2) != 0 { |
| 114 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("1/%v = %v != %v", &bi1, &bi2, &fe2) |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | func TestFeInvSqrtIscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/TestFeInvSqrtI().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 120 | var bi bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 121 | var fe1, fe2, feI edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 122 | feI.SetIscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetI().() |
| 123 | for i := 0; i < 100; i++ { |
| 124 | bi.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 125 | fe1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi) |
| 126 | sq := fe2.InvSqrtIscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#InvSqrtI().(&fe1) |
| 127 | if sq == 0 { |
| 128 | fe1.Mulscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Mul().(&fe1, &feI) |
| 129 | } |
| 130 | fe2.Mulscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Mul().(&fe2, &fe1) |
| 131 | fe2.Squarescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Square().(&fe2) |
| 132 | if !fe1.Equalsscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Equals().(&fe2) { |
| 133 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("InvSqrtI(%v) incorrect", &bi) |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | func TestFeSqrtscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/TestFeSqrt().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 139 | var bi bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 140 | var fe1, fe2 edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 141 | for i := 0; i < 100; i++ { |
| 142 | bi.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 143 | bi.Mulscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mul().(&bi, &bi) |
| 144 | bi.Modscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mod().(&bi, &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 145 | fe1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi) |
| 146 | fe2.Sqrtscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Sqrt().(&fe1) |
| 147 | if fe2.IsNegativeIscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#IsNegativeI().() == 1 { |
| 148 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Sqrt(%v) is negative", &bi) |
| 149 | } |
| 150 | fe2.Squarescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Square().(&fe2) |
| 151 | if !fe1.Equalsscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Equals().(&fe2) { |
| 152 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Sqrt(%v) incorrect", &bi) |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | func BenchmarkFeInversescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/BenchmarkFeInverse().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 158 | var fe edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 159 | var bi bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 160 | bi.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 161 | fe.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi) |
| 162 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.13 testing/B#ResetTimer().() |
| 163 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 164 | fe.Inversescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Inverse().(&fe) |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | func BenchmarkFeSquarescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/BenchmarkFeSquare().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 169 | var fe edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 170 | var bi bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 171 | bi.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 172 | fe.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi) |
| 173 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.13 testing/B#ResetTimer().() |
| 174 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 175 | fe.Squarescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Square().(&fe) |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | func BenchmarkFeDoubledSquarescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/BenchmarkFeDoubledSquare().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 180 | var fe edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 181 | var bi bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 182 | bi.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 183 | fe.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi) |
| 184 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.13 testing/B#ResetTimer().() |
| 185 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 186 | fe.DoubledSquarescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#DoubledSquare().(&fe) |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | func BenchmarkFeMulscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/BenchmarkFeMul().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 191 | var fe edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 192 | var bi bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 193 | bi.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 194 | fe.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi) |
| 195 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.13 testing/B#ResetTimer().() |
| 196 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 197 | fe.Mulscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#Mul().(&fe, &fe) |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | func BenchmarkFeIsNonZeroscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/BenchmarkFeIsNonZero().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 202 | var fe edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 203 | var bi bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 204 | bi.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 205 | fe.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi) |
| 206 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.13 testing/B#ResetTimer().() |
| 207 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 208 | fe.IsNonZeroIscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#IsNonZeroI().() |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | func BenchmarkFePackscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/BenchmarkFePack().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 213 | var fe edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 214 | var buf [32]byte |
| 215 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.13 testing/B#ResetTimer().() |
| 216 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 217 | fe.BytesIntoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#BytesInto().(&buf) |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | func BenchmarkFeUnpackscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/BenchmarkFeUnpack().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 222 | var fe edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 223 | var buf [32]byte |
| 224 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.13 testing/B#ResetTimer().() |
| 225 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 226 | fe.SetBytesscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBytes().(&buf) |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | func BenchmarkFeInvSqrtIscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/BenchmarkFeInvSqrtI().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 231 | var fe edwards25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/.FieldElementscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement# |
| 232 | var bi bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int# |
| 233 | bi.Randscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Rand().(rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd., &bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519.) |
| 234 | fe.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#SetBigInt().(&bi) |
| 235 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.13 testing/B#ResetTimer().() |
| 236 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 237 | fe.InvSqrtIscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519`/FieldElement#InvSqrtI().(&fe) |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | func TestMainscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/TestMain().(m *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Mscip-go gomod github.com/golang/go/src go1.13 testing/M#) { |
| 242 | bi25519scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/bi25519..SetStringscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#SetString().( |
| 243 | "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed", 16) |
| 244 | biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/biL..SetStringscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#SetString().( |
| 245 | "1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed", 16) |
| 246 | rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto/edwards25519_test`/rnd. = randscip-go gomod github.com/golang/go/src go1.13 `math/rand`/.Newscip-go gomod github.com/golang/go/src go1.13 `math/rand`/New().(randscip-go gomod github.com/golang/go/src go1.13 `math/rand`/.NewSourcescip-go gomod github.com/golang/go/src go1.13 `math/rand`/NewSource().(37)) |
| 247 | osscip-go gomod github.com/golang/go/src go1.13 os/.Exitscip-go gomod github.com/golang/go/src go1.13 os/Exit().(m.Runscip-go gomod github.com/golang/go/src go1.13 testing/M#Run().()) |
| 248 | } |