msakai / finite-field

Other
4 stars 0 forks source link

Bug in toEnum #2

Closed wyager closed 3 years ago

wyager commented 3 years ago
> toEnum 7 :: P.PrimeField (2^127 - 1)
*** Exception: PrimeField.toEnum: bad argument

toEnum should not use toInt. Instead it should convert both the input Int and the input PrimeField p to integers and compare those.

msakai commented 3 years ago

Good catch. Thanks!

msakai commented 3 years ago

@wyager, I released version 0.10.0 with the fix of this issue.