Browse Source

Fix verify check input inside field

master
arnaucube 4 years ago
parent
commit
bed1a652c9
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      verifier.go

+ 1
- 1
verifier.go

@ -220,7 +220,7 @@ func Verify(vk *Vk, proof *Proof, inputs []*big.Int) bool {
vkX := new(bn256.G1).ScalarBaseMult(big.NewInt(0)) vkX := new(bn256.G1).ScalarBaseMult(big.NewInt(0))
for i := 0; i < len(inputs); i++ { for i := 0; i < len(inputs); i++ {
// check input inside field // check input inside field
if inputs[0].Cmp(q) != -1 {
if inputs[i].Cmp(q) != -1 {
return false return false
} }
vkX = new(bn256.G1).Add(vkX, new(bn256.G1).ScalarMult(vk.GammaABC[i+1], inputs[i])) vkX = new(bn256.G1).Add(vkX, new(bn256.G1).ScalarMult(vk.GammaABC[i+1], inputs[i]))

Loading…
Cancel
Save