aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-01-07 15:05:36 +0100
committerFlorian Dold <florian@dold.me>2021-01-07 15:05:36 +0100
commita3313ce3f89208399b9c776ffdeac6bf8a889e34 (patch)
tree1734fccfeffebff272219f6ff273a4fb09a705d9 /packages
parente319e99ef9657f68c82e7b37dd928c126d865ecb (diff)
nacl: apply fix for overflow
See https://github.com/dchest/tweetnacl-js/issues/187
Diffstat (limited to 'packages')
-rw-r--r--packages/taler-wallet-core/src/crypto/primitives/nacl-fast.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/crypto/primitives/nacl-fast.ts b/packages/taler-wallet-core/src/crypto/primitives/nacl-fast.ts
index c2d40691a..315e2bba9 100644
--- a/packages/taler-wallet-core/src/crypto/primitives/nacl-fast.ts
+++ b/packages/taler-wallet-core/src/crypto/primitives/nacl-fast.ts
@@ -1548,7 +1548,7 @@ function modL(r: Uint8Array, x: Float64Array): void {
carry = 0;
for (j = i - 32, k = i - 12; j < k; ++j) {
x[j] += carry - 16 * x[i] * L[j - (i - 32)];
- carry = (x[j] + 128) >> 8;
+ carry = Math.floor((x[j] + 128) / 256);
x[j] -= carry * 256;
}
x[j] += carry;