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.

49 lines
1.0 KiB

  1. package types
  2. import (
  3. "math/big"
  4. bn256 "github.com/ethereum/go-ethereum/crypto/bn256/cloudflare"
  5. )
  6. // R is the mod of the finite field
  7. var R, _ = new(big.Int).SetString("21888242871839275222246405745257275088548364400416034343698204186575808495617", 10)
  8. // Proof is the data structure of the Groth16 zkSNARK proof
  9. type Proof struct {
  10. A *bn256.G1
  11. B *bn256.G2
  12. C *bn256.G1
  13. }
  14. // Pk holds the data structure of the ProvingKey
  15. type Pk struct {
  16. A []*bn256.G1
  17. B2 []*bn256.G2
  18. B1 []*bn256.G1
  19. C []*bn256.G1
  20. NVars int
  21. NPublic int
  22. VkAlpha1 *bn256.G1
  23. VkDelta1 *bn256.G1
  24. VkBeta1 *bn256.G1
  25. VkBeta2 *bn256.G2
  26. VkDelta2 *bn256.G2
  27. HExps []*bn256.G1
  28. DomainSize int
  29. PolsA []map[int]*big.Int
  30. PolsB []map[int]*big.Int
  31. PolsC []map[int]*big.Int
  32. }
  33. // Witness contains the witness
  34. type Witness []*big.Int
  35. // Vk is the Verification Key data structure
  36. type Vk struct {
  37. Alpha *bn256.G1
  38. Beta *bn256.G2
  39. Gamma *bn256.G2
  40. Delta *bn256.G2
  41. IC []*bn256.G1
  42. }