Skip to content

Commit e368dce

Browse files
committed
ensure we "clear the cofactor" when mapping field to curve point
1 parent 0db054d commit e368dce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

eth/precompiles/bls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ def _parse_fp2_element(data: bytes) -> bls12_381.FQ2:
208208

209209
def _map_fp2_to_g2(field_element: bls12_381.FQ2) -> G2Point:
210210
point = bls.hash_to_curve.map_to_curve_G2(field_element)
211-
return bls12_381.normalize(point)
211+
group_element = bls.hash_to_curve.clear_cofactor_G2(point)
212+
return bls12_381.normalize(group_element)
212213

213214

214215
def map_fp2_to_g2(computation: BaseComputation,

0 commit comments

Comments
 (0)