You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.
Currently the cipher operates on 2n powers of 2, becouse to produce a balanced feistel cipher an even number of bits (divisible into 2) is required. However this costs performance, becouse to make sure the output is smaller than maxValue we have to repeat encryption/decryption until the result fits.
The larger the gap between 0 and minValue and maxValue and 2n - the more iterations on average it will take.
Luby and Rackoff have proved that if we use the next power of 2 greater or equal to maxValue the number of operations (on average) required to produce the result will be 2.
Current implementation uses the "closest EVEN" power of 2.
This is probably not a big issue, as this library is blazingly fast anyways, but should be investigated.
The text was updated successfully, but these errors were encountered:
Currently the cipher operates on
2n
powers of 2, becouse to produce a balanced feistel cipher an even number of bits (divisible into 2) is required. However this costs performance, becouse to make sure the output is smaller thanmaxValue
we have to repeat encryption/decryption until the result fits.The larger the gap between
0
andminValue
andmaxValue
and2n
- the more iterations on average it will take.Luby and Rackoff have proved that if we use the next power of 2 greater or equal to
maxValue
the number of operations (on average) required to produce the result will be 2.Current implementation uses the "closest EVEN" power of 2.
This is probably not a big issue, as this library is blazingly fast anyways, but should be investigated.
The text was updated successfully, but these errors were encountered: