| 1 | package ristretto_testscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/ |
| 2 | |
| 3 | import ( |
| 4 | "encoding/base64scip-go gomod github.com/golang/go/src go1.13 `encoding/base64`/" |
| 5 | "encoding/hexscip-go gomod github.com/golang/go/src go1.13 `encoding/hex`/" |
| 6 | "math/bigscip-go gomod github.com/golang/go/src go1.13 `math/big`/" |
| 7 | "math/randscip-go gomod github.com/golang/go/src go1.13 `math/rand`/" |
| 8 | "osscip-go gomod github.com/golang/go/src go1.13 os/" |
| 9 | "testingscip-go gomod github.com/golang/go/src go1.13 testing/" |
| 10 | |
| 11 | "github.com/bwesterb/go-ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/" |
| 12 | ) |
| 13 | |
| 14 | var biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_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# |
| 15 | var rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_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 TestScPackingscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScPacking().(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 s, s2 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 20 | var buf [32]byte |
| 21 | for i := 0; i < 100; i++ { |
| 22 | 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 23 | s.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi) |
| 24 | s.BytesIntoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BytesInto().(&buf) |
| 25 | s2.SetBytesscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBytes().(&buf) |
| 26 | if s.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(s2.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().()) != 0 { |
| 27 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Unpack o Pack != id (%v != %v)", &bi, s2.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().()) |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | func TestScBigIntPackingscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScBigIntPacking().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 33 | 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# |
| 34 | var s ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 35 | for i := 0; i < 100; i++ { |
| 36 | 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 37 | s.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi) |
| 38 | if s.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi) != 0 { |
| 39 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("BigInt o SetBigInt != id (%v != %v)", &bi, s.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().()) |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | func TestScSubscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScSub().(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 s1, s2, s3 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 47 | for i := 0; i < 1000; 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 50 | bi3.Subscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Sub().(&bi1, &bi2) |
| 51 | bi3.Modscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mod().(&bi3, &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 52 | s1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi1) |
| 53 | s2.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi2) |
| 54 | if s3.Subscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Sub().(&s1, &s2).BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#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, s3.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().()) |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | func TestScAddscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScAdd().(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, 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# |
| 62 | var s1, s2, s3 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 63 | for i := 0; i < 1000; 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 65 | 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 66 | bi3.Addscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Add().(&bi1, &bi2) |
| 67 | bi3.Modscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mod().(&bi3, &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 68 | s1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi1) |
| 69 | s2.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi2) |
| 70 | if s3.Addscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Add().(&s1, &s2).BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi3) != 0 { |
| 71 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("%v + %v = %v != %v", &bi1, &bi2, &bi3, s3.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().()) |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | func TestScMulscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScMul().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 77 | 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# |
| 78 | var s1, s2, s3 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 79 | for i := 0; i < 1000; i++ { |
| 80 | 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 81 | 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 82 | bi3.Mulscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mul().(&bi1, &bi2) |
| 83 | bi3.Modscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mod().(&bi3, &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 84 | s1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi1) |
| 85 | s2.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi2) |
| 86 | if s3.Mulscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Mul().(&s1, &s2).BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi3) != 0 { |
| 87 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("%v * %v = %v != %v", &bi1, &bi2, &bi3, s3.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().()) |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | func TestScSquarescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScSquare().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 93 | 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# |
| 94 | var s1, s2 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 95 | for i := 0; i < 1000; i++ { |
| 96 | 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 97 | bi2.Mulscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mul().(&bi1, &bi1) |
| 98 | bi2.Modscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mod().(&bi2, &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 99 | s1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi1) |
| 100 | if s2.Squarescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Square().(&s1).BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi2) != 0 { |
| 101 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("%v^2 = %v != %v", |
| 102 | &bi1, &bi2, s2.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().()) |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func TestScMulSubscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScMulSub().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 108 | var bi1, bi2, bi3, bi4 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# |
| 109 | var s1, s2, s3, s4 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 110 | for i := 0; i < 1000; i++ { |
| 111 | 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 112 | 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 113 | bi3.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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 114 | bi4.Mulscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mul().(&bi1, &bi2) |
| 115 | bi4.Subscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Sub().(&bi4, &bi3) |
| 116 | bi4.Modscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mod().(&bi4, &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 117 | s1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi1) |
| 118 | s2.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi2) |
| 119 | s3.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi3) |
| 120 | if s4.MulSubscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#MulSub().(&s1, &s2, &s3).BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi4) != 0 { |
| 121 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("%v * %v - %v = %v != %v", |
| 122 | &bi1, &bi2, &bi3, &bi4, s4.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().()) |
| 123 | } |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | func TestScMulAddscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScMulAdd().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 128 | var bi1, bi2, bi3, bi4 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# |
| 129 | var s1, s2, s3, s4 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 130 | for i := 0; i < 1000; i++ { |
| 131 | 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 132 | 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 133 | bi3.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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 134 | bi4.Mulscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mul().(&bi1, &bi2) |
| 135 | bi4.Addscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Add().(&bi4, &bi3) |
| 136 | bi4.Modscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mod().(&bi4, &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 137 | s1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi1) |
| 138 | s2.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi2) |
| 139 | s3.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi3) |
| 140 | if s4.MulAddscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#MulAdd().(&s1, &s2, &s3).BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi4) != 0 { |
| 141 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("%v * %v + %v = %v != %v", |
| 142 | &bi1, &bi2, &bi3, &bi4, s4.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().()) |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | func TestScInversescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScInverse().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 148 | 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# |
| 149 | var s1, s2 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 150 | for i := 0; i < 100; i++ { |
| 151 | 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 152 | bi2.ModInversescip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#ModInverse().(&bi1, &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 153 | s1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi1) |
| 154 | if s2.Inversescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Inverse().(&s1).BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi2) != 0 { |
| 155 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("1/%v = %v != %v", &bi1, &bi2, &s2) |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | func TestScNegscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScNeg().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 161 | 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# |
| 162 | var s1, s2 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 163 | for i := 0; i < 1000; i++ { |
| 164 | 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 165 | bi2.Negscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Neg().(&bi1) |
| 166 | bi2.Modscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mod().(&bi2, &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 167 | s1.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi1) |
| 168 | if s2.Negscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Neg().(&s1).BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi2) != 0 { |
| 169 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("-%v = %v != %v", &bi1, &bi2, &s2) |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | func TestScReducedscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScReduced().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 175 | var bi1, bi2, bi512 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# |
| 176 | var s ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 177 | bi512.SetInt64scip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#SetInt64().(1).Lshscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Lsh().(&bi512, 512) |
| 178 | for i := 0; i < 100; i++ { |
| 179 | var rBuf [64]byte |
| 180 | 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_test`/rnd., &bi512) |
| 181 | bi2.Modscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Mod().(&bi1, &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 182 | buf := bi1.Bytesscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Bytes().() |
| 183 | for j := 0; j < len(buf) && j < 64; j++ { |
| 184 | rBuf[len(buf)-j-1] = buf[j] |
| 185 | } |
| 186 | s.SetReducedscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetReduced().(&rBuf) |
| 187 | if s.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(&bi2) != 0 { |
| 188 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("SetReduced(%v) = %v != %v %v", &bi1, &bi2, s.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().(), rBuf) |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | } |
| 193 | |
| 194 | func TestScSetBytesStrictscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScSetBytesStrict().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 195 | // Little-endian encode a big.Int into a [32]byte. |
| 196 | le := func(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#) (buf [32]byte) { |
| 197 | b := bi.Bytesscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Bytes().() // big-endian |
| 198 | for j := 0; j < len(b) && j < 32; j++ { |
| 199 | buf[j] = b[len(b)-j-1] |
| 200 | } |
| 201 | return |
| 202 | } |
| 203 | |
| 204 | var s, s2 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 205 | var bi, bi2, twoTo256 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# |
| 206 | twoTo256.SetInt64scip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#SetInt64().(1).Lshscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Lsh().(&twoTo256, 256) |
| 207 | |
| 208 | // Canonical encodings (0 <= s < l) must be accepted and decode correctly. |
| 209 | for i := 0; i < 100; i++ { |
| 210 | 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_test`/rnd., &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 211 | buf := le(&bi) |
| 212 | if !s.SetBytesStrictscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBytesStrict().(&buf) { |
| 213 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("SetBytesStrict(%v) unexpectedly rejected", &bi) |
| 214 | } |
| 215 | s2.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi) |
| 216 | if !s.Equalsscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Equals().(&s2) { |
| 217 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("SetBytesStrict(%v) = %v != %v", &bi, s.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().(), &bi) |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | // l itself and l+1 are the smallest non-canonical encodings. |
| 222 | for _, d := range []int64{0, 1} { |
| 223 | bi.SetInt64scip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#SetInt64().(d).Addscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Add().(&bi, &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) |
| 224 | buf := le(&bi) |
| 225 | if s.SetBytesStrictscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBytesStrict().(&buf) { |
| 226 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("SetBytesStrict(%v) should have been rejected", &bi) |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | // Random non-canonical encodings (l <= s < 2^256) must be rejected, and |
| 231 | // s must be left unchanged. |
| 232 | bi2.Subscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Sub().(&twoTo256, &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) // size of the non-canonical range |
| 233 | for i := 0; i < 100; i++ { |
| 234 | 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_test`/rnd., &bi2) |
| 235 | bi.Addscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Add().(&bi, &biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL.) // now l <= bi < 2^256 |
| 236 | buf := le(&bi) |
| 237 | var before ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 238 | before.Randscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Rand().() |
| 239 | s = before |
| 240 | if s.SetBytesStrictscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBytesStrict().(&buf) { |
| 241 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("SetBytesStrict(%v) should have been rejected", &bi) |
| 242 | } |
| 243 | if !s.Equalsscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Equals().(&before) { |
| 244 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("SetBytesStrict left s modified on rejection") |
| 245 | } |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | func TestScTextMarshalingscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScTextMarshaling().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 250 | var s, s2 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 251 | for i := 0; i < 100; i++ { |
| 252 | s.Randscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Rand().() |
| 253 | text, _ := s.MarshalTextscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#MarshalText().() |
| 254 | err := s2.UnmarshalTextscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#UnmarshalText().(text) |
| 255 | if err != nil { |
| 256 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("%v: UnmarshalText o MarshalText: %v", s, err) |
| 257 | } |
| 258 | if s.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().().Cmpscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#Cmp().(s2.BigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#BigInt().()) != 0 { |
| 259 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("%v: UnmarshalText o MarshalText != id", s) |
| 260 | } |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | func TestScDeriveShortscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScDeriveShort().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 265 | var s ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 266 | for k, v := range map[string]string{ |
| 267 | "test1": "b16ed7d24b3ecbd4164dcdad374e08c000000000000000000000000000000000", |
| 268 | "ristretto": "27bf1d7100b6a72bd2b2f43babb948b500000000000000000000000000000000", |
| 269 | "decaf": "39e5d267455abfce52284ac648d4b97100000000000000000000000000000000", |
| 270 | } { |
| 271 | v2 := hexscip-go gomod github.com/golang/go/src go1.13 `encoding/hex`/.EncodeToStringscip-go gomod github.com/golang/go/src go1.13 `encoding/hex`/EncodeToString().(s.DeriveShortscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#DeriveShort().([]byte(k)).Bytesscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Bytes().()) |
| 272 | if v != v2 { |
| 273 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("DeriveShort(%s) = %s != %s", k, v, v2) |
| 274 | } |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | func TestScDerivescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScDerive().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 279 | var s ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 280 | for k, v := range map[string]string{ |
| 281 | "test1": "f4f2ba0eccc056c32241b5e7f648ffe6bf870773e09104f0fd2c28fbd7fc5402", |
| 282 | "ristretto": "a17454b11da0ee4f9aed08190c61781c326a0c59bb449133bacc0c75308db805", |
| 283 | "decaf": "8107e19264d3e54e9869de056c90dc245dbc097529c4a5ef0dae42e1f3cd7700", |
| 284 | } { |
| 285 | v2 := hexscip-go gomod github.com/golang/go/src go1.13 `encoding/hex`/.EncodeToStringscip-go gomod github.com/golang/go/src go1.13 `encoding/hex`/EncodeToString().(s.Derivescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Derive().([]byte(k)).Bytesscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Bytes().()) |
| 286 | if v != v2 { |
| 287 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Derive(%s) = %s != %s", k, v, v2) |
| 288 | } |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | func TestScSetUint64scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScSetUint64().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 293 | var s1, s2 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 294 | 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# |
| 295 | v := uint64(0x0102030405060708) |
| 296 | bi.SetUint64scip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#SetUint64().(v) |
| 297 | s1.SetUint64scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetUint64().(v) |
| 298 | s2.SetBigIntscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBigInt().(&bi) |
| 299 | if !s1.Equalsscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Equals().(&s2) { |
| 300 | t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().() |
| 301 | } |
| 302 | } |
| 303 | func TestScConditionalSetscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestScConditionalSet().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 304 | var s1, s2 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 305 | for i := 0; i < 1000; i++ { |
| 306 | s1.Randscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Rand().() |
| 307 | s2.Randscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Rand().() |
| 308 | s1.ConditionalSetscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#ConditionalSet().(&s2, 0) |
| 309 | if s1.Equalsscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Equals().(&s2) { |
| 310 | t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().() |
| 311 | } |
| 312 | s1.ConditionalSetscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#ConditionalSet().(&s2, 1) |
| 313 | if !s1.Equalsscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Equals().(&s2) { |
| 314 | t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().() |
| 315 | } |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | func TestIssue14scip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/TestIssue14().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 320 | var buf [32]byte |
| 321 | var s ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 322 | var p1, p2 ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Pointscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Point# |
| 323 | |
| 324 | tmp, _ := base64scip-go gomod github.com/golang/go/src go1.13 `encoding/base64`/.StdEncodingscip-go gomod github.com/golang/go/src go1.13 `encoding/base64`/StdEncoding..DecodeStringscip-go gomod github.com/golang/go/src go1.13 `encoding/base64`/Encoding#DecodeString().( |
| 325 | "QekHbzmOtwUfRnheuyj1qyt8HN1WPjW4Jy199/2fQQ8=") |
| 326 | copy(buf[:], tmp) |
| 327 | s.SetBytesscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#SetBytes().(&buf) |
| 328 | |
| 329 | tmp, _ = base64scip-go gomod github.com/golang/go/src go1.13 `encoding/base64`/.StdEncodingscip-go gomod github.com/golang/go/src go1.13 `encoding/base64`/StdEncoding..DecodeStringscip-go gomod github.com/golang/go/src go1.13 `encoding/base64`/Encoding#DecodeString().( |
| 330 | "SqbtfZl5+A1RtHVfzN8HJCLUcC0Bz2kdThR7wRCUbCQ=") |
| 331 | copy(buf[:], tmp) |
| 332 | if !p1.SetBytesscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Point#SetBytes().(&buf) { |
| 333 | t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().() |
| 334 | } |
| 335 | |
| 336 | p2.ScalarMultBasescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Point#ScalarMultBase().(&s) |
| 337 | |
| 338 | if !p1.Equalsscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Point#Equals().(&p2) { |
| 339 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("%v*B = %v != %v", s, p2, p1) |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | func BenchmarkScDerivescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/BenchmarkScDerive().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 344 | var s ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 345 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 346 | s.Derivescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Derive().([]byte("test")) |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | func BenchmarkScRandscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/BenchmarkScRand().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 351 | var s ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 352 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 353 | s.Randscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Rand().() |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | func BenchmarkScMulscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/BenchmarkScMul().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 358 | var s, t ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 359 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 360 | s.Mulscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Mul().(&s, &t) |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | func BenchmarkScSquarescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/BenchmarkScSquare().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 365 | var s ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 366 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 367 | s.Squarescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Square().(&s) |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | func BenchmarkScInversescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/BenchmarkScInverse().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 372 | var s ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 373 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 374 | s.Inversescip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Inverse().(&s) |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | func BenchmarkScMullAddscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/BenchmarkScMullAdd().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 379 | var s, t, u ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 380 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 381 | s.MulAddscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#MulAdd().(&s, &t, &u) |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | func BenchmarkScMullSubscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/BenchmarkScMullSub().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 386 | var s, t, u ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 387 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 388 | s.MulSubscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#MulSub().(&s, &t, &u) |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | func BenchmarkScAddscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/BenchmarkScAdd().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 393 | var s, t ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 394 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 395 | s.Addscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Add().(&s, &t) |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | func BenchmarkScSubscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/BenchmarkScSub().(b *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Bscip-go gomod github.com/golang/go/src go1.13 testing/B#) { |
| 400 | var s, t ristrettoscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/.Scalarscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar# |
| 401 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.13 testing/B#N.; n++ { |
| 402 | s.Subscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto`/Scalar#Sub().(&s, &t) |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | func TestMainscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_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#) { |
| 407 | biLscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_test`/biL..SetStringscip-go gomod github.com/golang/go/src go1.13 `math/big`/Int#SetString().( |
| 408 | "1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed", 16) |
| 409 | rndscip-go gomod github.com/bwesterb/go-ristretto . `github.com/bwesterb/go-ristretto_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)) |
| 410 | 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().()) |
| 411 | } |