bip70: fix bn.
This commit is contained in:
parent
04f071f9b0
commit
e35f4aa186
@ -99,7 +99,7 @@ rsa.decrypt = function decrypt(N, D, m) {
|
|||||||
throw new Error('Cannot decrypt.');
|
throw new Error('Cannot decrypt.');
|
||||||
|
|
||||||
return c
|
return c
|
||||||
.toRed(bn.red(N))
|
.toRed(BN.red(N))
|
||||||
.redPow(D)
|
.redPow(D)
|
||||||
.fromRed()
|
.fromRed()
|
||||||
.toArrayLike(Buffer, 'be');
|
.toArrayLike(Buffer, 'be');
|
||||||
@ -107,7 +107,7 @@ rsa.decrypt = function decrypt(N, D, m) {
|
|||||||
|
|
||||||
rsa.encrypt = function encrypt(N, e, m) {
|
rsa.encrypt = function encrypt(N, e, m) {
|
||||||
return new BN(m)
|
return new BN(m)
|
||||||
.toRed(bn.red(N))
|
.toRed(BN.red(N))
|
||||||
.redPow(e)
|
.redPow(e)
|
||||||
.fromRed()
|
.fromRed()
|
||||||
.toArrayLike(Buffer, 'be');
|
.toArrayLike(Buffer, 'be');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user