We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The calculation of left in decryption can result in a negative number when modulu is less than 0,
left
modulu
node-fe1-fpe/index.js
Line 63 in ceae15b
this leads to a failure to recover the original value.
The value produced should be based on - modulu in all cases (to ensure a positive result):
- modulu
left = (modulu > 0) ? firstFactor - modulu : - modulu;
You can confirm this change is an improvement by
expectedEV
format()
return ... % 100n
modulu <= 0
Then remember to
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The calculation of
left
in decryption can result in a negative number whenmodulu
is less than 0,node-fe1-fpe/index.js
Line 63 in ceae15b
this leads to a failure to recover the original value.
The value produced should be based on
- modulu
in all cases (to ensure a positive result):You can confirm this change is an improvement by
expectedEV
assertions from the unit tests (tests should still pass with less assertions)format()
function toreturn ... % 100n
to force themodulu <= 0
case to occur, (tests now fail).Then remember to
format()
function.The text was updated successfully, but these errors were encountered: