Skip to content

Commit c0f2022

Browse files
committed
do not skip subgroup checks
1 parent 500e511 commit c0f2022

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,7 @@ pub(crate) fn uncompressed_bytes_to_affine_g1(buf: &[u8]) -> Result<AffineG1, Er
149149
let x = Fq::from_slice(x_bytes).map_err(Error::Field)?;
150150
let y = Fq::from_slice(y_bytes).map_err(Error::Field)?;
151151

152-
// REVIEW: This avoids the subcheck group by assuming X and Y are valid, reducing cycle counts.
153-
// If they are invalid the proof verification fails
154-
let g1 = G1::new(x, y, Fq::one());
155-
AffineG1::from_jacobian(g1).ok_or(Error::InvalidPoint)
152+
AffineG1::new(x, y).map_err(Error::Group)
156153
}
157154

158155
/// Given an Fq element `x`, compute both possible y‐coordinates on the BN254 curve:

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,7 @@ pub(crate) fn uncompressed_bytes_to_affine_g2(buf: &[u8]) -> Result<AffineG2, Er
187187
let x = Fq2::new(x0, x1);
188188
let y = Fq2::new(y0, y1);
189189

190-
// REVIEW: This avoids the subcheck group by assuming X and Y are valid, reducing cycle counts.
191-
// If they are invalid the proof verification fails
192-
let g2 = G2::new(x, y, Fq2::one());
193-
AffineG2::from_jacobian(g2).ok_or(Error::InvalidPoint)
190+
AffineG2::new(x, y).map_err(Error::Group)
194191
}
195192

196193
/// Given an Fq2 element `x`, compute both possible y‐coordinates on the BN254 curve:

0 commit comments

Comments
 (0)