fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Construction of a FieldElement from a BigInteger fails if the BigInteger is too big

Open jot2re opened this issue 2 years ago • 2 comments

Currently the method BigIntegerModulus.reduceModThis() fails if the BigInteger it gets as input is more than the square of the modulus... However, no exception is thrown if this is the case.

The code should be changed to either throw and exception so the user knows that something went wrong, or fixed to handle the case of large input gracefully.

See this issue https://github.com/aicis/fresco-outsourcing/issues/6

jot2re avatar Nov 11 '22 14:11 jot2re

Ideally if things are too big, it should simply use the slow modulo operation, or apply the fast modulo operation recursively.

jot2re avatar Nov 22 '22 09:11 jot2re

Note that the problem happens if the value is larger than the square of the modulo.

jot2re avatar Nov 22 '22 09:11 jot2re