Fix bug with signed to unsigned modulo

This commit is contained in:
Slava Bacherikov committed 2018-04-22 14:58:51 +03:00
1 parent 0f8fb09e69
commit 1e7928717f
1 file changed
+1 -1
+1 -1
View File
@@ -85,7 +85,7 @@ function rsaDecrypt(code: number[]): number[] {
const q: number = 3544934711;
const e = 41;
const phi = (new Long(p - 1, 0, true)).mul(q - 1);
const d: Long = modInvEuclid(new Long(e), phi) as Long;
const d: Long = modInvEuclid(new Long(e, 0, true), phi) as Long;
const dp = d.mod(p - 1);
const dq = d.mod(q - 1);