|
| template<typename Field > |
| static bool | y_is_negative (const Field &y) |
| | True if y is in the "upper half" of its field, used for point compression sign bit.
|
| |
| static void | write_u256 (std::vector< uint8_t > &out, const uint256_t &val) |
| |
| static uint256_t | read_u256 (const std::vector< uint8_t > &data, size_t &pos) |
| |
| static Fq | reconstruct_fq (const Fr &lo, const Fr &hi) |
| |
| static std::pair< Fr, Fr > | split_fq (const Fq &val) |
| |
| template<typename ScalarFn , typename CommitmentFn > |
| static void | walk_mega_zk_oink_proof (ScalarFn &&process_scalar, CommitmentFn &&process_commitment, size_t num_public_inputs) |
| | Walk a MegaZK Oink-only proof (BN254).
|
| |
| template<typename ScalarFn , typename CommitmentFn > |
| static void | walk_merge_proof (ScalarFn &&process_scalar, CommitmentFn &&process_commitment) |
| | Walk a Merge proof (42 Fr, all BN254).
|
| |
| template<typename ScalarFn , typename CommitmentFn > |
| static void | walk_eccvm_proof (ScalarFn &&process_scalar, CommitmentFn &&process_commitment) |
| | Walk an ECCVM proof (all Grumpkin).
|
| |
| template<typename ScalarFn , typename CommitmentFn > |
| static void | walk_ipa_proof (ScalarFn &&process_scalar, CommitmentFn &&process_commitment) |
| | Walk an IPA proof (64 Fr, all Grumpkin).
|
| |
| template<typename ScalarFn , typename CommitmentFn > |
| static void | walk_joint_proof (ScalarFn &&process_scalar, CommitmentFn &&process_commitment) |
| | Walk the joint proof (translator oink + joint sumcheck + joint PCS, all BN254).
|
| |
| template<typename BN254ScalarFn , typename BN254CommFn , typename GrumpkinScalarFn , typename GrumpkinCommFn > |
| static void | walk_chonk_proof (BN254ScalarFn &&bn254_scalar, BN254CommFn &&bn254_comm, GrumpkinScalarFn &&grumpkin_scalar, GrumpkinCommFn &&grumpkin_comm, size_t mega_num_public_inputs) |
| | Walk a full Chonk proof (5 sub-proofs across two curves).
|
| |
Compresses Chonk proofs from vector<fr> to compact byte representations.
Compression techniques:
- Point compression: store only x-coordinate + sign bit (instead of x and y)
- Fq-as-u256: store each Fq coordinate as 32 bytes (instead of 2 Fr for lo/hi split)
- Fr-as-u256: store each Fr scalar as 32 bytes (uniform encoding)
Every element compresses to exactly 32 bytes regardless of type:
- BN254 commitment (4 Fr → 32 bytes): point compression on Fq coordinates
- BN254 scalar (1 Fr → 32 bytes): direct u256 encoding
- Grumpkin commitment (2 Fr → 32 bytes): point compression on Fr coordinates
- Grumpkin scalar (2 Fr → 32 bytes): reconstruct Fq, write as u256
Definition at line 33 of file proof_compression.hpp.
template<typename BN254ScalarFn , typename BN254CommFn , typename GrumpkinScalarFn , typename GrumpkinCommFn >
| static void bb::ProofCompressor::walk_chonk_proof |
( |
BN254ScalarFn && |
bn254_scalar, |
|
|
BN254CommFn && |
bn254_comm, |
|
|
GrumpkinScalarFn && |
grumpkin_scalar, |
|
|
GrumpkinCommFn && |
grumpkin_comm, |
|
|
size_t |
mega_num_public_inputs |
|
) |
| |
|
inlinestaticprivate |
Walk a full Chonk proof (5 sub-proofs across two curves).
Layout: hiding_oink (BN254) | merge (BN254) | eccvm (Grumpkin) | ipa (Grumpkin) | joint (BN254)
Definition at line 299 of file proof_compression.hpp.
template<typename ScalarFn , typename CommitmentFn >
| static void bb::ProofCompressor::walk_ipa_proof |
( |
ScalarFn && |
process_scalar, |
|
|
CommitmentFn && |
process_commitment |
|
) |
| |
|
inlinestaticprivate |
Walk an IPA proof (64 Fr, all Grumpkin).
IPA_PROOF_LENGTH = 4 * CONST_ECCVM_LOG_N + 4
Definition at line 207 of file proof_compression.hpp.
template<typename ScalarFn , typename CommitmentFn >
| static void bb::ProofCompressor::walk_joint_proof |
( |
ScalarFn && |
process_scalar, |
|
|
CommitmentFn && |
process_commitment |
|
) |
| |
|
inlinestaticprivate |
Walk the joint proof (translator oink + joint sumcheck + joint PCS, all BN254).
Produced by BatchedHonkTranslatorProver::prove(). Contains the translator's pre-sumcheck commitments, a joint 17-round sumcheck over MegaZK + translator, and a joint Shplemini/KZG PCS reduction.
Definition at line 227 of file proof_compression.hpp.
template<typename ScalarFn , typename CommitmentFn >
| static void bb::ProofCompressor::walk_mega_zk_oink_proof |
( |
ScalarFn && |
process_scalar, |
|
|
CommitmentFn && |
process_commitment, |
|
|
size_t |
num_public_inputs |
|
) |
| |
|
inlinestaticprivate |
Walk a MegaZK Oink-only proof (BN254).
In the batched protocol, the MegaZK proof contains only the Oink phase: public inputs followed by witness commitments. Sumcheck and PCS are in the joint proof.
Definition at line 94 of file proof_compression.hpp.