@waku/rln 0.1.6-006cd41.0 → 0.1.6-16328a3.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/bundle/_virtual/index2.js +1 -1
- package/bundle/_virtual/utils.js +2 -2
- package/bundle/_virtual/utils2.js +2 -2
- package/bundle/index.js +2 -1
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/checksum.js +3 -3
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/cipher.js +4 -4
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/class.js +7 -7
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/functional.js +7 -7
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/index.js +6 -6
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/kdf.js +5 -5
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/password.js +1 -1
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/schema-validation-generated.js +1 -1
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/schema-validation.js +2 -2
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/types.js +1 -1
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/_assert.js +1 -1
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/_sha2.js +3 -3
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/_u64.js +1 -1
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/cryptoBrowser.js +1 -1
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/hmac.js +3 -3
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/pbkdf2.js +4 -4
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/scrypt.js +5 -5
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/sha256.js +3 -3
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/sha512.js +4 -4
- package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/utils.js +2 -2
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/aes.js +3 -3
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/pbkdf2.js +7 -7
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +3 -3
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/scrypt.js +3 -3
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/sha256.js +3 -3
- package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +7 -7
- package/bundle/node_modules/@ethersproject/keccak256/lib.esm/index.js +1 -1
- package/bundle/node_modules/@noble/hashes/esm/_assert.js +6 -32
- package/bundle/node_modules/@noble/hashes/esm/_md.js +22 -11
- package/bundle/node_modules/@noble/hashes/esm/_u64.js +4 -3
- package/bundle/{packages/rln/node_modules → node_modules}/@noble/hashes/esm/hmac.js +19 -10
- package/bundle/{packages/rln/node_modules/@noble/hashes/esm/sha256.js → node_modules/@noble/hashes/esm/sha2.js} +36 -50
- package/bundle/node_modules/@noble/hashes/esm/sha256.js +5 -102
- package/bundle/node_modules/@noble/hashes/esm/sha3.js +30 -24
- package/bundle/node_modules/@noble/hashes/esm/utils.js +69 -18
- package/bundle/node_modules/bn.js/lib/bn.js +1 -0
- package/bundle/node_modules/ethereum-cryptography/esm/sha256.js +1 -1
- package/bundle/node_modules/{@ethersproject/keccak256/node_modules/js-sha3 → js-sha3}/src/sha3.js +2 -2
- package/bundle/packages/rln/dist/contract/constants.js +1 -0
- package/bundle/packages/rln/dist/contract/rln_base_contract.js +127 -71
- package/bundle/packages/rln/dist/credentials_manager.js +3 -3
- package/bundle/packages/rln/dist/keystore/cipher.js +3 -3
- package/bundle/packages/rln/dist/keystore/keystore.js +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/contract/index.d.ts +1 -0
- package/dist/contract/index.js +1 -0
- package/dist/contract/index.js.map +1 -1
- package/dist/contract/rln_base_contract.d.ts +32 -22
- package/dist/contract/rln_base_contract.js +127 -71
- package/dist/contract/rln_base_contract.js.map +1 -1
- package/dist/contract/types.d.ts +5 -0
- package/dist/contract/types.js.map +1 -1
- package/dist/credentials_manager.js +1 -1
- package/dist/credentials_manager.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/keystore/keystore.js.map +1 -1
- package/dist/keystore/types.d.ts +2 -2
- package/package.json +1 -1
- package/src/contract/index.ts +1 -0
- package/src/contract/rln_base_contract.ts +166 -102
- package/src/contract/types.ts +5 -0
- package/src/credentials_manager.ts +1 -1
- package/src/index.ts +3 -1
- package/src/keystore/keystore.ts +4 -2
- package/src/keystore/types.ts +2 -2
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/_assert.js +0 -43
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/_sha2.js +0 -116
- package/bundle/packages/rln/node_modules/@noble/hashes/esm/utils.js +0 -43
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/index.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/md5.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/nil.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/parse.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/regex.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/rng.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/sha1.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/stringify.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v1.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v3.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v35.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v4.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v5.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/validate.js +0 -0
- /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/version.js +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import { getAugmentedNamespace } from './_commonjsHelpers.js';
|
2
|
-
import * as index from '../
|
2
|
+
import * as index from '../node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/index.js';
|
3
3
|
|
4
4
|
var require$$0 = /*@__PURE__*/getAugmentedNamespace(index);
|
5
5
|
|
package/bundle/_virtual/utils.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
var utils = {};
|
1
|
+
var utils = {exports: {}};
|
2
2
|
|
3
|
-
export { utils as
|
3
|
+
export { utils as __module };
|
@@ -1,3 +1,3 @@
|
|
1
|
-
var utils = {
|
1
|
+
var utils = {};
|
2
2
|
|
3
|
-
export { utils as
|
3
|
+
export { utils as __exports };
|
package/bundle/index.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
export { RLNDecoder, RLNEncoder } from './packages/rln/dist/codec.js';
|
2
2
|
export { RLN_ABI } from './packages/rln/dist/contract/abi.js';
|
3
3
|
export { RLNContract } from './packages/rln/dist/contract/rln_contract.js';
|
4
|
-
export { LINEA_CONTRACT } from './packages/rln/dist/contract/constants.js';
|
4
|
+
export { DEFAULT_RATE_LIMIT, LINEA_CONTRACT, RATE_LIMIT_PARAMS, RATE_LIMIT_TIERS } from './packages/rln/dist/contract/constants.js';
|
5
|
+
export { MembershipState } from './packages/rln/dist/contract/types.js';
|
5
6
|
export { RLNBaseContract } from './packages/rln/dist/contract/rln_base_contract.js';
|
6
7
|
export { createRLN } from './packages/rln/dist/create.js';
|
7
8
|
export { RLNCredentialsManager } from './packages/rln/dist/credentials_manager.js';
|
package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/checksum.js
RENAMED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { __exports as checksum$1 } from '
|
1
|
+
import { commonjsGlobal } from '../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { __exports as checksum$1 } from '../../../../_virtual/checksum.js';
|
3
3
|
import '../node_modules/ethereum-cryptography/sha256.js';
|
4
4
|
import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
|
5
|
-
import { __exports as sha256 } from '
|
5
|
+
import { __exports as sha256 } from '../../../../_virtual/sha256.js';
|
6
6
|
|
7
7
|
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
8
8
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/cipher.js
RENAMED
@@ -1,10 +1,10 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { __exports as cipher } from '
|
1
|
+
import { commonjsGlobal } from '../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { __exports as cipher } from '../../../../_virtual/cipher.js';
|
3
3
|
import '../node_modules/ethereum-cryptography/random.js';
|
4
4
|
import '../node_modules/ethereum-cryptography/aes.js';
|
5
5
|
import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
|
6
|
-
import { __exports as random } from '
|
7
|
-
import { __exports as aes } from '
|
6
|
+
import { __exports as random } from '../../../../_virtual/random.js';
|
7
|
+
import { __exports as aes } from '../../../../_virtual/aes.js';
|
8
8
|
|
9
9
|
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
10
10
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/class.js
RENAMED
@@ -1,15 +1,15 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { __exports as _class } from '
|
1
|
+
import { commonjsGlobal } from '../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { __exports as _class } from '../../../../_virtual/class.js';
|
3
3
|
import './kdf.js';
|
4
4
|
import './checksum.js';
|
5
5
|
import './cipher.js';
|
6
6
|
import './functional.js';
|
7
7
|
import './schema-validation.js';
|
8
|
-
import { __exports as kdf } from '
|
9
|
-
import { __exports as checksum } from '
|
10
|
-
import { __exports as cipher } from '
|
11
|
-
import { __exports as functional } from '
|
12
|
-
import { __exports as schemaValidation } from '
|
8
|
+
import { __exports as kdf } from '../../../../_virtual/kdf.js';
|
9
|
+
import { __exports as checksum } from '../../../../_virtual/checksum.js';
|
10
|
+
import { __exports as cipher } from '../../../../_virtual/cipher.js';
|
11
|
+
import { __exports as functional } from '../../../../_virtual/functional.js';
|
12
|
+
import { __exports as schemaValidation } from '../../../../_virtual/schema-validation.js';
|
13
13
|
|
14
14
|
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
15
15
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/functional.js
RENAMED
@@ -1,15 +1,15 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { __exports as functional } from '
|
3
|
-
import require$$0 from '
|
1
|
+
import { commonjsGlobal } from '../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { __exports as functional } from '../../../../_virtual/functional.js';
|
3
|
+
import require$$0 from '../../../../_virtual/index2.js';
|
4
4
|
import './kdf.js';
|
5
5
|
import './checksum.js';
|
6
6
|
import './cipher.js';
|
7
7
|
import './password.js';
|
8
8
|
import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
|
9
|
-
import { __exports as kdf } from '
|
10
|
-
import { __exports as checksum } from '
|
11
|
-
import { __exports as cipher } from '
|
12
|
-
import { __exports as password } from '
|
9
|
+
import { __exports as kdf } from '../../../../_virtual/kdf.js';
|
10
|
+
import { __exports as checksum } from '../../../../_virtual/checksum.js';
|
11
|
+
import { __exports as cipher } from '../../../../_virtual/cipher.js';
|
12
|
+
import { __exports as password } from '../../../../_virtual/password.js';
|
13
13
|
|
14
14
|
(function (exports) {
|
15
15
|
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/index.js
RENAMED
@@ -1,13 +1,13 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { __exports as lib } from '
|
1
|
+
import { commonjsGlobal } from '../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { __exports as lib } from '../../../../_virtual/index.js';
|
3
3
|
import './types.js';
|
4
4
|
import './functional.js';
|
5
5
|
import './class.js';
|
6
6
|
import './schema-validation.js';
|
7
|
-
import { __exports as types } from '
|
8
|
-
import { __exports as functional } from '
|
9
|
-
import { __exports as _class } from '
|
10
|
-
import { __exports as schemaValidation } from '
|
7
|
+
import { __exports as types } from '../../../../_virtual/types.js';
|
8
|
+
import { __exports as functional } from '../../../../_virtual/functional.js';
|
9
|
+
import { __exports as _class } from '../../../../_virtual/class.js';
|
10
|
+
import { __exports as schemaValidation } from '../../../../_virtual/schema-validation.js';
|
11
11
|
|
12
12
|
(function (exports) {
|
13
13
|
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/kdf.js
RENAMED
@@ -1,12 +1,12 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { __exports as kdf$1 } from '
|
1
|
+
import { commonjsGlobal } from '../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { __exports as kdf$1 } from '../../../../_virtual/kdf.js';
|
3
3
|
import '../node_modules/ethereum-cryptography/random.js';
|
4
4
|
import '../node_modules/ethereum-cryptography/pbkdf2.js';
|
5
5
|
import '../node_modules/ethereum-cryptography/scrypt.js';
|
6
6
|
import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
|
7
|
-
import { __exports as random } from '
|
8
|
-
import { __exports as pbkdf2 } from '
|
9
|
-
import { __exports as scrypt } from '
|
7
|
+
import { __exports as random } from '../../../../_virtual/random.js';
|
8
|
+
import { __exports as pbkdf2 } from '../../../../_virtual/pbkdf2.js';
|
9
|
+
import { __exports as scrypt } from '../../../../_virtual/scrypt.js';
|
10
10
|
|
11
11
|
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/password.js
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { __exports as password } from '
|
1
|
+
import { __exports as password } from '../../../../_virtual/password.js';
|
2
2
|
import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
|
3
3
|
|
4
4
|
Object.defineProperty(password, "__esModule", { value: true });
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { __exports as schemaValidationGenerated } from '
|
1
|
+
import { __exports as schemaValidationGenerated } from '../../../../_virtual/schema-validation-generated.js';
|
2
2
|
|
3
3
|
Object.defineProperty(schemaValidationGenerated, "__esModule", { value: true });
|
4
4
|
schemaValidationGenerated.Keystore = void 0;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { __exports as schemaValidation } from '
|
1
|
+
import { __exports as schemaValidation } from '../../../../_virtual/schema-validation.js';
|
2
2
|
import './schema-validation-generated.js';
|
3
|
-
import { __exports as schemaValidationGenerated } from '
|
3
|
+
import { __exports as schemaValidationGenerated } from '../../../../_virtual/schema-validation-generated.js';
|
4
4
|
|
5
5
|
Object.defineProperty(schemaValidation, "__esModule", { value: true });
|
6
6
|
schemaValidation.isValidKeystore = schemaValidation.validateKeystore = schemaValidation.schemaValidationErrors = void 0;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { __exports as _assert } from '
|
1
|
+
import { __exports as _assert } from '../../../../../../_virtual/_assert.js';
|
2
2
|
|
3
3
|
Object.defineProperty(_assert, "__esModule", { value: true });
|
4
4
|
_assert.output = _assert.exists = _assert.hash = _assert.bytes = _assert.bool = _assert.number = void 0;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { __exports as _sha2 } from '
|
1
|
+
import { __exports as _sha2 } from '../../../../../../_virtual/_sha2.js';
|
2
2
|
import './_assert.js';
|
3
3
|
import './utils.js';
|
4
|
-
import { __exports as utils } from '
|
5
|
-
import { __exports as _assert } from '
|
4
|
+
import { __exports as utils } from '../../../../../../_virtual/utils2.js';
|
5
|
+
import { __exports as _assert } from '../../../../../../_virtual/_assert.js';
|
6
6
|
|
7
7
|
Object.defineProperty(_sha2, "__esModule", { value: true });
|
8
8
|
_sha2.SHA2 = void 0;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { __exports as cryptoBrowser } from '
|
1
|
+
import { __exports as cryptoBrowser } from '../../../../../../_virtual/cryptoBrowser.js';
|
2
2
|
|
3
3
|
Object.defineProperty(cryptoBrowser, "__esModule", { value: true });
|
4
4
|
cryptoBrowser.crypto = void 0;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { __exports as hmac } from '
|
1
|
+
import { __exports as hmac } from '../../../../../../_virtual/hmac.js';
|
2
2
|
import './_assert.js';
|
3
3
|
import './utils.js';
|
4
|
-
import { __exports as utils } from '
|
5
|
-
import { __exports as _assert } from '
|
4
|
+
import { __exports as utils } from '../../../../../../_virtual/utils2.js';
|
5
|
+
import { __exports as _assert } from '../../../../../../_virtual/_assert.js';
|
6
6
|
|
7
7
|
(function (exports) {
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { __exports as pbkdf2$1 } from '
|
1
|
+
import { __exports as pbkdf2$1 } from '../../../../../../_virtual/pbkdf22.js';
|
2
2
|
import './_assert.js';
|
3
3
|
import './hmac.js';
|
4
4
|
import './utils.js';
|
5
|
-
import { __exports as utils } from '
|
6
|
-
import { __exports as _assert } from '
|
7
|
-
import { __exports as hmac } from '
|
5
|
+
import { __exports as utils } from '../../../../../../_virtual/utils2.js';
|
6
|
+
import { __exports as _assert } from '../../../../../../_virtual/_assert.js';
|
7
|
+
import { __exports as hmac } from '../../../../../../_virtual/hmac.js';
|
8
8
|
|
9
9
|
Object.defineProperty(pbkdf2$1, "__esModule", { value: true });
|
10
10
|
pbkdf2$1.pbkdf2Async = pbkdf2$1.pbkdf2 = void 0;
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import { __exports as scrypt$1 } from '
|
1
|
+
import { __exports as scrypt$1 } from '../../../../../../_virtual/scrypt2.js';
|
2
2
|
import './_assert.js';
|
3
3
|
import './sha256.js';
|
4
4
|
import './pbkdf2.js';
|
5
5
|
import './utils.js';
|
6
|
-
import { __exports as utils } from '
|
7
|
-
import { __exports as _assert } from '
|
8
|
-
import { __exports as pbkdf2 } from '
|
9
|
-
import { __exports as sha256 } from '
|
6
|
+
import { __exports as utils } from '../../../../../../_virtual/utils2.js';
|
7
|
+
import { __exports as _assert } from '../../../../../../_virtual/_assert.js';
|
8
|
+
import { __exports as pbkdf2 } from '../../../../../../_virtual/pbkdf22.js';
|
9
|
+
import { __exports as sha256 } from '../../../../../../_virtual/sha2562.js';
|
10
10
|
|
11
11
|
Object.defineProperty(scrypt$1, "__esModule", { value: true });
|
12
12
|
scrypt$1.scryptAsync = scrypt$1.scrypt = void 0;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { __exports as sha256 } from '
|
1
|
+
import { __exports as sha256 } from '../../../../../../_virtual/sha2562.js';
|
2
2
|
import './_sha2.js';
|
3
3
|
import './utils.js';
|
4
|
-
import { __exports as _sha2 } from '
|
5
|
-
import { __exports as utils } from '
|
4
|
+
import { __exports as _sha2 } from '../../../../../../_virtual/_sha2.js';
|
5
|
+
import { __exports as utils } from '../../../../../../_virtual/utils2.js';
|
6
6
|
|
7
7
|
Object.defineProperty(sha256, "__esModule", { value: true });
|
8
8
|
sha256.sha224 = sha256.sha256 = void 0;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { __exports as sha512 } from '
|
1
|
+
import { __exports as sha512 } from '../../../../../../_virtual/sha512.js';
|
2
2
|
import './_sha2.js';
|
3
3
|
import './_u64.js';
|
4
4
|
import './utils.js';
|
5
|
-
import { __exports as _u64 } from '
|
6
|
-
import { __exports as _sha2 } from '
|
7
|
-
import { __exports as utils } from '
|
5
|
+
import { __exports as _u64 } from '../../../../../../_virtual/_u64.js';
|
6
|
+
import { __exports as _sha2 } from '../../../../../../_virtual/_sha2.js';
|
7
|
+
import { __exports as utils } from '../../../../../../_virtual/utils2.js';
|
8
8
|
|
9
9
|
Object.defineProperty(sha512, "__esModule", { value: true });
|
10
10
|
sha512.sha384 = sha512.sha512_256 = sha512.sha512_224 = sha512.sha512 = sha512.SHA512 = void 0;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { __exports as utils } from '
|
1
|
+
import { __exports as utils } from '../../../../../../_virtual/utils2.js';
|
2
2
|
import './cryptoBrowser.js';
|
3
|
-
import { __exports as cryptoBrowser } from '
|
3
|
+
import { __exports as cryptoBrowser } from '../../../../../../_virtual/cryptoBrowser.js';
|
4
4
|
|
5
5
|
(function (exports) {
|
6
6
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { __exports as aes } from '
|
2
|
-
import '
|
1
|
+
import { __exports as aes } from '../../../../../_virtual/aes.js';
|
2
|
+
import '../@noble/hashes/cryptoBrowser.js';
|
3
3
|
import { u as utilsExports } from './utils.js';
|
4
|
-
import { __exports as cryptoBrowser } from '
|
4
|
+
import { __exports as cryptoBrowser } from '../../../../../_virtual/cryptoBrowser.js';
|
5
5
|
|
6
6
|
Object.defineProperty(aes, "__esModule", { value: true });
|
7
7
|
aes.decrypt = aes.encrypt = void 0;
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { __exports as pbkdf2$1 } from '
|
2
|
-
import '
|
3
|
-
import '
|
4
|
-
import '
|
1
|
+
import { __exports as pbkdf2$1 } from '../../../../../_virtual/pbkdf2.js';
|
2
|
+
import '../@noble/hashes/pbkdf2.js';
|
3
|
+
import '../@noble/hashes/sha256.js';
|
4
|
+
import '../@noble/hashes/sha512.js';
|
5
5
|
import { u as utilsExports } from './utils.js';
|
6
|
-
import { __exports as pbkdf2$2 } from '
|
7
|
-
import { __exports as sha256 } from '
|
8
|
-
import { __exports as sha512 } from '
|
6
|
+
import { __exports as pbkdf2$2 } from '../../../../../_virtual/pbkdf22.js';
|
7
|
+
import { __exports as sha256 } from '../../../../../_virtual/sha2562.js';
|
8
|
+
import { __exports as sha512 } from '../../../../../_virtual/sha512.js';
|
9
9
|
|
10
10
|
Object.defineProperty(pbkdf2$1, "__esModule", { value: true });
|
11
11
|
pbkdf2$1.pbkdf2Sync = pbkdf2$1.pbkdf2 = void 0;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { __exports as random } from '
|
2
|
-
import '
|
3
|
-
import { __exports as utils } from '
|
1
|
+
import { __exports as random } from '../../../../../_virtual/random.js';
|
2
|
+
import '../@noble/hashes/utils.js';
|
3
|
+
import { __exports as utils } from '../../../../../_virtual/utils2.js';
|
4
4
|
|
5
5
|
Object.defineProperty(random, "__esModule", { value: true });
|
6
6
|
random.getRandomBytes = random.getRandomBytesSync = void 0;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { __exports as scrypt$1 } from '
|
2
|
-
import '
|
1
|
+
import { __exports as scrypt$1 } from '../../../../../_virtual/scrypt.js';
|
2
|
+
import '../@noble/hashes/scrypt.js';
|
3
3
|
import { u as utilsExports } from './utils.js';
|
4
|
-
import { __exports as scrypt$2 } from '
|
4
|
+
import { __exports as scrypt$2 } from '../../../../../_virtual/scrypt2.js';
|
5
5
|
|
6
6
|
Object.defineProperty(scrypt$1, "__esModule", { value: true });
|
7
7
|
scrypt$1.scryptSync = scrypt$1.scrypt = void 0;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { __exports as sha256 } from '
|
2
|
-
import '
|
1
|
+
import { __exports as sha256 } from '../../../../../_virtual/sha256.js';
|
2
|
+
import '../@noble/hashes/sha256.js';
|
3
3
|
import { u as utilsExports } from './utils.js';
|
4
|
-
import { __exports as sha256$1 } from '
|
4
|
+
import { __exports as sha256$1 } from '../../../../../_virtual/sha2562.js';
|
5
5
|
|
6
6
|
Object.defineProperty(sha256, "__esModule", { value: true });
|
7
7
|
sha256.sha256 = void 0;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { commonjsGlobal } from '
|
2
|
-
import { commonjsRequire } from '
|
3
|
-
import { __module as utils } from '
|
4
|
-
import '
|
5
|
-
import '
|
6
|
-
import { __exports as _assert } from '
|
7
|
-
import { __exports as utils$1 } from '
|
1
|
+
import { commonjsGlobal } from '../../../../../_virtual/_commonjsHelpers.js';
|
2
|
+
import { commonjsRequire } from '../../../../../_virtual/_commonjs-dynamic-modules.js';
|
3
|
+
import { __module as utils } from '../../../../../_virtual/utils.js';
|
4
|
+
import '../@noble/hashes/_assert.js';
|
5
|
+
import '../@noble/hashes/utils.js';
|
6
|
+
import { __exports as _assert } from '../../../../../_virtual/_assert.js';
|
7
|
+
import { __exports as utils$1 } from '../../../../../_virtual/utils2.js';
|
8
8
|
|
9
9
|
utils.exports;
|
10
10
|
|
@@ -1,37 +1,11 @@
|
|
1
|
+
import { abytes as abytes$1 } from './utils.js';
|
2
|
+
|
1
3
|
/**
|
2
4
|
* Internal assertion helpers.
|
3
5
|
* @module
|
6
|
+
* @deprecated
|
4
7
|
*/
|
5
|
-
/**
|
6
|
-
|
7
|
-
if (!Number.isSafeInteger(n) || n < 0)
|
8
|
-
throw new Error('positive integer expected, got ' + n);
|
9
|
-
}
|
10
|
-
/** Is number an Uint8Array? Copied from utils for perf. */
|
11
|
-
function isBytes(a) {
|
12
|
-
return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');
|
13
|
-
}
|
14
|
-
/** Asserts something is Uint8Array. */
|
15
|
-
function abytes(b, ...lengths) {
|
16
|
-
if (!isBytes(b))
|
17
|
-
throw new Error('Uint8Array expected');
|
18
|
-
if (lengths.length > 0 && !lengths.includes(b.length))
|
19
|
-
throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);
|
20
|
-
}
|
21
|
-
/** Asserts a hash instance has not been destroyed / finished */
|
22
|
-
function aexists(instance, checkFinished = true) {
|
23
|
-
if (instance.destroyed)
|
24
|
-
throw new Error('Hash instance has been destroyed');
|
25
|
-
if (checkFinished && instance.finished)
|
26
|
-
throw new Error('Hash#digest() has already been called');
|
27
|
-
}
|
28
|
-
/** Asserts output is properly-sized byte array */
|
29
|
-
function aoutput(out, instance) {
|
30
|
-
abytes(out);
|
31
|
-
const min = instance.outputLen;
|
32
|
-
if (out.length < min) {
|
33
|
-
throw new Error('digestInto() expects output buffer of length at least ' + min);
|
34
|
-
}
|
35
|
-
}
|
8
|
+
/** @deprecated Use import from `noble/hashes/utils` module */
|
9
|
+
const abytes = abytes$1;
|
36
10
|
|
37
|
-
export { abytes
|
11
|
+
export { abytes };
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { aexists, aoutput } from './
|
2
|
-
import { Hash, createView, toBytes } from './utils.js';
|
1
|
+
import { Hash, createView, aexists, toBytes, abytes, aoutput, clean } from './utils.js';
|
3
2
|
|
4
3
|
/**
|
5
4
|
* Internal Merkle-Damgard hash utils.
|
@@ -33,21 +32,22 @@ function Maj(a, b, c) {
|
|
33
32
|
class HashMD extends Hash {
|
34
33
|
constructor(blockLen, outputLen, padOffset, isLE) {
|
35
34
|
super();
|
36
|
-
this.blockLen = blockLen;
|
37
|
-
this.outputLen = outputLen;
|
38
|
-
this.padOffset = padOffset;
|
39
|
-
this.isLE = isLE;
|
40
35
|
this.finished = false;
|
41
36
|
this.length = 0;
|
42
37
|
this.pos = 0;
|
43
38
|
this.destroyed = false;
|
39
|
+
this.blockLen = blockLen;
|
40
|
+
this.outputLen = outputLen;
|
41
|
+
this.padOffset = padOffset;
|
42
|
+
this.isLE = isLE;
|
44
43
|
this.buffer = new Uint8Array(blockLen);
|
45
44
|
this.view = createView(this.buffer);
|
46
45
|
}
|
47
46
|
update(data) {
|
48
47
|
aexists(this);
|
49
|
-
const { view, buffer, blockLen } = this;
|
50
48
|
data = toBytes(data);
|
49
|
+
abytes(data);
|
50
|
+
const { view, buffer, blockLen } = this;
|
51
51
|
const len = data.length;
|
52
52
|
for (let pos = 0; pos < len;) {
|
53
53
|
const take = Math.min(blockLen - this.pos, len - pos);
|
@@ -81,7 +81,7 @@ class HashMD extends Hash {
|
|
81
81
|
let { pos } = this;
|
82
82
|
// append the bit '1' to the message
|
83
83
|
buffer[pos++] = 0b10000000;
|
84
|
-
this.buffer.subarray(pos)
|
84
|
+
clean(this.buffer.subarray(pos));
|
85
85
|
// we have less than padOffset left in buffer, so we cannot put length in
|
86
86
|
// current block, need process it and pad again
|
87
87
|
if (this.padOffset > blockLen - pos) {
|
@@ -119,14 +119,25 @@ class HashMD extends Hash {
|
|
119
119
|
to || (to = new this.constructor());
|
120
120
|
to.set(...this.get());
|
121
121
|
const { blockLen, buffer, length, finished, destroyed, pos } = this;
|
122
|
+
to.destroyed = destroyed;
|
123
|
+
to.finished = finished;
|
122
124
|
to.length = length;
|
123
125
|
to.pos = pos;
|
124
|
-
to.finished = finished;
|
125
|
-
to.destroyed = destroyed;
|
126
126
|
if (length % blockLen)
|
127
127
|
to.buffer.set(buffer);
|
128
128
|
return to;
|
129
129
|
}
|
130
|
+
clone() {
|
131
|
+
return this._cloneInto();
|
132
|
+
}
|
130
133
|
}
|
134
|
+
/**
|
135
|
+
* Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.
|
136
|
+
* Check out `test/misc/sha2-gen-iv.js` for recomputation guide.
|
137
|
+
*/
|
138
|
+
/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */
|
139
|
+
const SHA256_IV = /* @__PURE__ */ Uint32Array.from([
|
140
|
+
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,
|
141
|
+
]);
|
131
142
|
|
132
|
-
export { Chi, HashMD, Maj, setBigUint64 };
|
143
|
+
export { Chi, HashMD, Maj, SHA256_IV, setBigUint64 };
|
@@ -11,9 +11,10 @@ function fromBig(n, le = false) {
|
|
11
11
|
return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
12
12
|
}
|
13
13
|
function split(lst, le = false) {
|
14
|
-
|
15
|
-
let
|
16
|
-
|
14
|
+
const len = lst.length;
|
15
|
+
let Ah = new Uint32Array(len);
|
16
|
+
let Al = new Uint32Array(len);
|
17
|
+
for (let i = 0; i < len; i++) {
|
17
18
|
const { h, l } = fromBig(lst[i], le);
|
18
19
|
[Ah[i], Al[i]] = [h, l];
|
19
20
|
}
|
@@ -1,17 +1,19 @@
|
|
1
|
-
import
|
2
|
-
import { Hash, toBytes } from './utils.js';
|
1
|
+
import { Hash, ahash, toBytes, clean, aexists, abytes } from './utils.js';
|
3
2
|
|
4
|
-
|
3
|
+
/**
|
4
|
+
* HMAC: RFC2104 message authentication code.
|
5
|
+
* @module
|
6
|
+
*/
|
5
7
|
class HMAC extends Hash {
|
6
8
|
constructor(hash, _key) {
|
7
9
|
super();
|
8
10
|
this.finished = false;
|
9
11
|
this.destroyed = false;
|
10
|
-
|
12
|
+
ahash(hash);
|
11
13
|
const key = toBytes(_key);
|
12
14
|
this.iHash = hash.create();
|
13
15
|
if (typeof this.iHash.update !== 'function')
|
14
|
-
throw new
|
16
|
+
throw new Error('Expected instance of class which extends utils.Hash');
|
15
17
|
this.blockLen = this.iHash.blockLen;
|
16
18
|
this.outputLen = this.iHash.outputLen;
|
17
19
|
const blockLen = this.blockLen;
|
@@ -27,16 +29,16 @@ class HMAC extends Hash {
|
|
27
29
|
for (let i = 0; i < pad.length; i++)
|
28
30
|
pad[i] ^= 0x36 ^ 0x5c;
|
29
31
|
this.oHash.update(pad);
|
30
|
-
pad
|
32
|
+
clean(pad);
|
31
33
|
}
|
32
34
|
update(buf) {
|
33
|
-
|
35
|
+
aexists(this);
|
34
36
|
this.iHash.update(buf);
|
35
37
|
return this;
|
36
38
|
}
|
37
39
|
digestInto(out) {
|
38
|
-
|
39
|
-
|
40
|
+
aexists(this);
|
41
|
+
abytes(out, this.outputLen);
|
40
42
|
this.finished = true;
|
41
43
|
this.iHash.digestInto(out);
|
42
44
|
this.oHash.update(out);
|
@@ -61,6 +63,9 @@ class HMAC extends Hash {
|
|
61
63
|
to.iHash = iHash._cloneInto(to.iHash);
|
62
64
|
return to;
|
63
65
|
}
|
66
|
+
clone() {
|
67
|
+
return this._cloneInto();
|
68
|
+
}
|
64
69
|
destroy() {
|
65
70
|
this.destroyed = true;
|
66
71
|
this.oHash.destroy();
|
@@ -72,8 +77,12 @@ class HMAC extends Hash {
|
|
72
77
|
* @param hash - function that would be used e.g. sha256
|
73
78
|
* @param key - message key
|
74
79
|
* @param message - message data
|
80
|
+
* @example
|
81
|
+
* import { hmac } from '@noble/hashes/hmac';
|
82
|
+
* import { sha256 } from '@noble/hashes/sha2';
|
83
|
+
* const mac1 = hmac(sha256, 'key', 'message');
|
75
84
|
*/
|
76
85
|
const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();
|
77
86
|
hmac.create = (hash, key) => new HMAC(hash, key);
|
78
87
|
|
79
|
-
export { hmac };
|
88
|
+
export { HMAC, hmac };
|