This commit is contained in:
arnaucube
2020-03-03 16:31:09 +01:00
parent 17bad75853
commit 83f87bfa46
3 changed files with 38 additions and 11 deletions

View File

@@ -1,12 +1,15 @@
package constants
import (
"github.com/iden3/go-iden3-crypto/utils"
"fmt"
"math/big"
"github.com/iden3/go-iden3-crypto/ff"
)
// Q is the order of the integer field (Zq) that fits inside the SNARK.
var Q *big.Int
var QE *ff.Element
// Zero is 0.
var Zero *big.Int
@@ -21,6 +24,11 @@ func init() {
Zero = big.NewInt(0)
One = big.NewInt(1)
MinusOne = big.NewInt(-1)
Q = utils.NewIntFromString(
"21888242871839275222246405745257275088548364400416034343698204186575808495617")
qString := "21888242871839275222246405745257275088548364400416034343698204186575808495617"
var ok bool
Q, ok = new(big.Int).SetString(qString, 10)
if !ok {
panic(fmt.Sprintf("Bad base 10 string %s", qString))
}
}