FhenixProtocol / fheos

FheOS is a modular layer that allows the blockchain to execute encrypted computations powered by FHE
Other
16 stars 9 forks source link

Fix decryption of big numbers #93

Closed liorbond closed 3 months ago

liorbond commented 3 months ago

monday: https://fhenix.monday.com/boards/1216577959/views/4451803/pulses/1495590839

We want to make sure that numbers that are higher than max of uint128 but lower than max of uint256 are handled correctly Before a fix was introduced, there were some code sections that were converting the results of decryption to 64bits representations. This was causing the numbers to be truncated and the results to be incorrect. This test is to make sure that the fix is working correctly. The number is 2^128 + 1 which is not representable in uint128 but is representable in uint256 and also is not aligned by 64 bits, previously, with the bug present the result was just 1

Co-authored-by: @milan-sedivy