@frontegg/js 6.88.0 → 6.89.0-alpha.0
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/index.js +1 -1
- package/node/index.js +1 -1
- package/node/version.js +1 -1
- package/package.json +2 -2
- package/umd/frontegg.development.js +448 -554
- package/umd/frontegg.production.min.js +1 -1
- package/umd/frontegg.production.min.js.LICENSE.txt +11 -0
- package/version.js +1 -1
|
@@ -1204,7 +1204,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1204
1204
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
1205
1205
|
/* harmony export */ });
|
|
1206
1206
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
|
1207
|
-
cdnVersion: '6.
|
|
1207
|
+
cdnVersion: '6.89.0-alpha.0'
|
|
1208
1208
|
});
|
|
1209
1209
|
|
|
1210
1210
|
/***/ }),
|
|
@@ -16155,10 +16155,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16155
16155
|
/* harmony export */ });
|
|
16156
16156
|
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "../../node_modules/@babel/runtime/helpers/esm/extends.js");
|
|
16157
16157
|
/* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/feature-flags/index.js");
|
|
16158
|
-
/* harmony import */ var
|
|
16158
|
+
/* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @reduxjs/toolkit */ "../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
|
|
16159
16159
|
/* harmony import */ var redux_saga_effects__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! redux-saga/effects */ "../../node_modules/redux-saga/dist/redux-saga-effects-npm-proxy.esm.js");
|
|
16160
|
-
/* harmony import */ var
|
|
16161
|
-
|
|
16160
|
+
/* harmony import */ var _utils_sha256__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/sha256 */ "../../dist/@frontegg/redux-store/utils/sha256.js");
|
|
16161
|
+
|
|
16162
16162
|
|
|
16163
16163
|
|
|
16164
16164
|
|
|
@@ -16173,13 +16173,13 @@ function omitProps(props, keys) {
|
|
|
16173
16173
|
return newProps;
|
|
16174
16174
|
}
|
|
16175
16175
|
function generateActionCreator(storeName) {
|
|
16176
|
-
return (key, withPayload) => withPayload ? (0,
|
|
16176
|
+
return (key, withPayload) => withPayload ? (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_2__.createAction)(`${storeName}/${key}`, payload => ({
|
|
16177
16177
|
payload
|
|
16178
|
-
})) : (0,
|
|
16178
|
+
})) : (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_2__.createAction)(`${storeName}/${key}`);
|
|
16179
16179
|
}
|
|
16180
16180
|
async function generateCodeChallengePureJs(codeVerifier) {
|
|
16181
16181
|
// noinspection TypeScriptValidateJSTypes pure sha256 recevie single params alg name
|
|
16182
|
-
const digest =
|
|
16182
|
+
const digest = _utils_sha256__WEBPACK_IMPORTED_MODULE_3__.sha256.digest(new TextEncoder().encode(codeVerifier));
|
|
16183
16183
|
return btoa(String.fromCharCode(...new Uint8Array(digest))).replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
|
|
16184
16184
|
}
|
|
16185
16185
|
async function generateCodeChallengeNative(codeVerifier) {
|
|
@@ -18257,6 +18257,446 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18257
18257
|
/* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @reduxjs/toolkit */ "../../node_modules/reselect/es/index.js");
|
|
18258
18258
|
|
|
18259
18259
|
|
|
18260
|
+
/***/ }),
|
|
18261
|
+
|
|
18262
|
+
/***/ "../../dist/@frontegg/redux-store/utils/sha256.js":
|
|
18263
|
+
/*!********************************************************!*\
|
|
18264
|
+
!*** ../../dist/@frontegg/redux-store/utils/sha256.js ***!
|
|
18265
|
+
\********************************************************/
|
|
18266
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
18267
|
+
|
|
18268
|
+
"use strict";
|
|
18269
|
+
__webpack_require__.r(__webpack_exports__);
|
|
18270
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
18271
|
+
/* harmony export */ "hmac": () => (/* binding */ hmac),
|
|
18272
|
+
/* harmony export */ "sha256": () => (/* binding */ sha256)
|
|
18273
|
+
/* harmony export */ });
|
|
18274
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
18275
|
+
/**
|
|
18276
|
+
*
|
|
18277
|
+
* THIS IS CUSTOM VERSION OF JS-SHA256 that will be used only
|
|
18278
|
+
* on non-secure domain due to the native `crypto.subtle.digest`
|
|
18279
|
+
* isn't accessible from non-secure domains.
|
|
18280
|
+
*
|
|
18281
|
+
* NOTE: Changes from 0.9.0:
|
|
18282
|
+
* - Remove any usage of eval scripts
|
|
18283
|
+
* - Remove support for UMD and AMD exports
|
|
18284
|
+
* - Remove support for CommonJS
|
|
18285
|
+
* - Make it typescript
|
|
18286
|
+
*
|
|
18287
|
+
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
|
18288
|
+
*
|
|
18289
|
+
* @version 0.9.0
|
|
18290
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
18291
|
+
* @copyright Chen, Yi-Cyuan 2014-2017
|
|
18292
|
+
* @license MIT
|
|
18293
|
+
*/
|
|
18294
|
+
|
|
18295
|
+
const ERROR = 'input is invalid type';
|
|
18296
|
+
const ARRAY_BUFFER = typeof ArrayBuffer !== 'undefined';
|
|
18297
|
+
const HEX_CHARS = '0123456789abcdef'.split('');
|
|
18298
|
+
const EXTRA = [-2147483648, 8388608, 32768, 128];
|
|
18299
|
+
const SHIFT = [24, 16, 8, 0];
|
|
18300
|
+
const K = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2];
|
|
18301
|
+
const OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer'];
|
|
18302
|
+
const blocks = [];
|
|
18303
|
+
if (!Array.isArray) {
|
|
18304
|
+
Array.isArray = function (arg) {
|
|
18305
|
+
return Object.prototype.toString.call(arg) === '[object Array]';
|
|
18306
|
+
};
|
|
18307
|
+
}
|
|
18308
|
+
if (ARRAY_BUFFER && !ArrayBuffer.isView) {
|
|
18309
|
+
ArrayBuffer.isView = function (arg) {
|
|
18310
|
+
return typeof arg === 'object' && arg.buffer && arg.buffer.constructor === ArrayBuffer;
|
|
18311
|
+
};
|
|
18312
|
+
}
|
|
18313
|
+
const createOutputMethod = function (outputType) {
|
|
18314
|
+
return function (message) {
|
|
18315
|
+
const instance = new Sha256(true);
|
|
18316
|
+
const sha256MessageInstance = instance.update(message);
|
|
18317
|
+
return sha256MessageInstance == null ? void 0 : sha256MessageInstance[outputType]();
|
|
18318
|
+
};
|
|
18319
|
+
};
|
|
18320
|
+
const createMethod = function () {
|
|
18321
|
+
const method = createOutputMethod('hex');
|
|
18322
|
+
method.create = function () {
|
|
18323
|
+
return new Sha256();
|
|
18324
|
+
};
|
|
18325
|
+
method.update = function (message) {
|
|
18326
|
+
return method.create().update(message);
|
|
18327
|
+
};
|
|
18328
|
+
for (let i = 0; i < OUTPUT_TYPES.length; ++i) {
|
|
18329
|
+
const type = OUTPUT_TYPES[i];
|
|
18330
|
+
method[type] = createOutputMethod(type);
|
|
18331
|
+
}
|
|
18332
|
+
return method;
|
|
18333
|
+
};
|
|
18334
|
+
const createHmacOutputMethod = function (outputType) {
|
|
18335
|
+
return function (key, message) {
|
|
18336
|
+
const instance = new HmacSha256(key, true);
|
|
18337
|
+
const hmacMessageInstance = instance.update(message);
|
|
18338
|
+
return hmacMessageInstance == null ? void 0 : hmacMessageInstance[outputType]();
|
|
18339
|
+
};
|
|
18340
|
+
};
|
|
18341
|
+
const createHmacMethod = function () {
|
|
18342
|
+
const method = createHmacOutputMethod('hex');
|
|
18343
|
+
method.create = function (key) {
|
|
18344
|
+
return new HmacSha256(key);
|
|
18345
|
+
};
|
|
18346
|
+
method.update = function (key, message) {
|
|
18347
|
+
return method.create(key).update(message);
|
|
18348
|
+
};
|
|
18349
|
+
for (let i = 0; i < OUTPUT_TYPES.length; ++i) {
|
|
18350
|
+
const type = OUTPUT_TYPES[i];
|
|
18351
|
+
method[type] = createHmacOutputMethod(type);
|
|
18352
|
+
}
|
|
18353
|
+
return method;
|
|
18354
|
+
};
|
|
18355
|
+
class Sha256 {
|
|
18356
|
+
constructor(sharedMemory = false) {
|
|
18357
|
+
this.blocks = void 0;
|
|
18358
|
+
this.h0 = void 0;
|
|
18359
|
+
this.h1 = void 0;
|
|
18360
|
+
this.h2 = void 0;
|
|
18361
|
+
this.h3 = void 0;
|
|
18362
|
+
this.h4 = void 0;
|
|
18363
|
+
this.h5 = void 0;
|
|
18364
|
+
this.h6 = void 0;
|
|
18365
|
+
this.h7 = void 0;
|
|
18366
|
+
this.block = void 0;
|
|
18367
|
+
this.start = void 0;
|
|
18368
|
+
this.bytes = void 0;
|
|
18369
|
+
this.hBytes = void 0;
|
|
18370
|
+
this.finalized = void 0;
|
|
18371
|
+
this.hashed = void 0;
|
|
18372
|
+
this.first = void 0;
|
|
18373
|
+
this.lastByteIndex = void 0;
|
|
18374
|
+
this.sharedMemory = false;
|
|
18375
|
+
this.toString = () => this.hex();
|
|
18376
|
+
this.array = () => Sha256.prototype.digest();
|
|
18377
|
+
if (sharedMemory) {
|
|
18378
|
+
blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
|
|
18379
|
+
this.blocks = blocks;
|
|
18380
|
+
} else {
|
|
18381
|
+
this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
18382
|
+
}
|
|
18383
|
+
this.h0 = 0x6a09e667;
|
|
18384
|
+
this.h1 = 0xbb67ae85;
|
|
18385
|
+
this.h2 = 0x3c6ef372;
|
|
18386
|
+
this.h3 = 0xa54ff53a;
|
|
18387
|
+
this.h4 = 0x510e527f;
|
|
18388
|
+
this.h5 = 0x9b05688c;
|
|
18389
|
+
this.h6 = 0x1f83d9ab;
|
|
18390
|
+
this.h7 = 0x5be0cd19;
|
|
18391
|
+
this.block = this.start = this.bytes = this.hBytes = 0;
|
|
18392
|
+
this.finalized = this.hashed = false;
|
|
18393
|
+
this.first = true;
|
|
18394
|
+
this.sharedMemory = sharedMemory;
|
|
18395
|
+
}
|
|
18396
|
+
update(message) {
|
|
18397
|
+
if (this.finalized) {
|
|
18398
|
+
return undefined;
|
|
18399
|
+
}
|
|
18400
|
+
let notString;
|
|
18401
|
+
const type = typeof message;
|
|
18402
|
+
if (type !== 'string') {
|
|
18403
|
+
if (type === 'object') {
|
|
18404
|
+
if (message === null) {
|
|
18405
|
+
throw new Error(ERROR);
|
|
18406
|
+
} else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
|
|
18407
|
+
message = new Uint8Array(message);
|
|
18408
|
+
} else if (!Array.isArray(message)) {
|
|
18409
|
+
if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {
|
|
18410
|
+
throw new Error(ERROR);
|
|
18411
|
+
}
|
|
18412
|
+
}
|
|
18413
|
+
} else {
|
|
18414
|
+
throw new Error(ERROR);
|
|
18415
|
+
}
|
|
18416
|
+
notString = true;
|
|
18417
|
+
}
|
|
18418
|
+
let code,
|
|
18419
|
+
index = 0,
|
|
18420
|
+
i;
|
|
18421
|
+
const length = message.length;
|
|
18422
|
+
const blocks = this.blocks;
|
|
18423
|
+
while (index < length) {
|
|
18424
|
+
if (this.hashed) {
|
|
18425
|
+
this.hashed = false;
|
|
18426
|
+
blocks[0] = this.block;
|
|
18427
|
+
blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
|
|
18428
|
+
}
|
|
18429
|
+
if (notString) {
|
|
18430
|
+
for (i = this.start; index < length && i < 64; ++index) {
|
|
18431
|
+
blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
|
|
18432
|
+
}
|
|
18433
|
+
} else {
|
|
18434
|
+
for (i = this.start; index < length && i < 64; ++index) {
|
|
18435
|
+
code = message.charCodeAt(index);
|
|
18436
|
+
if (code < 0x80) {
|
|
18437
|
+
blocks[i >> 2] |= code << SHIFT[i++ & 3];
|
|
18438
|
+
} else if (code < 0x800) {
|
|
18439
|
+
blocks[i >> 2] |= (0xc0 | code >> 6) << SHIFT[i++ & 3];
|
|
18440
|
+
blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];
|
|
18441
|
+
} else if (code < 0xd800 || code >= 0xe000) {
|
|
18442
|
+
blocks[i >> 2] |= (0xe0 | code >> 12) << SHIFT[i++ & 3];
|
|
18443
|
+
blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];
|
|
18444
|
+
blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];
|
|
18445
|
+
} else {
|
|
18446
|
+
code = 0x10000 + ((code & 0x3ff) << 10 | message.charCodeAt(++index) & 0x3ff);
|
|
18447
|
+
blocks[i >> 2] |= (0xf0 | code >> 18) << SHIFT[i++ & 3];
|
|
18448
|
+
blocks[i >> 2] |= (0x80 | code >> 12 & 0x3f) << SHIFT[i++ & 3];
|
|
18449
|
+
blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];
|
|
18450
|
+
blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];
|
|
18451
|
+
}
|
|
18452
|
+
}
|
|
18453
|
+
}
|
|
18454
|
+
this.lastByteIndex = i;
|
|
18455
|
+
this.bytes += i - this.start;
|
|
18456
|
+
if (i >= 64) {
|
|
18457
|
+
this.block = blocks[16];
|
|
18458
|
+
this.start = i - 64;
|
|
18459
|
+
this.hash();
|
|
18460
|
+
this.hashed = true;
|
|
18461
|
+
} else {
|
|
18462
|
+
this.start = i;
|
|
18463
|
+
}
|
|
18464
|
+
}
|
|
18465
|
+
if (this.bytes > 4294967295) {
|
|
18466
|
+
this.hBytes += this.bytes / 4294967296 << 0;
|
|
18467
|
+
this.bytes = this.bytes % 4294967296;
|
|
18468
|
+
}
|
|
18469
|
+
return this;
|
|
18470
|
+
}
|
|
18471
|
+
finalize() {
|
|
18472
|
+
if (this.finalized) {
|
|
18473
|
+
return;
|
|
18474
|
+
}
|
|
18475
|
+
this.finalized = true;
|
|
18476
|
+
const blocks = this.blocks,
|
|
18477
|
+
i = this.lastByteIndex;
|
|
18478
|
+
blocks[16] = this.block;
|
|
18479
|
+
blocks[i >> 2] |= EXTRA[i & 3];
|
|
18480
|
+
this.block = blocks[16];
|
|
18481
|
+
if (i >= 56) {
|
|
18482
|
+
if (!this.hashed) {
|
|
18483
|
+
this.hash();
|
|
18484
|
+
}
|
|
18485
|
+
blocks[0] = this.block;
|
|
18486
|
+
blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
|
|
18487
|
+
}
|
|
18488
|
+
blocks[14] = this.hBytes << 3 | this.bytes >>> 29;
|
|
18489
|
+
blocks[15] = this.bytes << 3;
|
|
18490
|
+
this.hash();
|
|
18491
|
+
}
|
|
18492
|
+
hash() {
|
|
18493
|
+
let a = this.h0,
|
|
18494
|
+
b = this.h1,
|
|
18495
|
+
c = this.h2,
|
|
18496
|
+
d = this.h3,
|
|
18497
|
+
e = this.h4,
|
|
18498
|
+
f = this.h5,
|
|
18499
|
+
g = this.h6,
|
|
18500
|
+
h = this.h7,
|
|
18501
|
+
j,
|
|
18502
|
+
s0,
|
|
18503
|
+
s1,
|
|
18504
|
+
maj,
|
|
18505
|
+
t1,
|
|
18506
|
+
t2,
|
|
18507
|
+
ch,
|
|
18508
|
+
ab,
|
|
18509
|
+
da,
|
|
18510
|
+
cd,
|
|
18511
|
+
bc;
|
|
18512
|
+
const blocks = this.blocks;
|
|
18513
|
+
for (j = 16; j < 64; ++j) {
|
|
18514
|
+
// rightrotate
|
|
18515
|
+
t1 = blocks[j - 15];
|
|
18516
|
+
s0 = (t1 >>> 7 | t1 << 25) ^ (t1 >>> 18 | t1 << 14) ^ t1 >>> 3;
|
|
18517
|
+
t1 = blocks[j - 2];
|
|
18518
|
+
s1 = (t1 >>> 17 | t1 << 15) ^ (t1 >>> 19 | t1 << 13) ^ t1 >>> 10;
|
|
18519
|
+
blocks[j] = blocks[j - 16] + s0 + blocks[j - 7] + s1 << 0;
|
|
18520
|
+
}
|
|
18521
|
+
bc = b & c;
|
|
18522
|
+
for (j = 0; j < 64; j += 4) {
|
|
18523
|
+
if (this.first) {
|
|
18524
|
+
ab = 704751109;
|
|
18525
|
+
t1 = blocks[0] - 210244248;
|
|
18526
|
+
h = t1 - 1521486534 << 0;
|
|
18527
|
+
d = t1 + 143694565 << 0;
|
|
18528
|
+
this.first = false;
|
|
18529
|
+
} else {
|
|
18530
|
+
s0 = (a >>> 2 | a << 30) ^ (a >>> 13 | a << 19) ^ (a >>> 22 | a << 10);
|
|
18531
|
+
s1 = (e >>> 6 | e << 26) ^ (e >>> 11 | e << 21) ^ (e >>> 25 | e << 7);
|
|
18532
|
+
ab = a & b;
|
|
18533
|
+
maj = ab ^ a & c ^ bc;
|
|
18534
|
+
ch = e & f ^ ~e & g;
|
|
18535
|
+
t1 = h + s1 + ch + K[j] + blocks[j];
|
|
18536
|
+
t2 = s0 + maj;
|
|
18537
|
+
h = d + t1 << 0;
|
|
18538
|
+
d = t1 + t2 << 0;
|
|
18539
|
+
}
|
|
18540
|
+
s0 = (d >>> 2 | d << 30) ^ (d >>> 13 | d << 19) ^ (d >>> 22 | d << 10);
|
|
18541
|
+
s1 = (h >>> 6 | h << 26) ^ (h >>> 11 | h << 21) ^ (h >>> 25 | h << 7);
|
|
18542
|
+
da = d & a;
|
|
18543
|
+
maj = da ^ d & b ^ ab;
|
|
18544
|
+
ch = h & e ^ ~h & f;
|
|
18545
|
+
t1 = g + s1 + ch + K[j + 1] + blocks[j + 1];
|
|
18546
|
+
t2 = s0 + maj;
|
|
18547
|
+
g = c + t1 << 0;
|
|
18548
|
+
c = t1 + t2 << 0;
|
|
18549
|
+
s0 = (c >>> 2 | c << 30) ^ (c >>> 13 | c << 19) ^ (c >>> 22 | c << 10);
|
|
18550
|
+
s1 = (g >>> 6 | g << 26) ^ (g >>> 11 | g << 21) ^ (g >>> 25 | g << 7);
|
|
18551
|
+
cd = c & d;
|
|
18552
|
+
maj = cd ^ c & a ^ da;
|
|
18553
|
+
ch = g & h ^ ~g & e;
|
|
18554
|
+
t1 = f + s1 + ch + K[j + 2] + blocks[j + 2];
|
|
18555
|
+
t2 = s0 + maj;
|
|
18556
|
+
f = b + t1 << 0;
|
|
18557
|
+
b = t1 + t2 << 0;
|
|
18558
|
+
s0 = (b >>> 2 | b << 30) ^ (b >>> 13 | b << 19) ^ (b >>> 22 | b << 10);
|
|
18559
|
+
s1 = (f >>> 6 | f << 26) ^ (f >>> 11 | f << 21) ^ (f >>> 25 | f << 7);
|
|
18560
|
+
bc = b & c;
|
|
18561
|
+
maj = bc ^ b & d ^ cd;
|
|
18562
|
+
ch = f & g ^ ~f & h;
|
|
18563
|
+
t1 = e + s1 + ch + K[j + 3] + blocks[j + 3];
|
|
18564
|
+
t2 = s0 + maj;
|
|
18565
|
+
e = a + t1 << 0;
|
|
18566
|
+
a = t1 + t2 << 0;
|
|
18567
|
+
}
|
|
18568
|
+
this.h0 = this.h0 + a << 0;
|
|
18569
|
+
this.h1 = this.h1 + b << 0;
|
|
18570
|
+
this.h2 = this.h2 + c << 0;
|
|
18571
|
+
this.h3 = this.h3 + d << 0;
|
|
18572
|
+
this.h4 = this.h4 + e << 0;
|
|
18573
|
+
this.h5 = this.h5 + f << 0;
|
|
18574
|
+
this.h6 = this.h6 + g << 0;
|
|
18575
|
+
this.h7 = this.h7 + h << 0;
|
|
18576
|
+
}
|
|
18577
|
+
hex() {
|
|
18578
|
+
this.finalize();
|
|
18579
|
+
const h0 = this.h0,
|
|
18580
|
+
h1 = this.h1,
|
|
18581
|
+
h2 = this.h2,
|
|
18582
|
+
h3 = this.h3,
|
|
18583
|
+
h4 = this.h4,
|
|
18584
|
+
h5 = this.h5,
|
|
18585
|
+
h6 = this.h6,
|
|
18586
|
+
h7 = this.h7;
|
|
18587
|
+
let hex = HEX_CHARS[h0 >> 28 & 0x0f] + HEX_CHARS[h0 >> 24 & 0x0f] + HEX_CHARS[h0 >> 20 & 0x0f] + HEX_CHARS[h0 >> 16 & 0x0f] + HEX_CHARS[h0 >> 12 & 0x0f] + HEX_CHARS[h0 >> 8 & 0x0f] + HEX_CHARS[h0 >> 4 & 0x0f] + HEX_CHARS[h0 & 0x0f] + HEX_CHARS[h1 >> 28 & 0x0f] + HEX_CHARS[h1 >> 24 & 0x0f] + HEX_CHARS[h1 >> 20 & 0x0f] + HEX_CHARS[h1 >> 16 & 0x0f] + HEX_CHARS[h1 >> 12 & 0x0f] + HEX_CHARS[h1 >> 8 & 0x0f] + HEX_CHARS[h1 >> 4 & 0x0f] + HEX_CHARS[h1 & 0x0f] + HEX_CHARS[h2 >> 28 & 0x0f] + HEX_CHARS[h2 >> 24 & 0x0f] + HEX_CHARS[h2 >> 20 & 0x0f] + HEX_CHARS[h2 >> 16 & 0x0f] + HEX_CHARS[h2 >> 12 & 0x0f] + HEX_CHARS[h2 >> 8 & 0x0f] + HEX_CHARS[h2 >> 4 & 0x0f] + HEX_CHARS[h2 & 0x0f] + HEX_CHARS[h3 >> 28 & 0x0f] + HEX_CHARS[h3 >> 24 & 0x0f] + HEX_CHARS[h3 >> 20 & 0x0f] + HEX_CHARS[h3 >> 16 & 0x0f] + HEX_CHARS[h3 >> 12 & 0x0f] + HEX_CHARS[h3 >> 8 & 0x0f] + HEX_CHARS[h3 >> 4 & 0x0f] + HEX_CHARS[h3 & 0x0f] + HEX_CHARS[h4 >> 28 & 0x0f] + HEX_CHARS[h4 >> 24 & 0x0f] + HEX_CHARS[h4 >> 20 & 0x0f] + HEX_CHARS[h4 >> 16 & 0x0f] + HEX_CHARS[h4 >> 12 & 0x0f] + HEX_CHARS[h4 >> 8 & 0x0f] + HEX_CHARS[h4 >> 4 & 0x0f] + HEX_CHARS[h4 & 0x0f] + HEX_CHARS[h5 >> 28 & 0x0f] + HEX_CHARS[h5 >> 24 & 0x0f] + HEX_CHARS[h5 >> 20 & 0x0f] + HEX_CHARS[h5 >> 16 & 0x0f] + HEX_CHARS[h5 >> 12 & 0x0f] + HEX_CHARS[h5 >> 8 & 0x0f] + HEX_CHARS[h5 >> 4 & 0x0f] + HEX_CHARS[h5 & 0x0f] + HEX_CHARS[h6 >> 28 & 0x0f] + HEX_CHARS[h6 >> 24 & 0x0f] + HEX_CHARS[h6 >> 20 & 0x0f] + HEX_CHARS[h6 >> 16 & 0x0f] + HEX_CHARS[h6 >> 12 & 0x0f] + HEX_CHARS[h6 >> 8 & 0x0f] + HEX_CHARS[h6 >> 4 & 0x0f] + HEX_CHARS[h6 & 0x0f];
|
|
18588
|
+
hex += HEX_CHARS[h7 >> 28 & 0x0f] + HEX_CHARS[h7 >> 24 & 0x0f] + HEX_CHARS[h7 >> 20 & 0x0f] + HEX_CHARS[h7 >> 16 & 0x0f] + HEX_CHARS[h7 >> 12 & 0x0f] + HEX_CHARS[h7 >> 8 & 0x0f] + HEX_CHARS[h7 >> 4 & 0x0f] + HEX_CHARS[h7 & 0x0f];
|
|
18589
|
+
return hex;
|
|
18590
|
+
}
|
|
18591
|
+
digest() {
|
|
18592
|
+
this.finalize();
|
|
18593
|
+
const h0 = this.h0,
|
|
18594
|
+
h1 = this.h1,
|
|
18595
|
+
h2 = this.h2,
|
|
18596
|
+
h3 = this.h3,
|
|
18597
|
+
h4 = this.h4,
|
|
18598
|
+
h5 = this.h5,
|
|
18599
|
+
h6 = this.h6,
|
|
18600
|
+
h7 = this.h7;
|
|
18601
|
+
const arr = [h0 >> 24 & 0xff, h0 >> 16 & 0xff, h0 >> 8 & 0xff, h0 & 0xff, h1 >> 24 & 0xff, h1 >> 16 & 0xff, h1 >> 8 & 0xff, h1 & 0xff, h2 >> 24 & 0xff, h2 >> 16 & 0xff, h2 >> 8 & 0xff, h2 & 0xff, h3 >> 24 & 0xff, h3 >> 16 & 0xff, h3 >> 8 & 0xff, h3 & 0xff, h4 >> 24 & 0xff, h4 >> 16 & 0xff, h4 >> 8 & 0xff, h4 & 0xff, h5 >> 24 & 0xff, h5 >> 16 & 0xff, h5 >> 8 & 0xff, h5 & 0xff, h6 >> 24 & 0xff, h6 >> 16 & 0xff, h6 >> 8 & 0xff, h6 & 0xff];
|
|
18602
|
+
arr.push(h7 >> 24 & 0xff, h7 >> 16 & 0xff, h7 >> 8 & 0xff, h7 & 0xff);
|
|
18603
|
+
return arr;
|
|
18604
|
+
}
|
|
18605
|
+
arrayBuffer() {
|
|
18606
|
+
this.finalize();
|
|
18607
|
+
const buffer = new ArrayBuffer(32);
|
|
18608
|
+
const dataView = new DataView(buffer);
|
|
18609
|
+
dataView.setUint32(0, this.h0);
|
|
18610
|
+
dataView.setUint32(4, this.h1);
|
|
18611
|
+
dataView.setUint32(8, this.h2);
|
|
18612
|
+
dataView.setUint32(12, this.h3);
|
|
18613
|
+
dataView.setUint32(16, this.h4);
|
|
18614
|
+
dataView.setUint32(20, this.h5);
|
|
18615
|
+
dataView.setUint32(24, this.h6);
|
|
18616
|
+
dataView.setUint32(28, this.h7);
|
|
18617
|
+
return buffer;
|
|
18618
|
+
}
|
|
18619
|
+
}
|
|
18620
|
+
class HmacSha256 extends Sha256 {
|
|
18621
|
+
constructor(key, sharedMemory = false) {
|
|
18622
|
+
super(sharedMemory);
|
|
18623
|
+
this.inner = void 0;
|
|
18624
|
+
this.oKeyPad = void 0;
|
|
18625
|
+
let i;
|
|
18626
|
+
const type = typeof key;
|
|
18627
|
+
if (type === 'string') {
|
|
18628
|
+
const bytes = [],
|
|
18629
|
+
length = key.length;
|
|
18630
|
+
let index = 0,
|
|
18631
|
+
code;
|
|
18632
|
+
for (i = 0; i < length; ++i) {
|
|
18633
|
+
code = key.charCodeAt(i);
|
|
18634
|
+
if (code < 0x80) {
|
|
18635
|
+
bytes[index++] = code;
|
|
18636
|
+
} else if (code < 0x800) {
|
|
18637
|
+
bytes[index++] = 0xc0 | code >> 6;
|
|
18638
|
+
bytes[index++] = 0x80 | code & 0x3f;
|
|
18639
|
+
} else if (code < 0xd800 || code >= 0xe000) {
|
|
18640
|
+
bytes[index++] = 0xe0 | code >> 12;
|
|
18641
|
+
bytes[index++] = 0x80 | code >> 6 & 0x3f;
|
|
18642
|
+
bytes[index++] = 0x80 | code & 0x3f;
|
|
18643
|
+
} else {
|
|
18644
|
+
code = 0x10000 + ((code & 0x3ff) << 10 | key.charCodeAt(++i) & 0x3ff);
|
|
18645
|
+
bytes[index++] = 0xf0 | code >> 18;
|
|
18646
|
+
bytes[index++] = 0x80 | code >> 12 & 0x3f;
|
|
18647
|
+
bytes[index++] = 0x80 | code >> 6 & 0x3f;
|
|
18648
|
+
bytes[index++] = 0x80 | code & 0x3f;
|
|
18649
|
+
}
|
|
18650
|
+
}
|
|
18651
|
+
key = bytes;
|
|
18652
|
+
} else {
|
|
18653
|
+
if (type === 'object') {
|
|
18654
|
+
if (key === null) {
|
|
18655
|
+
throw new Error(ERROR);
|
|
18656
|
+
} else if (ARRAY_BUFFER && key.constructor === ArrayBuffer) {
|
|
18657
|
+
key = new Uint8Array(key);
|
|
18658
|
+
} else if (!Array.isArray(key)) {
|
|
18659
|
+
if (!ARRAY_BUFFER || !ArrayBuffer.isView(key)) {
|
|
18660
|
+
throw new Error(ERROR);
|
|
18661
|
+
}
|
|
18662
|
+
}
|
|
18663
|
+
} else {
|
|
18664
|
+
throw new Error(ERROR);
|
|
18665
|
+
}
|
|
18666
|
+
}
|
|
18667
|
+
if (key.length > 64) {
|
|
18668
|
+
var _Sha256$update;
|
|
18669
|
+
key = (_Sha256$update = new Sha256(true).update(key)) == null ? void 0 : _Sha256$update.array();
|
|
18670
|
+
}
|
|
18671
|
+
const oKeyPad = [],
|
|
18672
|
+
iKeyPad = [];
|
|
18673
|
+
for (i = 0; i < 64; ++i) {
|
|
18674
|
+
const b = key[i] || 0;
|
|
18675
|
+
oKeyPad[i] = 0x5c ^ b;
|
|
18676
|
+
iKeyPad[i] = 0x36 ^ b;
|
|
18677
|
+
}
|
|
18678
|
+
Sha256.call(this, sharedMemory);
|
|
18679
|
+
this.update(iKeyPad);
|
|
18680
|
+
this.oKeyPad = oKeyPad;
|
|
18681
|
+
this.inner = true;
|
|
18682
|
+
this.sharedMemory = sharedMemory;
|
|
18683
|
+
}
|
|
18684
|
+
finalize() {
|
|
18685
|
+
super.finalize();
|
|
18686
|
+
if (this.inner) {
|
|
18687
|
+
this.inner = false;
|
|
18688
|
+
const innerHash = this.array();
|
|
18689
|
+
Sha256.call(this, this.sharedMemory);
|
|
18690
|
+
this.update(this.oKeyPad);
|
|
18691
|
+
this.update(innerHash);
|
|
18692
|
+
Sha256.prototype.finalize.call(this);
|
|
18693
|
+
}
|
|
18694
|
+
}
|
|
18695
|
+
}
|
|
18696
|
+
const sha256 = createMethod();
|
|
18697
|
+
const hmac = createHmacMethod();
|
|
18698
|
+
|
|
18699
|
+
|
|
18260
18700
|
/***/ }),
|
|
18261
18701
|
|
|
18262
18702
|
/***/ "../../dist/@frontegg/redux-store/vendor/VendorState/index.js":
|
|
@@ -19071,7 +19511,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19071
19511
|
/* harmony export */ });
|
|
19072
19512
|
/* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
|
|
19073
19513
|
/* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
|
|
19074
|
-
/** @license Frontegg v6.
|
|
19514
|
+
/** @license Frontegg v6.89.0-alpha.0
|
|
19075
19515
|
*
|
|
19076
19516
|
* This source code is licensed under the MIT license found in the
|
|
19077
19517
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -27308,535 +27748,6 @@ var deepmerge_1 = deepmerge;
|
|
|
27308
27748
|
module.exports = deepmerge_1;
|
|
27309
27749
|
|
|
27310
27750
|
|
|
27311
|
-
/***/ }),
|
|
27312
|
-
|
|
27313
|
-
/***/ "../../node_modules/js-sha256/src/sha256.js":
|
|
27314
|
-
/*!**************************************************!*\
|
|
27315
|
-
!*** ../../node_modules/js-sha256/src/sha256.js ***!
|
|
27316
|
-
\**************************************************/
|
|
27317
|
-
/***/ ((module, exports, __webpack_require__) => {
|
|
27318
|
-
|
|
27319
|
-
var __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
27320
|
-
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
|
27321
|
-
*
|
|
27322
|
-
* @version 0.9.0
|
|
27323
|
-
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
27324
|
-
* @copyright Chen, Yi-Cyuan 2014-2017
|
|
27325
|
-
* @license MIT
|
|
27326
|
-
*/
|
|
27327
|
-
/*jslint bitwise: true */
|
|
27328
|
-
(function () {
|
|
27329
|
-
'use strict';
|
|
27330
|
-
|
|
27331
|
-
var ERROR = 'input is invalid type';
|
|
27332
|
-
var WINDOW = typeof window === 'object';
|
|
27333
|
-
var root = WINDOW ? window : {};
|
|
27334
|
-
if (root.JS_SHA256_NO_WINDOW) {
|
|
27335
|
-
WINDOW = false;
|
|
27336
|
-
}
|
|
27337
|
-
var WEB_WORKER = !WINDOW && typeof self === 'object';
|
|
27338
|
-
var NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
|
|
27339
|
-
if (NODE_JS) {
|
|
27340
|
-
root = __webpack_require__.g;
|
|
27341
|
-
} else if (WEB_WORKER) {
|
|
27342
|
-
root = self;
|
|
27343
|
-
}
|
|
27344
|
-
var COMMON_JS = !root.JS_SHA256_NO_COMMON_JS && "object" === 'object' && module.exports;
|
|
27345
|
-
var AMD = true && __webpack_require__.amdO;
|
|
27346
|
-
var ARRAY_BUFFER = !root.JS_SHA256_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';
|
|
27347
|
-
var HEX_CHARS = '0123456789abcdef'.split('');
|
|
27348
|
-
var EXTRA = [-2147483648, 8388608, 32768, 128];
|
|
27349
|
-
var SHIFT = [24, 16, 8, 0];
|
|
27350
|
-
var K = [
|
|
27351
|
-
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
|
27352
|
-
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
|
27353
|
-
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
|
27354
|
-
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
|
27355
|
-
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
|
27356
|
-
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
|
27357
|
-
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
|
27358
|
-
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
|
|
27359
|
-
];
|
|
27360
|
-
var OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer'];
|
|
27361
|
-
|
|
27362
|
-
var blocks = [];
|
|
27363
|
-
|
|
27364
|
-
if (root.JS_SHA256_NO_NODE_JS || !Array.isArray) {
|
|
27365
|
-
Array.isArray = function (obj) {
|
|
27366
|
-
return Object.prototype.toString.call(obj) === '[object Array]';
|
|
27367
|
-
};
|
|
27368
|
-
}
|
|
27369
|
-
|
|
27370
|
-
if (ARRAY_BUFFER && (root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
|
|
27371
|
-
ArrayBuffer.isView = function (obj) {
|
|
27372
|
-
return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;
|
|
27373
|
-
};
|
|
27374
|
-
}
|
|
27375
|
-
|
|
27376
|
-
var createOutputMethod = function (outputType, is224) {
|
|
27377
|
-
return function (message) {
|
|
27378
|
-
return new Sha256(is224, true).update(message)[outputType]();
|
|
27379
|
-
};
|
|
27380
|
-
};
|
|
27381
|
-
|
|
27382
|
-
var createMethod = function (is224) {
|
|
27383
|
-
var method = createOutputMethod('hex', is224);
|
|
27384
|
-
if (NODE_JS) {
|
|
27385
|
-
method = nodeWrap(method, is224);
|
|
27386
|
-
}
|
|
27387
|
-
method.create = function () {
|
|
27388
|
-
return new Sha256(is224);
|
|
27389
|
-
};
|
|
27390
|
-
method.update = function (message) {
|
|
27391
|
-
return method.create().update(message);
|
|
27392
|
-
};
|
|
27393
|
-
for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
|
|
27394
|
-
var type = OUTPUT_TYPES[i];
|
|
27395
|
-
method[type] = createOutputMethod(type, is224);
|
|
27396
|
-
}
|
|
27397
|
-
return method;
|
|
27398
|
-
};
|
|
27399
|
-
|
|
27400
|
-
var nodeWrap = function (method, is224) {
|
|
27401
|
-
var crypto = eval("require('crypto')");
|
|
27402
|
-
var Buffer = eval("require('buffer').Buffer");
|
|
27403
|
-
var algorithm = is224 ? 'sha224' : 'sha256';
|
|
27404
|
-
var nodeMethod = function (message) {
|
|
27405
|
-
if (typeof message === 'string') {
|
|
27406
|
-
return crypto.createHash(algorithm).update(message, 'utf8').digest('hex');
|
|
27407
|
-
} else {
|
|
27408
|
-
if (message === null || message === undefined) {
|
|
27409
|
-
throw new Error(ERROR);
|
|
27410
|
-
} else if (message.constructor === ArrayBuffer) {
|
|
27411
|
-
message = new Uint8Array(message);
|
|
27412
|
-
}
|
|
27413
|
-
}
|
|
27414
|
-
if (Array.isArray(message) || ArrayBuffer.isView(message) ||
|
|
27415
|
-
message.constructor === Buffer) {
|
|
27416
|
-
return crypto.createHash(algorithm).update(new Buffer(message)).digest('hex');
|
|
27417
|
-
} else {
|
|
27418
|
-
return method(message);
|
|
27419
|
-
}
|
|
27420
|
-
};
|
|
27421
|
-
return nodeMethod;
|
|
27422
|
-
};
|
|
27423
|
-
|
|
27424
|
-
var createHmacOutputMethod = function (outputType, is224) {
|
|
27425
|
-
return function (key, message) {
|
|
27426
|
-
return new HmacSha256(key, is224, true).update(message)[outputType]();
|
|
27427
|
-
};
|
|
27428
|
-
};
|
|
27429
|
-
|
|
27430
|
-
var createHmacMethod = function (is224) {
|
|
27431
|
-
var method = createHmacOutputMethod('hex', is224);
|
|
27432
|
-
method.create = function (key) {
|
|
27433
|
-
return new HmacSha256(key, is224);
|
|
27434
|
-
};
|
|
27435
|
-
method.update = function (key, message) {
|
|
27436
|
-
return method.create(key).update(message);
|
|
27437
|
-
};
|
|
27438
|
-
for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
|
|
27439
|
-
var type = OUTPUT_TYPES[i];
|
|
27440
|
-
method[type] = createHmacOutputMethod(type, is224);
|
|
27441
|
-
}
|
|
27442
|
-
return method;
|
|
27443
|
-
};
|
|
27444
|
-
|
|
27445
|
-
function Sha256(is224, sharedMemory) {
|
|
27446
|
-
if (sharedMemory) {
|
|
27447
|
-
blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =
|
|
27448
|
-
blocks[4] = blocks[5] = blocks[6] = blocks[7] =
|
|
27449
|
-
blocks[8] = blocks[9] = blocks[10] = blocks[11] =
|
|
27450
|
-
blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
|
|
27451
|
-
this.blocks = blocks;
|
|
27452
|
-
} else {
|
|
27453
|
-
this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
27454
|
-
}
|
|
27455
|
-
|
|
27456
|
-
if (is224) {
|
|
27457
|
-
this.h0 = 0xc1059ed8;
|
|
27458
|
-
this.h1 = 0x367cd507;
|
|
27459
|
-
this.h2 = 0x3070dd17;
|
|
27460
|
-
this.h3 = 0xf70e5939;
|
|
27461
|
-
this.h4 = 0xffc00b31;
|
|
27462
|
-
this.h5 = 0x68581511;
|
|
27463
|
-
this.h6 = 0x64f98fa7;
|
|
27464
|
-
this.h7 = 0xbefa4fa4;
|
|
27465
|
-
} else { // 256
|
|
27466
|
-
this.h0 = 0x6a09e667;
|
|
27467
|
-
this.h1 = 0xbb67ae85;
|
|
27468
|
-
this.h2 = 0x3c6ef372;
|
|
27469
|
-
this.h3 = 0xa54ff53a;
|
|
27470
|
-
this.h4 = 0x510e527f;
|
|
27471
|
-
this.h5 = 0x9b05688c;
|
|
27472
|
-
this.h6 = 0x1f83d9ab;
|
|
27473
|
-
this.h7 = 0x5be0cd19;
|
|
27474
|
-
}
|
|
27475
|
-
|
|
27476
|
-
this.block = this.start = this.bytes = this.hBytes = 0;
|
|
27477
|
-
this.finalized = this.hashed = false;
|
|
27478
|
-
this.first = true;
|
|
27479
|
-
this.is224 = is224;
|
|
27480
|
-
}
|
|
27481
|
-
|
|
27482
|
-
Sha256.prototype.update = function (message) {
|
|
27483
|
-
if (this.finalized) {
|
|
27484
|
-
return;
|
|
27485
|
-
}
|
|
27486
|
-
var notString, type = typeof message;
|
|
27487
|
-
if (type !== 'string') {
|
|
27488
|
-
if (type === 'object') {
|
|
27489
|
-
if (message === null) {
|
|
27490
|
-
throw new Error(ERROR);
|
|
27491
|
-
} else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
|
|
27492
|
-
message = new Uint8Array(message);
|
|
27493
|
-
} else if (!Array.isArray(message)) {
|
|
27494
|
-
if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {
|
|
27495
|
-
throw new Error(ERROR);
|
|
27496
|
-
}
|
|
27497
|
-
}
|
|
27498
|
-
} else {
|
|
27499
|
-
throw new Error(ERROR);
|
|
27500
|
-
}
|
|
27501
|
-
notString = true;
|
|
27502
|
-
}
|
|
27503
|
-
var code, index = 0, i, length = message.length, blocks = this.blocks;
|
|
27504
|
-
|
|
27505
|
-
while (index < length) {
|
|
27506
|
-
if (this.hashed) {
|
|
27507
|
-
this.hashed = false;
|
|
27508
|
-
blocks[0] = this.block;
|
|
27509
|
-
blocks[16] = blocks[1] = blocks[2] = blocks[3] =
|
|
27510
|
-
blocks[4] = blocks[5] = blocks[6] = blocks[7] =
|
|
27511
|
-
blocks[8] = blocks[9] = blocks[10] = blocks[11] =
|
|
27512
|
-
blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
|
|
27513
|
-
}
|
|
27514
|
-
|
|
27515
|
-
if (notString) {
|
|
27516
|
-
for (i = this.start; index < length && i < 64; ++index) {
|
|
27517
|
-
blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
|
|
27518
|
-
}
|
|
27519
|
-
} else {
|
|
27520
|
-
for (i = this.start; index < length && i < 64; ++index) {
|
|
27521
|
-
code = message.charCodeAt(index);
|
|
27522
|
-
if (code < 0x80) {
|
|
27523
|
-
blocks[i >> 2] |= code << SHIFT[i++ & 3];
|
|
27524
|
-
} else if (code < 0x800) {
|
|
27525
|
-
blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
|
|
27526
|
-
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
27527
|
-
} else if (code < 0xd800 || code >= 0xe000) {
|
|
27528
|
-
blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
|
|
27529
|
-
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
|
|
27530
|
-
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
27531
|
-
} else {
|
|
27532
|
-
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
|
|
27533
|
-
blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
|
|
27534
|
-
blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
|
|
27535
|
-
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
|
|
27536
|
-
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
|
27537
|
-
}
|
|
27538
|
-
}
|
|
27539
|
-
}
|
|
27540
|
-
|
|
27541
|
-
this.lastByteIndex = i;
|
|
27542
|
-
this.bytes += i - this.start;
|
|
27543
|
-
if (i >= 64) {
|
|
27544
|
-
this.block = blocks[16];
|
|
27545
|
-
this.start = i - 64;
|
|
27546
|
-
this.hash();
|
|
27547
|
-
this.hashed = true;
|
|
27548
|
-
} else {
|
|
27549
|
-
this.start = i;
|
|
27550
|
-
}
|
|
27551
|
-
}
|
|
27552
|
-
if (this.bytes > 4294967295) {
|
|
27553
|
-
this.hBytes += this.bytes / 4294967296 << 0;
|
|
27554
|
-
this.bytes = this.bytes % 4294967296;
|
|
27555
|
-
}
|
|
27556
|
-
return this;
|
|
27557
|
-
};
|
|
27558
|
-
|
|
27559
|
-
Sha256.prototype.finalize = function () {
|
|
27560
|
-
if (this.finalized) {
|
|
27561
|
-
return;
|
|
27562
|
-
}
|
|
27563
|
-
this.finalized = true;
|
|
27564
|
-
var blocks = this.blocks, i = this.lastByteIndex;
|
|
27565
|
-
blocks[16] = this.block;
|
|
27566
|
-
blocks[i >> 2] |= EXTRA[i & 3];
|
|
27567
|
-
this.block = blocks[16];
|
|
27568
|
-
if (i >= 56) {
|
|
27569
|
-
if (!this.hashed) {
|
|
27570
|
-
this.hash();
|
|
27571
|
-
}
|
|
27572
|
-
blocks[0] = this.block;
|
|
27573
|
-
blocks[16] = blocks[1] = blocks[2] = blocks[3] =
|
|
27574
|
-
blocks[4] = blocks[5] = blocks[6] = blocks[7] =
|
|
27575
|
-
blocks[8] = blocks[9] = blocks[10] = blocks[11] =
|
|
27576
|
-
blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
|
|
27577
|
-
}
|
|
27578
|
-
blocks[14] = this.hBytes << 3 | this.bytes >>> 29;
|
|
27579
|
-
blocks[15] = this.bytes << 3;
|
|
27580
|
-
this.hash();
|
|
27581
|
-
};
|
|
27582
|
-
|
|
27583
|
-
Sha256.prototype.hash = function () {
|
|
27584
|
-
var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4, f = this.h5, g = this.h6,
|
|
27585
|
-
h = this.h7, blocks = this.blocks, j, s0, s1, maj, t1, t2, ch, ab, da, cd, bc;
|
|
27586
|
-
|
|
27587
|
-
for (j = 16; j < 64; ++j) {
|
|
27588
|
-
// rightrotate
|
|
27589
|
-
t1 = blocks[j - 15];
|
|
27590
|
-
s0 = ((t1 >>> 7) | (t1 << 25)) ^ ((t1 >>> 18) | (t1 << 14)) ^ (t1 >>> 3);
|
|
27591
|
-
t1 = blocks[j - 2];
|
|
27592
|
-
s1 = ((t1 >>> 17) | (t1 << 15)) ^ ((t1 >>> 19) | (t1 << 13)) ^ (t1 >>> 10);
|
|
27593
|
-
blocks[j] = blocks[j - 16] + s0 + blocks[j - 7] + s1 << 0;
|
|
27594
|
-
}
|
|
27595
|
-
|
|
27596
|
-
bc = b & c;
|
|
27597
|
-
for (j = 0; j < 64; j += 4) {
|
|
27598
|
-
if (this.first) {
|
|
27599
|
-
if (this.is224) {
|
|
27600
|
-
ab = 300032;
|
|
27601
|
-
t1 = blocks[0] - 1413257819;
|
|
27602
|
-
h = t1 - 150054599 << 0;
|
|
27603
|
-
d = t1 + 24177077 << 0;
|
|
27604
|
-
} else {
|
|
27605
|
-
ab = 704751109;
|
|
27606
|
-
t1 = blocks[0] - 210244248;
|
|
27607
|
-
h = t1 - 1521486534 << 0;
|
|
27608
|
-
d = t1 + 143694565 << 0;
|
|
27609
|
-
}
|
|
27610
|
-
this.first = false;
|
|
27611
|
-
} else {
|
|
27612
|
-
s0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10));
|
|
27613
|
-
s1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7));
|
|
27614
|
-
ab = a & b;
|
|
27615
|
-
maj = ab ^ (a & c) ^ bc;
|
|
27616
|
-
ch = (e & f) ^ (~e & g);
|
|
27617
|
-
t1 = h + s1 + ch + K[j] + blocks[j];
|
|
27618
|
-
t2 = s0 + maj;
|
|
27619
|
-
h = d + t1 << 0;
|
|
27620
|
-
d = t1 + t2 << 0;
|
|
27621
|
-
}
|
|
27622
|
-
s0 = ((d >>> 2) | (d << 30)) ^ ((d >>> 13) | (d << 19)) ^ ((d >>> 22) | (d << 10));
|
|
27623
|
-
s1 = ((h >>> 6) | (h << 26)) ^ ((h >>> 11) | (h << 21)) ^ ((h >>> 25) | (h << 7));
|
|
27624
|
-
da = d & a;
|
|
27625
|
-
maj = da ^ (d & b) ^ ab;
|
|
27626
|
-
ch = (h & e) ^ (~h & f);
|
|
27627
|
-
t1 = g + s1 + ch + K[j + 1] + blocks[j + 1];
|
|
27628
|
-
t2 = s0 + maj;
|
|
27629
|
-
g = c + t1 << 0;
|
|
27630
|
-
c = t1 + t2 << 0;
|
|
27631
|
-
s0 = ((c >>> 2) | (c << 30)) ^ ((c >>> 13) | (c << 19)) ^ ((c >>> 22) | (c << 10));
|
|
27632
|
-
s1 = ((g >>> 6) | (g << 26)) ^ ((g >>> 11) | (g << 21)) ^ ((g >>> 25) | (g << 7));
|
|
27633
|
-
cd = c & d;
|
|
27634
|
-
maj = cd ^ (c & a) ^ da;
|
|
27635
|
-
ch = (g & h) ^ (~g & e);
|
|
27636
|
-
t1 = f + s1 + ch + K[j + 2] + blocks[j + 2];
|
|
27637
|
-
t2 = s0 + maj;
|
|
27638
|
-
f = b + t1 << 0;
|
|
27639
|
-
b = t1 + t2 << 0;
|
|
27640
|
-
s0 = ((b >>> 2) | (b << 30)) ^ ((b >>> 13) | (b << 19)) ^ ((b >>> 22) | (b << 10));
|
|
27641
|
-
s1 = ((f >>> 6) | (f << 26)) ^ ((f >>> 11) | (f << 21)) ^ ((f >>> 25) | (f << 7));
|
|
27642
|
-
bc = b & c;
|
|
27643
|
-
maj = bc ^ (b & d) ^ cd;
|
|
27644
|
-
ch = (f & g) ^ (~f & h);
|
|
27645
|
-
t1 = e + s1 + ch + K[j + 3] + blocks[j + 3];
|
|
27646
|
-
t2 = s0 + maj;
|
|
27647
|
-
e = a + t1 << 0;
|
|
27648
|
-
a = t1 + t2 << 0;
|
|
27649
|
-
}
|
|
27650
|
-
|
|
27651
|
-
this.h0 = this.h0 + a << 0;
|
|
27652
|
-
this.h1 = this.h1 + b << 0;
|
|
27653
|
-
this.h2 = this.h2 + c << 0;
|
|
27654
|
-
this.h3 = this.h3 + d << 0;
|
|
27655
|
-
this.h4 = this.h4 + e << 0;
|
|
27656
|
-
this.h5 = this.h5 + f << 0;
|
|
27657
|
-
this.h6 = this.h6 + g << 0;
|
|
27658
|
-
this.h7 = this.h7 + h << 0;
|
|
27659
|
-
};
|
|
27660
|
-
|
|
27661
|
-
Sha256.prototype.hex = function () {
|
|
27662
|
-
this.finalize();
|
|
27663
|
-
|
|
27664
|
-
var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5,
|
|
27665
|
-
h6 = this.h6, h7 = this.h7;
|
|
27666
|
-
|
|
27667
|
-
var hex = HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +
|
|
27668
|
-
HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +
|
|
27669
|
-
HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +
|
|
27670
|
-
HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +
|
|
27671
|
-
HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +
|
|
27672
|
-
HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +
|
|
27673
|
-
HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +
|
|
27674
|
-
HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +
|
|
27675
|
-
HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +
|
|
27676
|
-
HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +
|
|
27677
|
-
HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +
|
|
27678
|
-
HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +
|
|
27679
|
-
HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F] +
|
|
27680
|
-
HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +
|
|
27681
|
-
HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +
|
|
27682
|
-
HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +
|
|
27683
|
-
HEX_CHARS[(h4 >> 28) & 0x0F] + HEX_CHARS[(h4 >> 24) & 0x0F] +
|
|
27684
|
-
HEX_CHARS[(h4 >> 20) & 0x0F] + HEX_CHARS[(h4 >> 16) & 0x0F] +
|
|
27685
|
-
HEX_CHARS[(h4 >> 12) & 0x0F] + HEX_CHARS[(h4 >> 8) & 0x0F] +
|
|
27686
|
-
HEX_CHARS[(h4 >> 4) & 0x0F] + HEX_CHARS[h4 & 0x0F] +
|
|
27687
|
-
HEX_CHARS[(h5 >> 28) & 0x0F] + HEX_CHARS[(h5 >> 24) & 0x0F] +
|
|
27688
|
-
HEX_CHARS[(h5 >> 20) & 0x0F] + HEX_CHARS[(h5 >> 16) & 0x0F] +
|
|
27689
|
-
HEX_CHARS[(h5 >> 12) & 0x0F] + HEX_CHARS[(h5 >> 8) & 0x0F] +
|
|
27690
|
-
HEX_CHARS[(h5 >> 4) & 0x0F] + HEX_CHARS[h5 & 0x0F] +
|
|
27691
|
-
HEX_CHARS[(h6 >> 28) & 0x0F] + HEX_CHARS[(h6 >> 24) & 0x0F] +
|
|
27692
|
-
HEX_CHARS[(h6 >> 20) & 0x0F] + HEX_CHARS[(h6 >> 16) & 0x0F] +
|
|
27693
|
-
HEX_CHARS[(h6 >> 12) & 0x0F] + HEX_CHARS[(h6 >> 8) & 0x0F] +
|
|
27694
|
-
HEX_CHARS[(h6 >> 4) & 0x0F] + HEX_CHARS[h6 & 0x0F];
|
|
27695
|
-
if (!this.is224) {
|
|
27696
|
-
hex += HEX_CHARS[(h7 >> 28) & 0x0F] + HEX_CHARS[(h7 >> 24) & 0x0F] +
|
|
27697
|
-
HEX_CHARS[(h7 >> 20) & 0x0F] + HEX_CHARS[(h7 >> 16) & 0x0F] +
|
|
27698
|
-
HEX_CHARS[(h7 >> 12) & 0x0F] + HEX_CHARS[(h7 >> 8) & 0x0F] +
|
|
27699
|
-
HEX_CHARS[(h7 >> 4) & 0x0F] + HEX_CHARS[h7 & 0x0F];
|
|
27700
|
-
}
|
|
27701
|
-
return hex;
|
|
27702
|
-
};
|
|
27703
|
-
|
|
27704
|
-
Sha256.prototype.toString = Sha256.prototype.hex;
|
|
27705
|
-
|
|
27706
|
-
Sha256.prototype.digest = function () {
|
|
27707
|
-
this.finalize();
|
|
27708
|
-
|
|
27709
|
-
var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5,
|
|
27710
|
-
h6 = this.h6, h7 = this.h7;
|
|
27711
|
-
|
|
27712
|
-
var arr = [
|
|
27713
|
-
(h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, h0 & 0xFF,
|
|
27714
|
-
(h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, h1 & 0xFF,
|
|
27715
|
-
(h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, h2 & 0xFF,
|
|
27716
|
-
(h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, h3 & 0xFF,
|
|
27717
|
-
(h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, h4 & 0xFF,
|
|
27718
|
-
(h5 >> 24) & 0xFF, (h5 >> 16) & 0xFF, (h5 >> 8) & 0xFF, h5 & 0xFF,
|
|
27719
|
-
(h6 >> 24) & 0xFF, (h6 >> 16) & 0xFF, (h6 >> 8) & 0xFF, h6 & 0xFF
|
|
27720
|
-
];
|
|
27721
|
-
if (!this.is224) {
|
|
27722
|
-
arr.push((h7 >> 24) & 0xFF, (h7 >> 16) & 0xFF, (h7 >> 8) & 0xFF, h7 & 0xFF);
|
|
27723
|
-
}
|
|
27724
|
-
return arr;
|
|
27725
|
-
};
|
|
27726
|
-
|
|
27727
|
-
Sha256.prototype.array = Sha256.prototype.digest;
|
|
27728
|
-
|
|
27729
|
-
Sha256.prototype.arrayBuffer = function () {
|
|
27730
|
-
this.finalize();
|
|
27731
|
-
|
|
27732
|
-
var buffer = new ArrayBuffer(this.is224 ? 28 : 32);
|
|
27733
|
-
var dataView = new DataView(buffer);
|
|
27734
|
-
dataView.setUint32(0, this.h0);
|
|
27735
|
-
dataView.setUint32(4, this.h1);
|
|
27736
|
-
dataView.setUint32(8, this.h2);
|
|
27737
|
-
dataView.setUint32(12, this.h3);
|
|
27738
|
-
dataView.setUint32(16, this.h4);
|
|
27739
|
-
dataView.setUint32(20, this.h5);
|
|
27740
|
-
dataView.setUint32(24, this.h6);
|
|
27741
|
-
if (!this.is224) {
|
|
27742
|
-
dataView.setUint32(28, this.h7);
|
|
27743
|
-
}
|
|
27744
|
-
return buffer;
|
|
27745
|
-
};
|
|
27746
|
-
|
|
27747
|
-
function HmacSha256(key, is224, sharedMemory) {
|
|
27748
|
-
var i, type = typeof key;
|
|
27749
|
-
if (type === 'string') {
|
|
27750
|
-
var bytes = [], length = key.length, index = 0, code;
|
|
27751
|
-
for (i = 0; i < length; ++i) {
|
|
27752
|
-
code = key.charCodeAt(i);
|
|
27753
|
-
if (code < 0x80) {
|
|
27754
|
-
bytes[index++] = code;
|
|
27755
|
-
} else if (code < 0x800) {
|
|
27756
|
-
bytes[index++] = (0xc0 | (code >> 6));
|
|
27757
|
-
bytes[index++] = (0x80 | (code & 0x3f));
|
|
27758
|
-
} else if (code < 0xd800 || code >= 0xe000) {
|
|
27759
|
-
bytes[index++] = (0xe0 | (code >> 12));
|
|
27760
|
-
bytes[index++] = (0x80 | ((code >> 6) & 0x3f));
|
|
27761
|
-
bytes[index++] = (0x80 | (code & 0x3f));
|
|
27762
|
-
} else {
|
|
27763
|
-
code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff));
|
|
27764
|
-
bytes[index++] = (0xf0 | (code >> 18));
|
|
27765
|
-
bytes[index++] = (0x80 | ((code >> 12) & 0x3f));
|
|
27766
|
-
bytes[index++] = (0x80 | ((code >> 6) & 0x3f));
|
|
27767
|
-
bytes[index++] = (0x80 | (code & 0x3f));
|
|
27768
|
-
}
|
|
27769
|
-
}
|
|
27770
|
-
key = bytes;
|
|
27771
|
-
} else {
|
|
27772
|
-
if (type === 'object') {
|
|
27773
|
-
if (key === null) {
|
|
27774
|
-
throw new Error(ERROR);
|
|
27775
|
-
} else if (ARRAY_BUFFER && key.constructor === ArrayBuffer) {
|
|
27776
|
-
key = new Uint8Array(key);
|
|
27777
|
-
} else if (!Array.isArray(key)) {
|
|
27778
|
-
if (!ARRAY_BUFFER || !ArrayBuffer.isView(key)) {
|
|
27779
|
-
throw new Error(ERROR);
|
|
27780
|
-
}
|
|
27781
|
-
}
|
|
27782
|
-
} else {
|
|
27783
|
-
throw new Error(ERROR);
|
|
27784
|
-
}
|
|
27785
|
-
}
|
|
27786
|
-
|
|
27787
|
-
if (key.length > 64) {
|
|
27788
|
-
key = (new Sha256(is224, true)).update(key).array();
|
|
27789
|
-
}
|
|
27790
|
-
|
|
27791
|
-
var oKeyPad = [], iKeyPad = [];
|
|
27792
|
-
for (i = 0; i < 64; ++i) {
|
|
27793
|
-
var b = key[i] || 0;
|
|
27794
|
-
oKeyPad[i] = 0x5c ^ b;
|
|
27795
|
-
iKeyPad[i] = 0x36 ^ b;
|
|
27796
|
-
}
|
|
27797
|
-
|
|
27798
|
-
Sha256.call(this, is224, sharedMemory);
|
|
27799
|
-
|
|
27800
|
-
this.update(iKeyPad);
|
|
27801
|
-
this.oKeyPad = oKeyPad;
|
|
27802
|
-
this.inner = true;
|
|
27803
|
-
this.sharedMemory = sharedMemory;
|
|
27804
|
-
}
|
|
27805
|
-
HmacSha256.prototype = new Sha256();
|
|
27806
|
-
|
|
27807
|
-
HmacSha256.prototype.finalize = function () {
|
|
27808
|
-
Sha256.prototype.finalize.call(this);
|
|
27809
|
-
if (this.inner) {
|
|
27810
|
-
this.inner = false;
|
|
27811
|
-
var innerHash = this.array();
|
|
27812
|
-
Sha256.call(this, this.is224, this.sharedMemory);
|
|
27813
|
-
this.update(this.oKeyPad);
|
|
27814
|
-
this.update(innerHash);
|
|
27815
|
-
Sha256.prototype.finalize.call(this);
|
|
27816
|
-
}
|
|
27817
|
-
};
|
|
27818
|
-
|
|
27819
|
-
var exports = createMethod();
|
|
27820
|
-
exports.sha256 = exports;
|
|
27821
|
-
exports.sha224 = createMethod(true);
|
|
27822
|
-
exports.sha256.hmac = createHmacMethod();
|
|
27823
|
-
exports.sha224.hmac = createHmacMethod(true);
|
|
27824
|
-
|
|
27825
|
-
if (COMMON_JS) {
|
|
27826
|
-
module.exports = exports;
|
|
27827
|
-
} else {
|
|
27828
|
-
root.sha256 = exports.sha256;
|
|
27829
|
-
root.sha224 = exports.sha224;
|
|
27830
|
-
if (AMD) {
|
|
27831
|
-
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
|
|
27832
|
-
return exports;
|
|
27833
|
-
}).call(exports, __webpack_require__, exports, module),
|
|
27834
|
-
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
27835
|
-
}
|
|
27836
|
-
}
|
|
27837
|
-
})();
|
|
27838
|
-
|
|
27839
|
-
|
|
27840
27751
|
/***/ }),
|
|
27841
27752
|
|
|
27842
27753
|
/***/ "../../node_modules/redux-saga/dist/redux-saga-core-npm-proxy.esm.js":
|
|
@@ -30118,11 +30029,6 @@ function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=a
|
|
|
30118
30029
|
/******/ }
|
|
30119
30030
|
/******/
|
|
30120
30031
|
/************************************************************************/
|
|
30121
|
-
/******/ /* webpack/runtime/amd options */
|
|
30122
|
-
/******/ (() => {
|
|
30123
|
-
/******/ __webpack_require__.amdO = {};
|
|
30124
|
-
/******/ })();
|
|
30125
|
-
/******/
|
|
30126
30032
|
/******/ /* webpack/runtime/compat get default export */
|
|
30127
30033
|
/******/ (() => {
|
|
30128
30034
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
@@ -30147,18 +30053,6 @@ function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=a
|
|
|
30147
30053
|
/******/ };
|
|
30148
30054
|
/******/ })();
|
|
30149
30055
|
/******/
|
|
30150
|
-
/******/ /* webpack/runtime/global */
|
|
30151
|
-
/******/ (() => {
|
|
30152
|
-
/******/ __webpack_require__.g = (function() {
|
|
30153
|
-
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
30154
|
-
/******/ try {
|
|
30155
|
-
/******/ return this || new Function('return this')();
|
|
30156
|
-
/******/ } catch (e) {
|
|
30157
|
-
/******/ if (typeof window === 'object') return window;
|
|
30158
|
-
/******/ }
|
|
30159
|
-
/******/ })();
|
|
30160
|
-
/******/ })();
|
|
30161
|
-
/******/
|
|
30162
30056
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
30163
30057
|
/******/ (() => {
|
|
30164
30058
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|