Skip to content

Commit 8392937

Browse files
authored
fix(docstring): use correct sizes (#74)
1 parent cf2a209 commit 8392937

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

adapters/sp1/groth16-verifier/src/types/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub(crate) const G2_COMPRESSED_SIZE: usize = FQ_SIZE * 2;
4747
pub(crate) const G2_UNCOMPRESSED_SIZE: usize = G2_COMPRESSED_SIZE * 2;
4848

4949
// Groth16 Proof size constants
50-
/// Size of a GNARK-compressed Groth16 proof in bytes (32 + 64 + 64)
50+
/// Size of a GNARK-compressed Groth16 proof in bytes (32 + 64 + 32)
5151
pub const GROTH16_PROOF_COMPRESSED_SIZE: usize =
5252
G1_COMPRESSED_SIZE + G2_COMPRESSED_SIZE + G1_COMPRESSED_SIZE;
5353

adapters/sp1/groth16-verifier/src/types/proof.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl Groth16Proof {
5151
Ok(Groth16Proof { ar, bs, krs })
5252
}
5353

54-
/// Deserialize from GNARK-compressed bytes (160 bytes).
54+
/// Deserialize from GNARK-compressed bytes (128 bytes).
5555
pub fn from_gnark_compressed_bytes(bytes: &[u8]) -> Result<Self, Groth16Error> {
5656
if bytes.len() != GROTH16_PROOF_COMPRESSED_SIZE {
5757
return Err(Groth16Error::Serialization(
@@ -75,14 +75,14 @@ impl Groth16Proof {
7575
Ok(Groth16Proof { ar, bs, krs })
7676
}
7777

78-
/// Serialize to GNARK-compressed bytes (160 bytes: 32 + 64 + 64).
78+
/// Serialize to GNARK-compressed bytes (128 bytes: 32 + 64 + 32).
7979
///
8080
/// Uses the GNARK compression scheme.
8181
///
8282
/// Layout:
8383
/// - bytes 0..32: GNARK-compressed G1 point `A·R`
8484
/// - bytes 32..96: GNARK-compressed G2 point `B·S`
85-
/// - bytes 96..160: GNARK-compressed G1 point `K·R·S`
85+
/// - bytes 96..128: GNARK-compressed G1 point `K·R·S`
8686
///
8787
/// Note: This is more compact than GNARK's uncompressed format (256 bytes).
8888
pub fn to_gnark_compressed_bytes(&self) -> [u8; GROTH16_PROOF_COMPRESSED_SIZE] {

0 commit comments

Comments
 (0)