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
Seems like in-place operations are not reducing the result before changing the host object. Example:
var BN=require('bn.js')
red = new BN.red(new BN(13))
a = new BN(2).toRed(red)
b = new BN(7).toRed(red)
x = a.redIMul(b)
red.m // <BN: d>
x // <BN-R: 1>
x.cmp(red.m) // correct
a // <BN-R: e>
a.cmp(red.m) // incorrect
Note that a is still in a reduction context, but its value is larger than the modulus!
The text was updated successfully, but these errors were encountered:
Seems like in-place operations are not reducing the result before changing the host object. Example:
Note that
a
is still in a reduction context, but its value is larger than the modulus!The text was updated successfully, but these errors were encountered: