| 64 | /// FieldElement (ark_bn254::Fq) or ScalarElement (ark_bn254::Fr) are ElementTypes |
| 65 | #[derive(Debug, Clone, Copy, Eq, PartialEq)] |
| 66 | pub(crate) enum ElementType { |
| 67 | /// type to represent second coefficient of normalized Fp12 |
| 68 | Fp6, |
| 69 | |
| 70 | /// type to represent field elements |
| 71 | FieldElem, |
| 72 | |
| 73 | /// type to represent scalar elements, which are public inputs of groth16 verifier |
| 74 | ScalarElem, |
| 75 | |
| 76 | /// type to represent G1Affine points, which can be from groth16 proof or its intermediate computations |
| 77 | G1, |
| 78 | |
| 79 | // The following ElementTypes are wrappers of ElemG2Eval [t(4), partial_product(14)] |
| 80 | // We merkelize ElemG2Eval because all of its contents aren't used within a single tapscript |
| 81 | // Therefore a tapscript can only include preimage of the values it needs (t or partial_product) for calculation, |
| 82 | // and use sibling hash (Hash_partial_product or Hash_t respectively) to show that the preimage are part of the merkle tree |
| 83 | /// type to represent point G2 accumulator with hash of partial product of line evaluation |
| 84 | G2EvalPoint, // t, Hash_partial_product |
| 85 | |
| 86 | /// type to represent partial product of line evaluation with hash of G2 point accumulator |
| 87 | G2EvalMul, // partial_product, Hash_t |
| 88 | |
| 89 | /// type to represent G2 point accumulator and partial product of line evaluation |
| 90 | G2Eval, // t, partial_product |
| 91 | } |
| 92 | |
| 93 | impl ElementType { |
| 94 | pub fn number_of_limbs_of_hashing_preimage(&self) -> usize { |
nothing calls this directly
no outgoing calls
no test coverage detected