fresco
fresco copied to clipboard
Construction of a FieldElement from a BigInteger fails if the BigInteger is too big
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
Ideally if things are too big, it should simply use the slow modulo operation, or apply the fast modulo operation recursively.
Note that the problem happens if the value is larger than the square of the modulo.