Browse Source

Merge pull request #6 from iden3/feature/testBJPKField

Test that babyjub pk is always < Q
fix/issue-9
arnau 4 years ago
committed by GitHub
parent
commit
4356f44a3d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      babyjub/eddsa_test.go

+ 10
- 0
babyjub/eddsa_test.go

@ -25,6 +25,16 @@ func genInputs() (*PrivateKey, *big.Int) {
return &k, msg
}
func TestPublicKey(t *testing.T) {
var k PrivateKey
for i := 0; i < 256; i++ {
hex.Decode(k[:], []byte{byte(i)})
}
pk := k.Public()
assert.True(t, pk.X.Cmp(constants.Q) == -1)
assert.True(t, pk.Y.Cmp(constants.Q) == -1)
}
func TestSignVerifyMimc7(t *testing.T) {
var k PrivateKey
hex.Decode(k[:], []byte("0001020304050607080900010203040506070809000102030405060708090001"))

Loading…
Cancel
Save