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.
@@ -1,260 +1,382 @@
1
- var inherits = require('inherits')
2
- var Hash = require('./hash')
3
- var Buffer = require('safe-buffer').Buffer
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
- 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
7
- 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
8
- 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
9
- 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
10
- 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
11
- 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
12
- 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
13
- 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
14
- 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
15
- 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
16
- 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
17
- 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
18
- 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
19
- 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
20
- 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
21
- 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
22
- 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
23
- 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
24
- 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
25
- 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
26
- 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
27
- 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
28
- 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
29
- 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
30
- 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
31
- 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
32
- 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
33
- 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
34
- 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
35
- 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
36
- 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
37
- 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
38
- 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
39
- 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
40
- 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
41
- 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
42
- 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
43
- 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
44
- 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
45
- 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
46
- ]
47
-
48
- var W = new Array(160)
49
-
50
- function Sha512 () {
51
- this.init()
52
- this._w = W
53
-
54
- Hash.call(this, 128, 112)
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
- this._ah = 0x6a09e667
61
- this._bh = 0xbb67ae85
62
- this._ch = 0x3c6ef372
63
- this._dh = 0xa54ff53a
64
- this._eh = 0x510e527f
65
- this._fh = 0x9b05688c
66
- this._gh = 0x1f83d9ab
67
- this._hh = 0x5be0cd19
68
-
69
- this._al = 0xf3bcc908
70
- this._bl = 0x84caa73b
71
- this._cl = 0xfe94f82b
72
- this._dl = 0x5f1d36f1
73
- this._el = 0xade682d1
74
- this._fl = 0x2b3e6c1f
75
- this._gl = 0xfb41bd6b
76
- this._hl = 0x137e2179
77
-
78
- return this
79
- }
80
-
81
- function Ch (x, y, z) {
82
- return z ^ (x & (y ^ z))
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 (x, y, z) {
86
- return (x & y) | (z & (x | y))
207
+ function maj(x, y, z) {
208
+ return (x & y) | (z & (x | y));
87
209
  }
88
210
 
89
- function sigma0 (x, xl) {
90
- return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)
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 (x, xl) {
94
- return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)
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 (x, xl) {
98
- return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)
219
+ function Gamma0(x, xl) {
220
+ return ((x >>> 1) | (xl << 31)) ^ ((x >>> 8) | (xl << 24)) ^ (x >>> 7);
99
221
  }
100
222
 
101
- function Gamma0l (x, xl) {
102
- return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)
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 (x, xl) {
106
- return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)
227
+ function Gamma1(x, xl) {
228
+ return ((x >>> 19) | (xl << 13)) ^ ((xl >>> 29) | (x << 3)) ^ (x >>> 6);
107
229
  }
108
230
 
109
- function Gamma1l (x, xl) {
110
- return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)
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 (a, b) {
114
- return (a >>> 0) < (b >>> 0) ? 1 : 0
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
- var W = this._w
119
-
120
- var ah = this._ah | 0
121
- var bh = this._bh | 0
122
- var ch = this._ch | 0
123
- var dh = this._dh | 0
124
- var eh = this._eh | 0
125
- var fh = this._fh | 0
126
- var gh = this._gh | 0
127
- var hh = this._hh | 0
128
-
129
- var al = this._al | 0
130
- var bl = this._bl | 0
131
- var cl = this._cl | 0
132
- var dl = this._dl | 0
133
- var el = this._el | 0
134
- var fl = this._fl | 0
135
- var gl = this._gl | 0
136
- var hl = this._hl | 0
137
-
138
- for (var i = 0; i < 32; i += 2) {
139
- W[i] = M.readInt32BE(i * 4)
140
- W[i + 1] = M.readInt32BE(i * 4 + 4)
141
- }
142
- for (; i < 160; i += 2) {
143
- var xh = W[i - 15 * 2]
144
- var xl = W[i - 15 * 2 + 1]
145
- var gamma0 = Gamma0(xh, xl)
146
- var gamma0l = Gamma0l(xl, xh)
147
-
148
- xh = W[i - 2 * 2]
149
- xl = W[i - 2 * 2 + 1]
150
- var gamma1 = Gamma1(xh, xl)
151
- var gamma1l = Gamma1l(xl, xh)
152
-
153
- // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
154
- var Wi7h = W[i - 7 * 2]
155
- var Wi7l = W[i - 7 * 2 + 1]
156
-
157
- var Wi16h = W[i - 16 * 2]
158
- var Wi16l = W[i - 16 * 2 + 1]
159
-
160
- var Wil = (gamma0l + Wi7l) | 0
161
- var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
162
- Wil = (Wil + gamma1l) | 0
163
- Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
164
- Wil = (Wil + Wi16l) | 0
165
- Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0
166
-
167
- W[i] = Wih
168
- W[i + 1] = Wil
169
- }
170
-
171
- for (var j = 0; j < 160; j += 2) {
172
- Wih = W[j]
173
- Wil = W[j + 1]
174
-
175
- var majh = maj(ah, bh, ch)
176
- var majl = maj(al, bl, cl)
177
-
178
- var sigma0h = sigma0(ah, al)
179
- var sigma0l = sigma0(al, ah)
180
- var sigma1h = sigma1(eh, el)
181
- var sigma1l = sigma1(el, eh)
182
-
183
- // t1 = h + sigma1 + ch + K[j] + W[j]
184
- var Kih = K[j]
185
- var Kil = K[j + 1]
186
-
187
- var chh = Ch(eh, fh, gh)
188
- var chl = Ch(el, fl, gl)
189
-
190
- var t1l = (hl + sigma1l) | 0
191
- var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
192
- t1l = (t1l + chl) | 0
193
- t1h = (t1h + chh + getCarry(t1l, chl)) | 0
194
- t1l = (t1l + Kil) | 0
195
- t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
196
- t1l = (t1l + Wil) | 0
197
- t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
198
-
199
- // t2 = sigma0 + maj
200
- var t2l = (sigma0l + majl) | 0
201
- var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
202
-
203
- hh = gh
204
- hl = gl
205
- gh = fh
206
- gl = fl
207
- fh = eh
208
- fl = el
209
- el = (dl + t1l) | 0
210
- eh = (dh + t1h + getCarry(el, dl)) | 0
211
- dh = ch
212
- dl = cl
213
- ch = bh
214
- cl = bl
215
- bh = ah
216
- bl = al
217
- al = (t1l + t2l) | 0
218
- ah = (t1h + t2h + getCarry(al, t1l)) | 0
219
- }
220
-
221
- this._al = (this._al + al) | 0
222
- this._bl = (this._bl + bl) | 0
223
- this._cl = (this._cl + cl) | 0
224
- this._dl = (this._dl + dl) | 0
225
- this._el = (this._el + el) | 0
226
- this._fl = (this._fl + fl) | 0
227
- this._gl = (this._gl + gl) | 0
228
- this._hl = (this._hl + hl) | 0
229
-
230
- this._ah = (this._ah + ah + getCarry(this._al, al)) | 0
231
- this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0
232
- this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0
233
- this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0
234
- this._eh = (this._eh + eh + getCarry(this._el, el)) | 0
235
- this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0
236
- this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0
237
- this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0
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
- var H = Buffer.allocUnsafe(64)
242
-
243
- function writeInt64BE (h, l, offset) {
244
- H.writeInt32BE(h, offset)
245
- H.writeInt32BE(l, offset + 4)
246
- }
247
-
248
- writeInt64BE(this._ah, this._al, 0)
249
- writeInt64BE(this._bh, this._bl, 8)
250
- writeInt64BE(this._ch, this._cl, 16)
251
- writeInt64BE(this._dh, this._dl, 24)
252
- writeInt64BE(this._eh, this._el, 32)
253
- writeInt64BE(this._fh, this._fl, 40)
254
- writeInt64BE(this._gh, this._gl, 48)
255
- writeInt64BE(this._hh, this._hl, 56)
256
-
257
- return H
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;