Skip to content

Commit db92be2

Browse files
Apply #696 related changes
1 parent a40c3f9 commit db92be2

File tree

1 file changed

+4
-4
lines changed
  • crates/precompile-bls12381/src

1 file changed

+4
-4
lines changed

crates/precompile-bls12381/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ fn read_fq2(input: &[u8], offset: usize) -> Result<Fq2, PrecompileFailure> {
140140

141141
/// A helper function to map `Fq` to `G1Affine`.
142142
fn map_to_curve_g1(fq: Fq) -> Result<G1Affine, HashToCurveError> {
143-
let m2c = WBMap::<G1Config>::new()?;
144-
m2c.map_to_curve(fq)
143+
WBMap::<G1Config>::check_parameters()?;
144+
WBMap::<G1Config>::map_to_curve(fq)
145145
}
146146

147147
/// A helper function to map `Fq` to `G2Affine`.
148148
fn map_to_curve_g2(fq2: Fq2) -> Result<G2Affine, HashToCurveError> {
149-
let m2c = WBMap::<G2Config>::new()?;
150-
m2c.map_to_curve(fq2)
149+
WBMap::<G2Config>::check_parameters()?;
150+
WBMap::<G2Config>::map_to_curve(fq2)
151151
}
152152

153153
/// Decode G1 given encoded (x, y) coordinates in 128 bytes returns a valid G1 Point.

0 commit comments

Comments
 (0)