JHUISI / charm

Charm: A Framework for Rapidly Prototyping Cryptosystems
http://charm-crypto.io
GNU Lesser General Public License v3.0
541 stars 166 forks source link

OverflowError when a G1 element and 512-bit large integer are multiplied #292

Open windhost opened 1 year ago

windhost commented 1 year ago

python 3.7.1

group = PairingGroup('SS512')
g = group.random(G1)

# x is a random integer with 512bits
sig = int(x)*g

When I run the sig = x*g, it display OverflowError: Python int too large to convert to C long

if x is a small integer such as 111111, It runs successfully. x = group.init(ZR, int(x)) can resolve this error, but 512bits exceed the ZR so x would be changed.