Module sui::groth16
Struct Curve
Represents an elliptic curve construction to be used in the verifier. Currently we support BLS12-381 and BN254.
This should be given as the first parameter to prepare_verifying_key or verify_groth16_proof.
public struct Curve has copy, drop, store
Click to open
Fields
- id: u8
Struct PreparedVerifyingKey
A PreparedVerifyingKey consisting of four components in serialized form.
public struct PreparedVerifyingKey has copy, drop, store
Click to open
Fields
- vk_gamma_abc_g1_bytes: vector<u8>
- alpha_g1_beta_g2_bytes: vector<u8>
- gamma_g2_neg_pc_bytes: vector<u8>
- delta_g2_neg_pc_bytes: vector<u8>
Struct PublicProofInputs
A PublicProofInputs wrapper around its serialized bytes.
public struct PublicProofInputs has copy, drop, store
Click to open
Fields
- bytes: vector<u8>
Struct ProofPoints
A ProofPoints wrapper around the serialized form of three proof points.
public struct ProofPoints has copy, drop, store
Click to open
Fields
- bytes: vector<u8>
Constants
const EInvalidVerifyingKey: u64 = 0;
const EInvalidCurve: u64 = 1;
const ETooManyPublicInputs: u64 = 2;
const EInvalidScalar: u64 = 3;
const MaxPublicInputs: u64 = 8;
Function bls12381
Return the Curve value indicating that the BLS12-381 construction should be used in a given function.
public fun bls12381(): sui::groth16::Curve
Function bn254
Return the Curve value indicating that the BN254 construction should be used in a given function.
public fun bn254(): sui::groth16::Curve