cryptimeleon / math

Library providing mathematical basics for (pairing-based) cryptography.
Apache License 2.0
10 stars 2 forks source link

Fix decomposeIntoDigits #121

Closed JanBobolz closed 3 years ago

JanBobolz commented 3 years ago

The old version decomposed "100" into "[0, 0, 10]" in base 10. Also, it never really threw an exception if the number was too large to write with the given number of digits, it just produced one giant digit to compensate.

The new version does the more usual computation of computing the digits from least significant to most significant.

JanBobolz commented 3 years ago

To be honest, I’m just crossing my fingers that the code works now. Also, it doesn’t depend on anything and the code itself is unlikely to change in the future :)