You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
608 B

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