@ocap/mcrypto 1.29.7 → 1.29.8
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/esm/signer/ed25519.mjs +2 -4
- package/lib/_virtual/rolldown_runtime.cjs +0 -2
- package/lib/signer/ed25519.cjs +2 -3
- package/package.json +3 -3
- package/esm/_virtual/rolldown_runtime.mjs +0 -32
- package/esm/node_modules/hash.js/lib/hash/common.mjs +0 -77
- package/esm/node_modules/hash.js/lib/hash/hmac.mjs +0 -41
- package/esm/node_modules/hash.js/lib/hash/ripemd.mjs +0 -422
- package/esm/node_modules/hash.js/lib/hash/sha/1.mjs +0 -73
- package/esm/node_modules/hash.js/lib/hash/sha/224.mjs +0 -38
- package/esm/node_modules/hash.js/lib/hash/sha/256.mjs +0 -154
- package/esm/node_modules/hash.js/lib/hash/sha/384.mjs +0 -46
- package/esm/node_modules/hash.js/lib/hash/sha/512.mjs +0 -389
- package/esm/node_modules/hash.js/lib/hash/sha/common.mjs +0 -46
- package/esm/node_modules/hash.js/lib/hash/sha.mjs +0 -20
- package/esm/node_modules/hash.js/lib/hash/utils.mjs +0 -211
- package/esm/node_modules/hash.js/lib/hash.mjs +0 -27
- package/esm/node_modules/inherits/inherits.mjs +0 -20
- package/esm/node_modules/inherits/inherits_browser.mjs +0 -30
- package/esm/node_modules/minimalistic-assert/index.mjs +0 -17
- package/lib/node_modules/hash.js/lib/hash/common.cjs +0 -82
- package/lib/node_modules/hash.js/lib/hash/hmac.cjs +0 -46
- package/lib/node_modules/hash.js/lib/hash/ripemd.cjs +0 -427
- package/lib/node_modules/hash.js/lib/hash/sha/1.cjs +0 -78
- package/lib/node_modules/hash.js/lib/hash/sha/224.cjs +0 -43
- package/lib/node_modules/hash.js/lib/hash/sha/256.cjs +0 -159
- package/lib/node_modules/hash.js/lib/hash/sha/384.cjs +0 -51
- package/lib/node_modules/hash.js/lib/hash/sha/512.cjs +0 -394
- package/lib/node_modules/hash.js/lib/hash/sha/common.cjs +0 -51
- package/lib/node_modules/hash.js/lib/hash/sha.cjs +0 -25
- package/lib/node_modules/hash.js/lib/hash/utils.cjs +0 -216
- package/lib/node_modules/hash.js/lib/hash.cjs +0 -30
- package/lib/node_modules/inherits/inherits.cjs +0 -23
- package/lib/node_modules/inherits/inherits_browser.cjs +0 -33
- package/lib/node_modules/minimalistic-assert/index.cjs +0 -20
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require_minimalistic_assert } from "../../../minimalistic-assert/index.mjs";
|
|
3
|
-
import { require_inherits } from "../../../inherits/inherits.mjs";
|
|
4
|
-
|
|
5
|
-
//#region ../../node_modules/hash.js/lib/hash/utils.js
|
|
6
|
-
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
7
|
-
var assert = require_minimalistic_assert();
|
|
8
|
-
var inherits = require_inherits();
|
|
9
|
-
exports.inherits = inherits;
|
|
10
|
-
function isSurrogatePair(msg, i) {
|
|
11
|
-
if ((msg.charCodeAt(i) & 64512) !== 55296) return false;
|
|
12
|
-
if (i < 0 || i + 1 >= msg.length) return false;
|
|
13
|
-
return (msg.charCodeAt(i + 1) & 64512) === 56320;
|
|
14
|
-
}
|
|
15
|
-
function toArray(msg, enc) {
|
|
16
|
-
if (Array.isArray(msg)) return msg.slice();
|
|
17
|
-
if (!msg) return [];
|
|
18
|
-
var res = [];
|
|
19
|
-
if (typeof msg === "string") {
|
|
20
|
-
if (!enc) {
|
|
21
|
-
var p = 0;
|
|
22
|
-
for (var i = 0; i < msg.length; i++) {
|
|
23
|
-
var c = msg.charCodeAt(i);
|
|
24
|
-
if (c < 128) res[p++] = c;
|
|
25
|
-
else if (c < 2048) {
|
|
26
|
-
res[p++] = c >> 6 | 192;
|
|
27
|
-
res[p++] = c & 63 | 128;
|
|
28
|
-
} else if (isSurrogatePair(msg, i)) {
|
|
29
|
-
c = 65536 + ((c & 1023) << 10) + (msg.charCodeAt(++i) & 1023);
|
|
30
|
-
res[p++] = c >> 18 | 240;
|
|
31
|
-
res[p++] = c >> 12 & 63 | 128;
|
|
32
|
-
res[p++] = c >> 6 & 63 | 128;
|
|
33
|
-
res[p++] = c & 63 | 128;
|
|
34
|
-
} else {
|
|
35
|
-
res[p++] = c >> 12 | 224;
|
|
36
|
-
res[p++] = c >> 6 & 63 | 128;
|
|
37
|
-
res[p++] = c & 63 | 128;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
} else if (enc === "hex") {
|
|
41
|
-
msg = msg.replace(/[^a-z0-9]+/gi, "");
|
|
42
|
-
if (msg.length % 2 !== 0) msg = "0" + msg;
|
|
43
|
-
for (i = 0; i < msg.length; i += 2) res.push(parseInt(msg[i] + msg[i + 1], 16));
|
|
44
|
-
}
|
|
45
|
-
} else for (i = 0; i < msg.length; i++) res[i] = msg[i] | 0;
|
|
46
|
-
return res;
|
|
47
|
-
}
|
|
48
|
-
exports.toArray = toArray;
|
|
49
|
-
function toHex(msg) {
|
|
50
|
-
var res = "";
|
|
51
|
-
for (var i = 0; i < msg.length; i++) res += zero2(msg[i].toString(16));
|
|
52
|
-
return res;
|
|
53
|
-
}
|
|
54
|
-
exports.toHex = toHex;
|
|
55
|
-
function htonl(w) {
|
|
56
|
-
return (w >>> 24 | w >>> 8 & 65280 | w << 8 & 16711680 | (w & 255) << 24) >>> 0;
|
|
57
|
-
}
|
|
58
|
-
exports.htonl = htonl;
|
|
59
|
-
function toHex32(msg, endian) {
|
|
60
|
-
var res = "";
|
|
61
|
-
for (var i = 0; i < msg.length; i++) {
|
|
62
|
-
var w = msg[i];
|
|
63
|
-
if (endian === "little") w = htonl(w);
|
|
64
|
-
res += zero8(w.toString(16));
|
|
65
|
-
}
|
|
66
|
-
return res;
|
|
67
|
-
}
|
|
68
|
-
exports.toHex32 = toHex32;
|
|
69
|
-
function zero2(word) {
|
|
70
|
-
if (word.length === 1) return "0" + word;
|
|
71
|
-
else return word;
|
|
72
|
-
}
|
|
73
|
-
exports.zero2 = zero2;
|
|
74
|
-
function zero8(word) {
|
|
75
|
-
if (word.length === 7) return "0" + word;
|
|
76
|
-
else if (word.length === 6) return "00" + word;
|
|
77
|
-
else if (word.length === 5) return "000" + word;
|
|
78
|
-
else if (word.length === 4) return "0000" + word;
|
|
79
|
-
else if (word.length === 3) return "00000" + word;
|
|
80
|
-
else if (word.length === 2) return "000000" + word;
|
|
81
|
-
else if (word.length === 1) return "0000000" + word;
|
|
82
|
-
else return word;
|
|
83
|
-
}
|
|
84
|
-
exports.zero8 = zero8;
|
|
85
|
-
function join32(msg, start, end, endian) {
|
|
86
|
-
var len = end - start;
|
|
87
|
-
assert(len % 4 === 0);
|
|
88
|
-
var res = new Array(len / 4);
|
|
89
|
-
for (var i = 0, k = start; i < res.length; i++, k += 4) {
|
|
90
|
-
var w;
|
|
91
|
-
if (endian === "big") w = msg[k] << 24 | msg[k + 1] << 16 | msg[k + 2] << 8 | msg[k + 3];
|
|
92
|
-
else w = msg[k + 3] << 24 | msg[k + 2] << 16 | msg[k + 1] << 8 | msg[k];
|
|
93
|
-
res[i] = w >>> 0;
|
|
94
|
-
}
|
|
95
|
-
return res;
|
|
96
|
-
}
|
|
97
|
-
exports.join32 = join32;
|
|
98
|
-
function split32(msg, endian) {
|
|
99
|
-
var res = new Array(msg.length * 4);
|
|
100
|
-
for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
|
|
101
|
-
var m = msg[i];
|
|
102
|
-
if (endian === "big") {
|
|
103
|
-
res[k] = m >>> 24;
|
|
104
|
-
res[k + 1] = m >>> 16 & 255;
|
|
105
|
-
res[k + 2] = m >>> 8 & 255;
|
|
106
|
-
res[k + 3] = m & 255;
|
|
107
|
-
} else {
|
|
108
|
-
res[k + 3] = m >>> 24;
|
|
109
|
-
res[k + 2] = m >>> 16 & 255;
|
|
110
|
-
res[k + 1] = m >>> 8 & 255;
|
|
111
|
-
res[k] = m & 255;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return res;
|
|
115
|
-
}
|
|
116
|
-
exports.split32 = split32;
|
|
117
|
-
function rotr32(w, b) {
|
|
118
|
-
return w >>> b | w << 32 - b;
|
|
119
|
-
}
|
|
120
|
-
exports.rotr32 = rotr32;
|
|
121
|
-
function rotl32(w, b) {
|
|
122
|
-
return w << b | w >>> 32 - b;
|
|
123
|
-
}
|
|
124
|
-
exports.rotl32 = rotl32;
|
|
125
|
-
function sum32(a, b) {
|
|
126
|
-
return a + b >>> 0;
|
|
127
|
-
}
|
|
128
|
-
exports.sum32 = sum32;
|
|
129
|
-
function sum32_3(a, b, c) {
|
|
130
|
-
return a + b + c >>> 0;
|
|
131
|
-
}
|
|
132
|
-
exports.sum32_3 = sum32_3;
|
|
133
|
-
function sum32_4(a, b, c, d) {
|
|
134
|
-
return a + b + c + d >>> 0;
|
|
135
|
-
}
|
|
136
|
-
exports.sum32_4 = sum32_4;
|
|
137
|
-
function sum32_5(a, b, c, d, e) {
|
|
138
|
-
return a + b + c + d + e >>> 0;
|
|
139
|
-
}
|
|
140
|
-
exports.sum32_5 = sum32_5;
|
|
141
|
-
function sum64(buf, pos, ah, al) {
|
|
142
|
-
var bh = buf[pos];
|
|
143
|
-
var lo = al + buf[pos + 1] >>> 0;
|
|
144
|
-
buf[pos] = (lo < al ? 1 : 0) + ah + bh >>> 0;
|
|
145
|
-
buf[pos + 1] = lo;
|
|
146
|
-
}
|
|
147
|
-
exports.sum64 = sum64;
|
|
148
|
-
function sum64_hi(ah, al, bh, bl) {
|
|
149
|
-
return (al + bl >>> 0 < al ? 1 : 0) + ah + bh >>> 0;
|
|
150
|
-
}
|
|
151
|
-
exports.sum64_hi = sum64_hi;
|
|
152
|
-
function sum64_lo(ah, al, bh, bl) {
|
|
153
|
-
return al + bl >>> 0;
|
|
154
|
-
}
|
|
155
|
-
exports.sum64_lo = sum64_lo;
|
|
156
|
-
function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
|
|
157
|
-
var carry = 0;
|
|
158
|
-
var lo = al;
|
|
159
|
-
lo = lo + bl >>> 0;
|
|
160
|
-
carry += lo < al ? 1 : 0;
|
|
161
|
-
lo = lo + cl >>> 0;
|
|
162
|
-
carry += lo < cl ? 1 : 0;
|
|
163
|
-
lo = lo + dl >>> 0;
|
|
164
|
-
carry += lo < dl ? 1 : 0;
|
|
165
|
-
return ah + bh + ch + dh + carry >>> 0;
|
|
166
|
-
}
|
|
167
|
-
exports.sum64_4_hi = sum64_4_hi;
|
|
168
|
-
function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
|
|
169
|
-
return al + bl + cl + dl >>> 0;
|
|
170
|
-
}
|
|
171
|
-
exports.sum64_4_lo = sum64_4_lo;
|
|
172
|
-
function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
|
|
173
|
-
var carry = 0;
|
|
174
|
-
var lo = al;
|
|
175
|
-
lo = lo + bl >>> 0;
|
|
176
|
-
carry += lo < al ? 1 : 0;
|
|
177
|
-
lo = lo + cl >>> 0;
|
|
178
|
-
carry += lo < cl ? 1 : 0;
|
|
179
|
-
lo = lo + dl >>> 0;
|
|
180
|
-
carry += lo < dl ? 1 : 0;
|
|
181
|
-
lo = lo + el >>> 0;
|
|
182
|
-
carry += lo < el ? 1 : 0;
|
|
183
|
-
return ah + bh + ch + dh + eh + carry >>> 0;
|
|
184
|
-
}
|
|
185
|
-
exports.sum64_5_hi = sum64_5_hi;
|
|
186
|
-
function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
|
|
187
|
-
return al + bl + cl + dl + el >>> 0;
|
|
188
|
-
}
|
|
189
|
-
exports.sum64_5_lo = sum64_5_lo;
|
|
190
|
-
function rotr64_hi(ah, al, num) {
|
|
191
|
-
return (al << 32 - num | ah >>> num) >>> 0;
|
|
192
|
-
}
|
|
193
|
-
exports.rotr64_hi = rotr64_hi;
|
|
194
|
-
function rotr64_lo(ah, al, num) {
|
|
195
|
-
return (ah << 32 - num | al >>> num) >>> 0;
|
|
196
|
-
}
|
|
197
|
-
exports.rotr64_lo = rotr64_lo;
|
|
198
|
-
function shr64_hi(ah, al, num) {
|
|
199
|
-
return ah >>> num;
|
|
200
|
-
}
|
|
201
|
-
exports.shr64_hi = shr64_hi;
|
|
202
|
-
function shr64_lo(ah, al, num) {
|
|
203
|
-
return (ah << 32 - num | al >>> num) >>> 0;
|
|
204
|
-
}
|
|
205
|
-
exports.shr64_lo = shr64_lo;
|
|
206
|
-
}));
|
|
207
|
-
|
|
208
|
-
//#endregion
|
|
209
|
-
export default require_utils();
|
|
210
|
-
|
|
211
|
-
export { require_utils };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require_utils } from "./hash/utils.mjs";
|
|
3
|
-
import { require_common } from "./hash/common.mjs";
|
|
4
|
-
import { require_sha } from "./hash/sha.mjs";
|
|
5
|
-
import { require_ripemd } from "./hash/ripemd.mjs";
|
|
6
|
-
import { require_hmac } from "./hash/hmac.mjs";
|
|
7
|
-
|
|
8
|
-
//#region ../../node_modules/hash.js/lib/hash.js
|
|
9
|
-
var require_hash = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
10
|
-
var hash = exports;
|
|
11
|
-
hash.utils = require_utils();
|
|
12
|
-
hash.common = require_common();
|
|
13
|
-
hash.sha = require_sha();
|
|
14
|
-
hash.ripemd = require_ripemd();
|
|
15
|
-
hash.hmac = require_hmac();
|
|
16
|
-
hash.sha1 = hash.sha.sha1;
|
|
17
|
-
hash.sha256 = hash.sha.sha256;
|
|
18
|
-
hash.sha224 = hash.sha.sha224;
|
|
19
|
-
hash.sha384 = hash.sha.sha384;
|
|
20
|
-
hash.sha512 = hash.sha.sha512;
|
|
21
|
-
hash.ripemd160 = hash.ripemd.ripemd160;
|
|
22
|
-
}));
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
export default require_hash();
|
|
26
|
-
|
|
27
|
-
export { require_hash };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin, __require } from "../../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require_inherits_browser } from "./inherits_browser.mjs";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/inherits/inherits.js
|
|
5
|
-
var require_inherits = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6
|
-
try {
|
|
7
|
-
var util = __require("util");
|
|
8
|
-
/* istanbul ignore next */
|
|
9
|
-
if (typeof util.inherits !== "function") throw "";
|
|
10
|
-
module.exports = util.inherits;
|
|
11
|
-
} catch (e) {
|
|
12
|
-
/* istanbul ignore next */
|
|
13
|
-
module.exports = require_inherits_browser();
|
|
14
|
-
}
|
|
15
|
-
}));
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
export default require_inherits();
|
|
19
|
-
|
|
20
|
-
export { require_inherits };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/inherits/inherits_browser.js
|
|
4
|
-
var require_inherits_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
-
if (typeof Object.create === "function") module.exports = function inherits(ctor, superCtor) {
|
|
6
|
-
if (superCtor) {
|
|
7
|
-
ctor.super_ = superCtor;
|
|
8
|
-
ctor.prototype = Object.create(superCtor.prototype, { constructor: {
|
|
9
|
-
value: ctor,
|
|
10
|
-
enumerable: false,
|
|
11
|
-
writable: true,
|
|
12
|
-
configurable: true
|
|
13
|
-
} });
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
else module.exports = function inherits(ctor, superCtor) {
|
|
17
|
-
if (superCtor) {
|
|
18
|
-
ctor.super_ = superCtor;
|
|
19
|
-
var TempCtor = function() {};
|
|
20
|
-
TempCtor.prototype = superCtor.prototype;
|
|
21
|
-
ctor.prototype = new TempCtor();
|
|
22
|
-
ctor.prototype.constructor = ctor;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}));
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
export default require_inherits_browser();
|
|
29
|
-
|
|
30
|
-
export { require_inherits_browser };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/minimalistic-assert/index.js
|
|
4
|
-
var require_minimalistic_assert = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
-
module.exports = assert;
|
|
6
|
-
function assert(val, msg) {
|
|
7
|
-
if (!val) throw new Error(msg || "Assertion failed");
|
|
8
|
-
}
|
|
9
|
-
assert.equal = function assertEqual(l, r, msg) {
|
|
10
|
-
if (l != r) throw new Error(msg || "Assertion failed: " + l + " != " + r);
|
|
11
|
-
};
|
|
12
|
-
}));
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
export default require_minimalistic_assert();
|
|
16
|
-
|
|
17
|
-
export { require_minimalistic_assert };
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
4
|
-
const require_index = require('../../../minimalistic-assert/index.cjs');
|
|
5
|
-
const require_utils$1 = require('./utils.cjs');
|
|
6
|
-
|
|
7
|
-
//#region ../../node_modules/hash.js/lib/hash/common.js
|
|
8
|
-
var require_common = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
|
|
9
|
-
var utils = require_utils$1.default;
|
|
10
|
-
var assert = require_index.default;
|
|
11
|
-
function BlockHash() {
|
|
12
|
-
this.pending = null;
|
|
13
|
-
this.pendingTotal = 0;
|
|
14
|
-
this.blockSize = this.constructor.blockSize;
|
|
15
|
-
this.outSize = this.constructor.outSize;
|
|
16
|
-
this.hmacStrength = this.constructor.hmacStrength;
|
|
17
|
-
this.padLength = this.constructor.padLength / 8;
|
|
18
|
-
this.endian = "big";
|
|
19
|
-
this._delta8 = this.blockSize / 8;
|
|
20
|
-
this._delta32 = this.blockSize / 32;
|
|
21
|
-
}
|
|
22
|
-
exports.BlockHash = BlockHash;
|
|
23
|
-
BlockHash.prototype.update = function update(msg, enc) {
|
|
24
|
-
msg = utils.toArray(msg, enc);
|
|
25
|
-
if (!this.pending) this.pending = msg;
|
|
26
|
-
else this.pending = this.pending.concat(msg);
|
|
27
|
-
this.pendingTotal += msg.length;
|
|
28
|
-
if (this.pending.length >= this._delta8) {
|
|
29
|
-
msg = this.pending;
|
|
30
|
-
var r = msg.length % this._delta8;
|
|
31
|
-
this.pending = msg.slice(msg.length - r, msg.length);
|
|
32
|
-
if (this.pending.length === 0) this.pending = null;
|
|
33
|
-
msg = utils.join32(msg, 0, msg.length - r, this.endian);
|
|
34
|
-
for (var i = 0; i < msg.length; i += this._delta32) this._update(msg, i, i + this._delta32);
|
|
35
|
-
}
|
|
36
|
-
return this;
|
|
37
|
-
};
|
|
38
|
-
BlockHash.prototype.digest = function digest(enc) {
|
|
39
|
-
this.update(this._pad());
|
|
40
|
-
assert(this.pending === null);
|
|
41
|
-
return this._digest(enc);
|
|
42
|
-
};
|
|
43
|
-
BlockHash.prototype._pad = function pad() {
|
|
44
|
-
var len = this.pendingTotal;
|
|
45
|
-
var bytes = this._delta8;
|
|
46
|
-
var k = bytes - (len + this.padLength) % bytes;
|
|
47
|
-
var res = new Array(k + this.padLength);
|
|
48
|
-
res[0] = 128;
|
|
49
|
-
for (var i = 1; i < k; i++) res[i] = 0;
|
|
50
|
-
len <<= 3;
|
|
51
|
-
if (this.endian === "big") {
|
|
52
|
-
for (var t = 8; t < this.padLength; t++) res[i++] = 0;
|
|
53
|
-
res[i++] = 0;
|
|
54
|
-
res[i++] = 0;
|
|
55
|
-
res[i++] = 0;
|
|
56
|
-
res[i++] = 0;
|
|
57
|
-
res[i++] = len >>> 24 & 255;
|
|
58
|
-
res[i++] = len >>> 16 & 255;
|
|
59
|
-
res[i++] = len >>> 8 & 255;
|
|
60
|
-
res[i++] = len & 255;
|
|
61
|
-
} else {
|
|
62
|
-
res[i++] = len & 255;
|
|
63
|
-
res[i++] = len >>> 8 & 255;
|
|
64
|
-
res[i++] = len >>> 16 & 255;
|
|
65
|
-
res[i++] = len >>> 24 & 255;
|
|
66
|
-
res[i++] = 0;
|
|
67
|
-
res[i++] = 0;
|
|
68
|
-
res[i++] = 0;
|
|
69
|
-
res[i++] = 0;
|
|
70
|
-
for (t = 8; t < this.padLength; t++) res[i++] = 0;
|
|
71
|
-
}
|
|
72
|
-
return res;
|
|
73
|
-
};
|
|
74
|
-
}));
|
|
75
|
-
|
|
76
|
-
//#endregion
|
|
77
|
-
Object.defineProperty(exports, 'default', {
|
|
78
|
-
enumerable: true,
|
|
79
|
-
get: function () {
|
|
80
|
-
return require_common();
|
|
81
|
-
}
|
|
82
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
4
|
-
const require_index = require('../../../minimalistic-assert/index.cjs');
|
|
5
|
-
const require_utils$1 = require('./utils.cjs');
|
|
6
|
-
|
|
7
|
-
//#region ../../node_modules/hash.js/lib/hash/hmac.js
|
|
8
|
-
var require_hmac = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports, module) => {
|
|
9
|
-
var utils = require_utils$1.default;
|
|
10
|
-
var assert = require_index.default;
|
|
11
|
-
function Hmac(hash, key, enc) {
|
|
12
|
-
if (!(this instanceof Hmac)) return new Hmac(hash, key, enc);
|
|
13
|
-
this.Hash = hash;
|
|
14
|
-
this.blockSize = hash.blockSize / 8;
|
|
15
|
-
this.outSize = hash.outSize / 8;
|
|
16
|
-
this.inner = null;
|
|
17
|
-
this.outer = null;
|
|
18
|
-
this._init(utils.toArray(key, enc));
|
|
19
|
-
}
|
|
20
|
-
module.exports = Hmac;
|
|
21
|
-
Hmac.prototype._init = function init(key) {
|
|
22
|
-
if (key.length > this.blockSize) key = new this.Hash().update(key).digest();
|
|
23
|
-
assert(key.length <= this.blockSize);
|
|
24
|
-
for (var i = key.length; i < this.blockSize; i++) key.push(0);
|
|
25
|
-
for (i = 0; i < key.length; i++) key[i] ^= 54;
|
|
26
|
-
this.inner = new this.Hash().update(key);
|
|
27
|
-
for (i = 0; i < key.length; i++) key[i] ^= 106;
|
|
28
|
-
this.outer = new this.Hash().update(key);
|
|
29
|
-
};
|
|
30
|
-
Hmac.prototype.update = function update(msg, enc) {
|
|
31
|
-
this.inner.update(msg, enc);
|
|
32
|
-
return this;
|
|
33
|
-
};
|
|
34
|
-
Hmac.prototype.digest = function digest(enc) {
|
|
35
|
-
this.outer.update(this.inner.digest());
|
|
36
|
-
return this.outer.digest(enc);
|
|
37
|
-
};
|
|
38
|
-
}));
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
Object.defineProperty(exports, 'default', {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
get: function () {
|
|
44
|
-
return require_hmac();
|
|
45
|
-
}
|
|
46
|
-
});
|