check if there are any points

This commit is contained in:
Kevaundray Wedderburn 2024-04-23 14:28:53 +01:00
parent 5230d8e81e
commit b58012845f
1 changed files with 2 additions and 0 deletions

View File

@ -238,6 +238,8 @@ def multi_exp(points, integers):
int_as_bytes = integer.to_bytes(32, 'little')
scalars.append(arkworks_Scalar.from_le_bytes(int_as_bytes))
if len(points) == 0:
return Z1()
# Check if we need to perform a G1 or G2 multiexp
if isinstance(points[0], arkworks_G1):
return arkworks_G1.multiexp_unchecked(points, scalars)