Skip to content

Commit efb5636

Browse files
fix: add missing raise for InvalidParameter in decode_g{1,2}_scalar_pair (#2742)
1 parent d4c95a4 commit efb5636

8 files changed

Lines changed: 16 additions & 16 deletions

File tree

src/ethereum/forks/amsterdam/vm/precompiled_contracts/bls12_381/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def decode_g1_scalar_pair(
414414
415415
"""
416416
if len(data) != 160:
417-
InvalidParameter("Input should be 160 bytes long")
417+
raise InvalidParameter("Input should be 160 bytes long")
418418

419419
point = bytes_to_g1(data[:128], subgroup_check=True)
420420

@@ -614,7 +614,7 @@ def decode_g2_scalar_pair(
614614
615615
"""
616616
if len(data) != 288:
617-
InvalidParameter("Input should be 288 bytes long")
617+
raise InvalidParameter("Input should be 288 bytes long")
618618

619619
point = bytes_to_g2(data[:256], subgroup_check=True)
620620
n = int.from_bytes(data[256 : 256 + 32], "big")

src/ethereum/forks/bpo1/vm/precompiled_contracts/bls12_381/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def decode_g1_scalar_pair(
414414
415415
"""
416416
if len(data) != 160:
417-
InvalidParameter("Input should be 160 bytes long")
417+
raise InvalidParameter("Input should be 160 bytes long")
418418

419419
point = bytes_to_g1(data[:128], subgroup_check=True)
420420

@@ -614,7 +614,7 @@ def decode_g2_scalar_pair(
614614
615615
"""
616616
if len(data) != 288:
617-
InvalidParameter("Input should be 288 bytes long")
617+
raise InvalidParameter("Input should be 288 bytes long")
618618

619619
point = bytes_to_g2(data[:256], subgroup_check=True)
620620
n = int.from_bytes(data[256 : 256 + 32], "big")

src/ethereum/forks/bpo2/vm/precompiled_contracts/bls12_381/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def decode_g1_scalar_pair(
414414
415415
"""
416416
if len(data) != 160:
417-
InvalidParameter("Input should be 160 bytes long")
417+
raise InvalidParameter("Input should be 160 bytes long")
418418

419419
point = bytes_to_g1(data[:128], subgroup_check=True)
420420

@@ -614,7 +614,7 @@ def decode_g2_scalar_pair(
614614
615615
"""
616616
if len(data) != 288:
617-
InvalidParameter("Input should be 288 bytes long")
617+
raise InvalidParameter("Input should be 288 bytes long")
618618

619619
point = bytes_to_g2(data[:256], subgroup_check=True)
620620
n = int.from_bytes(data[256 : 256 + 32], "big")

src/ethereum/forks/bpo3/vm/precompiled_contracts/bls12_381/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def decode_g1_scalar_pair(
414414
415415
"""
416416
if len(data) != 160:
417-
InvalidParameter("Input should be 160 bytes long")
417+
raise InvalidParameter("Input should be 160 bytes long")
418418

419419
point = bytes_to_g1(data[:128], subgroup_check=True)
420420

@@ -614,7 +614,7 @@ def decode_g2_scalar_pair(
614614
615615
"""
616616
if len(data) != 288:
617-
InvalidParameter("Input should be 288 bytes long")
617+
raise InvalidParameter("Input should be 288 bytes long")
618618

619619
point = bytes_to_g2(data[:256], subgroup_check=True)
620620
n = int.from_bytes(data[256 : 256 + 32], "big")

src/ethereum/forks/bpo4/vm/precompiled_contracts/bls12_381/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def decode_g1_scalar_pair(
414414
415415
"""
416416
if len(data) != 160:
417-
InvalidParameter("Input should be 160 bytes long")
417+
raise InvalidParameter("Input should be 160 bytes long")
418418

419419
point = bytes_to_g1(data[:128], subgroup_check=True)
420420

@@ -614,7 +614,7 @@ def decode_g2_scalar_pair(
614614
615615
"""
616616
if len(data) != 288:
617-
InvalidParameter("Input should be 288 bytes long")
617+
raise InvalidParameter("Input should be 288 bytes long")
618618

619619
point = bytes_to_g2(data[:256], subgroup_check=True)
620620
n = int.from_bytes(data[256 : 256 + 32], "big")

src/ethereum/forks/bpo5/vm/precompiled_contracts/bls12_381/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def decode_g1_scalar_pair(
414414
415415
"""
416416
if len(data) != 160:
417-
InvalidParameter("Input should be 160 bytes long")
417+
raise InvalidParameter("Input should be 160 bytes long")
418418

419419
point = bytes_to_g1(data[:128], subgroup_check=True)
420420

@@ -614,7 +614,7 @@ def decode_g2_scalar_pair(
614614
615615
"""
616616
if len(data) != 288:
617-
InvalidParameter("Input should be 288 bytes long")
617+
raise InvalidParameter("Input should be 288 bytes long")
618618

619619
point = bytes_to_g2(data[:256], subgroup_check=True)
620620
n = int.from_bytes(data[256 : 256 + 32], "big")

src/ethereum/forks/osaka/vm/precompiled_contracts/bls12_381/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def decode_g1_scalar_pair(
414414
415415
"""
416416
if len(data) != 160:
417-
InvalidParameter("Input should be 160 bytes long")
417+
raise InvalidParameter("Input should be 160 bytes long")
418418

419419
point = bytes_to_g1(data[:128], subgroup_check=True)
420420

@@ -614,7 +614,7 @@ def decode_g2_scalar_pair(
614614
615615
"""
616616
if len(data) != 288:
617-
InvalidParameter("Input should be 288 bytes long")
617+
raise InvalidParameter("Input should be 288 bytes long")
618618

619619
point = bytes_to_g2(data[:256], subgroup_check=True)
620620
n = int.from_bytes(data[256 : 256 + 32], "big")

src/ethereum/forks/prague/vm/precompiled_contracts/bls12_381/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def decode_g1_scalar_pair(
414414
415415
"""
416416
if len(data) != 160:
417-
InvalidParameter("Input should be 160 bytes long")
417+
raise InvalidParameter("Input should be 160 bytes long")
418418

419419
point = bytes_to_g1(data[:128], subgroup_check=True)
420420

@@ -614,7 +614,7 @@ def decode_g2_scalar_pair(
614614
615615
"""
616616
if len(data) != 288:
617-
InvalidParameter("Input should be 288 bytes long")
617+
raise InvalidParameter("Input should be 288 bytes long")
618618

619619
point = bytes_to_g2(data[:256], subgroup_check=True)
620620
n = int.from_bytes(data[256 : 256 + 32], "big")

0 commit comments

Comments
 (0)