mol_crypto_lib 0.1.1568 → 0.1.1570
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node.js +7 -7
- package/node.js.map +1 -1
- package/node.mjs +7 -7
- package/node.test.js +11 -7
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.js +7 -7
- package/web.js.map +1 -1
- package/web.mjs +7 -7
- package/web.test.js +4 -0
- package/web.test.js.map +1 -1
package/node.js
CHANGED
@@ -2593,10 +2593,10 @@ var $;
|
|
2593
2593
|
const kword = 0x80 << (24 - bits & 0b11111);
|
2594
2594
|
const bytes = 16 + (bits + 64 >>> 9 << 4);
|
2595
2595
|
const klens = bytes - 1;
|
2596
|
-
const words = new
|
2596
|
+
const words = new DataView(data.buffer, data.byteOffset, data.byteLength >> 2 << 2);
|
2597
2597
|
let tail = 0;
|
2598
|
-
for (let i = words.
|
2599
|
-
tail |= data[i] << (
|
2598
|
+
for (let i = words.byteLength; i < data.length; ++i) {
|
2599
|
+
tail |= data[i] << ((3 - i & 0b11) << 3);
|
2600
2600
|
}
|
2601
2601
|
const hash = new Int32Array([1732584193, -271733879, -1732584194, 271733878, -1009589776]);
|
2602
2602
|
for (let i = 0; i < bytes; i += 16) {
|
@@ -2611,10 +2611,10 @@ var $;
|
|
2611
2611
|
sponge[j] = bits;
|
2612
2612
|
}
|
2613
2613
|
else {
|
2614
|
-
|
2615
|
-
|
2616
|
-
|
2617
|
-
|
2614
|
+
const pos = k << 2;
|
2615
|
+
let word = pos === words.byteLength ? tail :
|
2616
|
+
pos > words.byteLength ? 0 :
|
2617
|
+
words.getInt32(pos, false);
|
2618
2618
|
if (k === kbits)
|
2619
2619
|
word |= kword;
|
2620
2620
|
sponge[j] = word;
|