go-iden3-crypto/constants/constants.go
constants/constants.goRaw
1package constants
2
3import (
4 "fmt"
5 "math/big"
6)
7
8// Q is the order of the integer field (Zq) that fits inside the SNARK.
9var Q *big.Int
10
11// Zero is 0.
12var Zero *big.Int
13
14// One is 1.
15var One *big.Int
16
17// MinusOne is -1.
18var MinusOne *big.Int
19
20func init() {
21 Zero = big.NewInt(0)
22 One = big.NewInt(1)
23 MinusOne = big.NewInt(-1)
24
25 qString := "21888242871839275222246405745257275088548364400416034343698204186575808495617"
26 var ok bool
27 Q, ok = new(big.Int).SetString(qString, 10)
28 if !ok {
29 panic(fmt.Sprintf("Bad base 10 string %s", qString))
30 }
31}