meteor-node-stubs 1.2.22 → 1.2.23
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_modules/sha.js/.eslintrc +76 -0
- package/node_modules/sha.js/CHANGELOG.md +423 -0
- package/node_modules/sha.js/README.md +1 -1
- package/node_modules/sha.js/bin.js +30 -27
- package/node_modules/sha.js/hash.js +65 -62
- package/node_modules/sha.js/index.js +16 -12
- package/node_modules/sha.js/package.json +56 -28
- package/node_modules/sha.js/sha.js +73 -63
- package/node_modules/sha.js/sha1.js +75 -65
- package/node_modules/sha.js/sha224.js +34 -32
- package/node_modules/sha.js/sha256.js +159 -105
- package/node_modules/sha.js/sha384.js +46 -44
- package/node_modules/sha.js/sha512.js +355 -233
- package/node_modules/sha.js/test/hash.js +63 -58
- package/node_modules/sha.js/test/test.js +120 -82
- package/node_modules/sha.js/test/vectors.js +58 -58
- package/package.json +3 -1
- package/node_modules/sha.js/.travis.yml +0 -17
|
@@ -1,260 +1,382 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var inherits = require('inherits');
|
|
4
|
+
var Hash = require('./hash');
|
|
5
|
+
var Buffer = require('safe-buffer').Buffer;
|
|
4
6
|
|
|
5
7
|
var K = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
8
|
+
0x428a2f98,
|
|
9
|
+
0xd728ae22,
|
|
10
|
+
0x71374491,
|
|
11
|
+
0x23ef65cd,
|
|
12
|
+
0xb5c0fbcf,
|
|
13
|
+
0xec4d3b2f,
|
|
14
|
+
0xe9b5dba5,
|
|
15
|
+
0x8189dbbc,
|
|
16
|
+
0x3956c25b,
|
|
17
|
+
0xf348b538,
|
|
18
|
+
0x59f111f1,
|
|
19
|
+
0xb605d019,
|
|
20
|
+
0x923f82a4,
|
|
21
|
+
0xaf194f9b,
|
|
22
|
+
0xab1c5ed5,
|
|
23
|
+
0xda6d8118,
|
|
24
|
+
0xd807aa98,
|
|
25
|
+
0xa3030242,
|
|
26
|
+
0x12835b01,
|
|
27
|
+
0x45706fbe,
|
|
28
|
+
0x243185be,
|
|
29
|
+
0x4ee4b28c,
|
|
30
|
+
0x550c7dc3,
|
|
31
|
+
0xd5ffb4e2,
|
|
32
|
+
0x72be5d74,
|
|
33
|
+
0xf27b896f,
|
|
34
|
+
0x80deb1fe,
|
|
35
|
+
0x3b1696b1,
|
|
36
|
+
0x9bdc06a7,
|
|
37
|
+
0x25c71235,
|
|
38
|
+
0xc19bf174,
|
|
39
|
+
0xcf692694,
|
|
40
|
+
0xe49b69c1,
|
|
41
|
+
0x9ef14ad2,
|
|
42
|
+
0xefbe4786,
|
|
43
|
+
0x384f25e3,
|
|
44
|
+
0x0fc19dc6,
|
|
45
|
+
0x8b8cd5b5,
|
|
46
|
+
0x240ca1cc,
|
|
47
|
+
0x77ac9c65,
|
|
48
|
+
0x2de92c6f,
|
|
49
|
+
0x592b0275,
|
|
50
|
+
0x4a7484aa,
|
|
51
|
+
0x6ea6e483,
|
|
52
|
+
0x5cb0a9dc,
|
|
53
|
+
0xbd41fbd4,
|
|
54
|
+
0x76f988da,
|
|
55
|
+
0x831153b5,
|
|
56
|
+
0x983e5152,
|
|
57
|
+
0xee66dfab,
|
|
58
|
+
0xa831c66d,
|
|
59
|
+
0x2db43210,
|
|
60
|
+
0xb00327c8,
|
|
61
|
+
0x98fb213f,
|
|
62
|
+
0xbf597fc7,
|
|
63
|
+
0xbeef0ee4,
|
|
64
|
+
0xc6e00bf3,
|
|
65
|
+
0x3da88fc2,
|
|
66
|
+
0xd5a79147,
|
|
67
|
+
0x930aa725,
|
|
68
|
+
0x06ca6351,
|
|
69
|
+
0xe003826f,
|
|
70
|
+
0x14292967,
|
|
71
|
+
0x0a0e6e70,
|
|
72
|
+
0x27b70a85,
|
|
73
|
+
0x46d22ffc,
|
|
74
|
+
0x2e1b2138,
|
|
75
|
+
0x5c26c926,
|
|
76
|
+
0x4d2c6dfc,
|
|
77
|
+
0x5ac42aed,
|
|
78
|
+
0x53380d13,
|
|
79
|
+
0x9d95b3df,
|
|
80
|
+
0x650a7354,
|
|
81
|
+
0x8baf63de,
|
|
82
|
+
0x766a0abb,
|
|
83
|
+
0x3c77b2a8,
|
|
84
|
+
0x81c2c92e,
|
|
85
|
+
0x47edaee6,
|
|
86
|
+
0x92722c85,
|
|
87
|
+
0x1482353b,
|
|
88
|
+
0xa2bfe8a1,
|
|
89
|
+
0x4cf10364,
|
|
90
|
+
0xa81a664b,
|
|
91
|
+
0xbc423001,
|
|
92
|
+
0xc24b8b70,
|
|
93
|
+
0xd0f89791,
|
|
94
|
+
0xc76c51a3,
|
|
95
|
+
0x0654be30,
|
|
96
|
+
0xd192e819,
|
|
97
|
+
0xd6ef5218,
|
|
98
|
+
0xd6990624,
|
|
99
|
+
0x5565a910,
|
|
100
|
+
0xf40e3585,
|
|
101
|
+
0x5771202a,
|
|
102
|
+
0x106aa070,
|
|
103
|
+
0x32bbd1b8,
|
|
104
|
+
0x19a4c116,
|
|
105
|
+
0xb8d2d0c8,
|
|
106
|
+
0x1e376c08,
|
|
107
|
+
0x5141ab53,
|
|
108
|
+
0x2748774c,
|
|
109
|
+
0xdf8eeb99,
|
|
110
|
+
0x34b0bcb5,
|
|
111
|
+
0xe19b48a8,
|
|
112
|
+
0x391c0cb3,
|
|
113
|
+
0xc5c95a63,
|
|
114
|
+
0x4ed8aa4a,
|
|
115
|
+
0xe3418acb,
|
|
116
|
+
0x5b9cca4f,
|
|
117
|
+
0x7763e373,
|
|
118
|
+
0x682e6ff3,
|
|
119
|
+
0xd6b2b8a3,
|
|
120
|
+
0x748f82ee,
|
|
121
|
+
0x5defb2fc,
|
|
122
|
+
0x78a5636f,
|
|
123
|
+
0x43172f60,
|
|
124
|
+
0x84c87814,
|
|
125
|
+
0xa1f0ab72,
|
|
126
|
+
0x8cc70208,
|
|
127
|
+
0x1a6439ec,
|
|
128
|
+
0x90befffa,
|
|
129
|
+
0x23631e28,
|
|
130
|
+
0xa4506ceb,
|
|
131
|
+
0xde82bde9,
|
|
132
|
+
0xbef9a3f7,
|
|
133
|
+
0xb2c67915,
|
|
134
|
+
0xc67178f2,
|
|
135
|
+
0xe372532b,
|
|
136
|
+
0xca273ece,
|
|
137
|
+
0xea26619c,
|
|
138
|
+
0xd186b8c7,
|
|
139
|
+
0x21c0c207,
|
|
140
|
+
0xeada7dd6,
|
|
141
|
+
0xcde0eb1e,
|
|
142
|
+
0xf57d4f7f,
|
|
143
|
+
0xee6ed178,
|
|
144
|
+
0x06f067aa,
|
|
145
|
+
0x72176fba,
|
|
146
|
+
0x0a637dc5,
|
|
147
|
+
0xa2c898a6,
|
|
148
|
+
0x113f9804,
|
|
149
|
+
0xbef90dae,
|
|
150
|
+
0x1b710b35,
|
|
151
|
+
0x131c471b,
|
|
152
|
+
0x28db77f5,
|
|
153
|
+
0x23047d84,
|
|
154
|
+
0x32caab7b,
|
|
155
|
+
0x40c72493,
|
|
156
|
+
0x3c9ebe0a,
|
|
157
|
+
0x15c9bebc,
|
|
158
|
+
0x431d67c4,
|
|
159
|
+
0x9c100d4c,
|
|
160
|
+
0x4cc5d4be,
|
|
161
|
+
0xcb3e42b6,
|
|
162
|
+
0x597f299c,
|
|
163
|
+
0xfc657e2a,
|
|
164
|
+
0x5fcb6fab,
|
|
165
|
+
0x3ad6faec,
|
|
166
|
+
0x6c44198c,
|
|
167
|
+
0x4a475817
|
|
168
|
+
];
|
|
169
|
+
|
|
170
|
+
var W = new Array(160);
|
|
171
|
+
|
|
172
|
+
function Sha512() {
|
|
173
|
+
this.init();
|
|
174
|
+
this._w = W;
|
|
175
|
+
|
|
176
|
+
Hash.call(this, 128, 112);
|
|
55
177
|
}
|
|
56
178
|
|
|
57
|
-
inherits(Sha512, Hash)
|
|
179
|
+
inherits(Sha512, Hash);
|
|
58
180
|
|
|
59
181
|
Sha512.prototype.init = function () {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function Ch
|
|
82
|
-
|
|
182
|
+
this._ah = 0x6a09e667;
|
|
183
|
+
this._bh = 0xbb67ae85;
|
|
184
|
+
this._ch = 0x3c6ef372;
|
|
185
|
+
this._dh = 0xa54ff53a;
|
|
186
|
+
this._eh = 0x510e527f;
|
|
187
|
+
this._fh = 0x9b05688c;
|
|
188
|
+
this._gh = 0x1f83d9ab;
|
|
189
|
+
this._hh = 0x5be0cd19;
|
|
190
|
+
|
|
191
|
+
this._al = 0xf3bcc908;
|
|
192
|
+
this._bl = 0x84caa73b;
|
|
193
|
+
this._cl = 0xfe94f82b;
|
|
194
|
+
this._dl = 0x5f1d36f1;
|
|
195
|
+
this._el = 0xade682d1;
|
|
196
|
+
this._fl = 0x2b3e6c1f;
|
|
197
|
+
this._gl = 0xfb41bd6b;
|
|
198
|
+
this._hl = 0x137e2179;
|
|
199
|
+
|
|
200
|
+
return this;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
function Ch(x, y, z) {
|
|
204
|
+
return z ^ (x & (y ^ z));
|
|
83
205
|
}
|
|
84
206
|
|
|
85
|
-
function maj
|
|
86
|
-
|
|
207
|
+
function maj(x, y, z) {
|
|
208
|
+
return (x & y) | (z & (x | y));
|
|
87
209
|
}
|
|
88
210
|
|
|
89
|
-
function sigma0
|
|
90
|
-
|
|
211
|
+
function sigma0(x, xl) {
|
|
212
|
+
return ((x >>> 28) | (xl << 4)) ^ ((xl >>> 2) | (x << 30)) ^ ((xl >>> 7) | (x << 25));
|
|
91
213
|
}
|
|
92
214
|
|
|
93
|
-
function sigma1
|
|
94
|
-
|
|
215
|
+
function sigma1(x, xl) {
|
|
216
|
+
return ((x >>> 14) | (xl << 18)) ^ ((x >>> 18) | (xl << 14)) ^ ((xl >>> 9) | (x << 23));
|
|
95
217
|
}
|
|
96
218
|
|
|
97
|
-
function Gamma0
|
|
98
|
-
|
|
219
|
+
function Gamma0(x, xl) {
|
|
220
|
+
return ((x >>> 1) | (xl << 31)) ^ ((x >>> 8) | (xl << 24)) ^ (x >>> 7);
|
|
99
221
|
}
|
|
100
222
|
|
|
101
|
-
function Gamma0l
|
|
102
|
-
|
|
223
|
+
function Gamma0l(x, xl) {
|
|
224
|
+
return ((x >>> 1) | (xl << 31)) ^ ((x >>> 8) | (xl << 24)) ^ ((x >>> 7) | (xl << 25));
|
|
103
225
|
}
|
|
104
226
|
|
|
105
|
-
function Gamma1
|
|
106
|
-
|
|
227
|
+
function Gamma1(x, xl) {
|
|
228
|
+
return ((x >>> 19) | (xl << 13)) ^ ((xl >>> 29) | (x << 3)) ^ (x >>> 6);
|
|
107
229
|
}
|
|
108
230
|
|
|
109
|
-
function Gamma1l
|
|
110
|
-
|
|
231
|
+
function Gamma1l(x, xl) {
|
|
232
|
+
return ((x >>> 19) | (xl << 13)) ^ ((xl >>> 29) | (x << 3)) ^ ((x >>> 6) | (xl << 26));
|
|
111
233
|
}
|
|
112
234
|
|
|
113
|
-
function getCarry
|
|
114
|
-
|
|
235
|
+
function getCarry(a, b) {
|
|
236
|
+
return (a >>> 0) < (b >>> 0) ? 1 : 0;
|
|
115
237
|
}
|
|
116
238
|
|
|
117
239
|
Sha512.prototype._update = function (M) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
240
|
+
var w = this._w;
|
|
241
|
+
|
|
242
|
+
var ah = this._ah | 0;
|
|
243
|
+
var bh = this._bh | 0;
|
|
244
|
+
var ch = this._ch | 0;
|
|
245
|
+
var dh = this._dh | 0;
|
|
246
|
+
var eh = this._eh | 0;
|
|
247
|
+
var fh = this._fh | 0;
|
|
248
|
+
var gh = this._gh | 0;
|
|
249
|
+
var hh = this._hh | 0;
|
|
250
|
+
|
|
251
|
+
var al = this._al | 0;
|
|
252
|
+
var bl = this._bl | 0;
|
|
253
|
+
var cl = this._cl | 0;
|
|
254
|
+
var dl = this._dl | 0;
|
|
255
|
+
var el = this._el | 0;
|
|
256
|
+
var fl = this._fl | 0;
|
|
257
|
+
var gl = this._gl | 0;
|
|
258
|
+
var hl = this._hl | 0;
|
|
259
|
+
|
|
260
|
+
for (var i = 0; i < 32; i += 2) {
|
|
261
|
+
w[i] = M.readInt32BE(i * 4);
|
|
262
|
+
w[i + 1] = M.readInt32BE((i * 4) + 4);
|
|
263
|
+
}
|
|
264
|
+
for (; i < 160; i += 2) {
|
|
265
|
+
var xh = w[i - (15 * 2)];
|
|
266
|
+
var xl = w[i - (15 * 2) + 1];
|
|
267
|
+
var gamma0 = Gamma0(xh, xl);
|
|
268
|
+
var gamma0l = Gamma0l(xl, xh);
|
|
269
|
+
|
|
270
|
+
xh = w[i - (2 * 2)];
|
|
271
|
+
xl = w[i - (2 * 2) + 1];
|
|
272
|
+
var gamma1 = Gamma1(xh, xl);
|
|
273
|
+
var gamma1l = Gamma1l(xl, xh);
|
|
274
|
+
|
|
275
|
+
// w[i] = gamma0 + w[i - 7] + gamma1 + w[i - 16]
|
|
276
|
+
var Wi7h = w[i - (7 * 2)];
|
|
277
|
+
var Wi7l = w[i - (7 * 2) + 1];
|
|
278
|
+
|
|
279
|
+
var Wi16h = w[i - (16 * 2)];
|
|
280
|
+
var Wi16l = w[i - (16 * 2) + 1];
|
|
281
|
+
|
|
282
|
+
var Wil = (gamma0l + Wi7l) | 0;
|
|
283
|
+
var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0;
|
|
284
|
+
Wil = (Wil + gamma1l) | 0;
|
|
285
|
+
Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0;
|
|
286
|
+
Wil = (Wil + Wi16l) | 0;
|
|
287
|
+
Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0;
|
|
288
|
+
|
|
289
|
+
w[i] = Wih;
|
|
290
|
+
w[i + 1] = Wil;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
for (var j = 0; j < 160; j += 2) {
|
|
294
|
+
Wih = w[j];
|
|
295
|
+
Wil = w[j + 1];
|
|
296
|
+
|
|
297
|
+
var majh = maj(ah, bh, ch);
|
|
298
|
+
var majl = maj(al, bl, cl);
|
|
299
|
+
|
|
300
|
+
var sigma0h = sigma0(ah, al);
|
|
301
|
+
var sigma0l = sigma0(al, ah);
|
|
302
|
+
var sigma1h = sigma1(eh, el);
|
|
303
|
+
var sigma1l = sigma1(el, eh);
|
|
304
|
+
|
|
305
|
+
// t1 = h + sigma1 + ch + K[j] + w[j]
|
|
306
|
+
var Kih = K[j];
|
|
307
|
+
var Kil = K[j + 1];
|
|
308
|
+
|
|
309
|
+
var chh = Ch(eh, fh, gh);
|
|
310
|
+
var chl = Ch(el, fl, gl);
|
|
311
|
+
|
|
312
|
+
var t1l = (hl + sigma1l) | 0;
|
|
313
|
+
var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0;
|
|
314
|
+
t1l = (t1l + chl) | 0;
|
|
315
|
+
t1h = (t1h + chh + getCarry(t1l, chl)) | 0;
|
|
316
|
+
t1l = (t1l + Kil) | 0;
|
|
317
|
+
t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0;
|
|
318
|
+
t1l = (t1l + Wil) | 0;
|
|
319
|
+
t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0;
|
|
320
|
+
|
|
321
|
+
// t2 = sigma0 + maj
|
|
322
|
+
var t2l = (sigma0l + majl) | 0;
|
|
323
|
+
var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0;
|
|
324
|
+
|
|
325
|
+
hh = gh;
|
|
326
|
+
hl = gl;
|
|
327
|
+
gh = fh;
|
|
328
|
+
gl = fl;
|
|
329
|
+
fh = eh;
|
|
330
|
+
fl = el;
|
|
331
|
+
el = (dl + t1l) | 0;
|
|
332
|
+
eh = (dh + t1h + getCarry(el, dl)) | 0;
|
|
333
|
+
dh = ch;
|
|
334
|
+
dl = cl;
|
|
335
|
+
ch = bh;
|
|
336
|
+
cl = bl;
|
|
337
|
+
bh = ah;
|
|
338
|
+
bl = al;
|
|
339
|
+
al = (t1l + t2l) | 0;
|
|
340
|
+
ah = (t1h + t2h + getCarry(al, t1l)) | 0;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
this._al = (this._al + al) | 0;
|
|
344
|
+
this._bl = (this._bl + bl) | 0;
|
|
345
|
+
this._cl = (this._cl + cl) | 0;
|
|
346
|
+
this._dl = (this._dl + dl) | 0;
|
|
347
|
+
this._el = (this._el + el) | 0;
|
|
348
|
+
this._fl = (this._fl + fl) | 0;
|
|
349
|
+
this._gl = (this._gl + gl) | 0;
|
|
350
|
+
this._hl = (this._hl + hl) | 0;
|
|
351
|
+
|
|
352
|
+
this._ah = (this._ah + ah + getCarry(this._al, al)) | 0;
|
|
353
|
+
this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0;
|
|
354
|
+
this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0;
|
|
355
|
+
this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0;
|
|
356
|
+
this._eh = (this._eh + eh + getCarry(this._el, el)) | 0;
|
|
357
|
+
this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0;
|
|
358
|
+
this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0;
|
|
359
|
+
this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0;
|
|
360
|
+
};
|
|
239
361
|
|
|
240
362
|
Sha512.prototype._hash = function () {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
module.exports = Sha512
|
|
363
|
+
var H = Buffer.allocUnsafe(64);
|
|
364
|
+
|
|
365
|
+
function writeInt64BE(h, l, offset) {
|
|
366
|
+
H.writeInt32BE(h, offset);
|
|
367
|
+
H.writeInt32BE(l, offset + 4);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
writeInt64BE(this._ah, this._al, 0);
|
|
371
|
+
writeInt64BE(this._bh, this._bl, 8);
|
|
372
|
+
writeInt64BE(this._ch, this._cl, 16);
|
|
373
|
+
writeInt64BE(this._dh, this._dl, 24);
|
|
374
|
+
writeInt64BE(this._eh, this._el, 32);
|
|
375
|
+
writeInt64BE(this._fh, this._fl, 40);
|
|
376
|
+
writeInt64BE(this._gh, this._gl, 48);
|
|
377
|
+
writeInt64BE(this._hh, this._hl, 56);
|
|
378
|
+
|
|
379
|
+
return H;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
module.exports = Sha512;
|