@sebastienrousseau/crypto-lib 0.0.35 → 0.0.36
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/README.md +17 -2
- package/dist/accel/index.d.ts +5 -4
- package/dist/accel/index.d.ts.map +1 -1
- package/dist/accel/index.js +5 -5
- package/dist/accel/kdf-backend.d.ts +13 -0
- package/dist/accel/kdf-backend.d.ts.map +1 -0
- package/dist/accel/kdf-backend.js +81 -0
- package/dist/accel/native-pqc-bridge.d.ts.map +1 -1
- package/dist/accel/native-pqc-bridge.js +12 -52
- package/dist/accel/pq-backend.d.ts +3652 -0
- package/dist/accel/pq-backend.d.ts.map +1 -0
- package/dist/accel/pq-backend.js +215 -0
- package/dist/accel/runtime.d.ts +3 -0
- package/dist/accel/runtime.d.ts.map +1 -0
- package/dist/accel/runtime.js +9 -0
- package/dist/accel/wasm-bridge.d.ts.map +1 -1
- package/dist/accel/wasm-bridge.js +14 -13
- package/dist/accel/webcrypto-bridge.d.ts.map +1 -1
- package/dist/accel/webcrypto-bridge.js +14 -13
- package/dist/accel/webcrypto-modern.d.ts.map +1 -1
- package/dist/accel/webcrypto-modern.js +15 -14
- package/dist/accel/worker-pool.d.ts +18 -0
- package/dist/accel/worker-pool.d.ts.map +1 -1
- package/dist/accel/worker-pool.js +113 -37
- package/dist/bin/cryptolib.d.ts +7 -4
- package/dist/bin/cryptolib.d.ts.map +1 -1
- package/dist/bin/cryptolib.js +6 -6
- package/dist/crypto.d.ts.map +1 -1
- package/dist/crypto.js +2 -1
- package/dist/encoding.d.ts +10 -0
- package/dist/encoding.d.ts.map +1 -0
- package/dist/encoding.js +84 -0
- package/dist/errors.d.ts +11 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +20 -1
- package/dist/high-level/key-wrap.d.ts.map +1 -1
- package/dist/high-level/key-wrap.js +12 -17
- package/dist/high-level/multi-recipient.d.ts.map +1 -1
- package/dist/high-level/multi-recipient.js +15 -28
- package/dist/high-level/password-encrypt.d.ts.map +1 -1
- package/dist/high-level/password-encrypt.js +11 -11
- package/dist/high-level/sealedbox.d.ts.map +1 -1
- package/dist/high-level/sealedbox.js +16 -28
- package/dist/high-level/secretbox.d.ts.map +1 -1
- package/dist/high-level/secretbox.js +11 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/key/keystore.d.ts.map +1 -1
- package/dist/key/keystore.js +2 -1
- package/dist/keys/keygen.d.ts.map +1 -1
- package/dist/keys/keygen.js +13 -14
- package/dist/keys/keyring.d.ts.map +1 -1
- package/dist/keys/keyring.js +4 -2
- package/dist/keys/serialize.d.ts.map +1 -1
- package/dist/keys/serialize.js +18 -16
- package/dist/lib/decrypt.d.ts.map +1 -1
- package/dist/lib/decrypt.js +2 -1
- package/dist/lib/generate.d.ts +2 -1
- package/dist/lib/generate.d.ts.map +1 -1
- package/dist/lib/generate.js +7 -6
- package/dist/lib/key-output.d.ts +4 -1
- package/dist/lib/key-output.d.ts.map +1 -1
- package/dist/lib/key-output.js +2 -2
- package/dist/lib/reformat.d.ts +2 -1
- package/dist/lib/reformat.d.ts.map +1 -1
- package/dist/lib/reformat.js +2 -2
- package/dist/lib/revoke.d.ts +2 -1
- package/dist/lib/revoke.d.ts.map +1 -1
- package/dist/lib/revoke.js +2 -2
- package/dist/lib/verify.d.ts +6 -2
- package/dist/lib/verify.d.ts.map +1 -1
- package/dist/lib/verify.js +28 -9
- package/dist/modern/aead.d.ts.map +1 -1
- package/dist/modern/aead.js +11 -10
- package/dist/modern/aes.d.ts.map +1 -1
- package/dist/modern/aes.js +10 -9
- package/dist/modern/cost-limits.d.ts.map +1 -1
- package/dist/modern/cost-limits.js +3 -2
- package/dist/modern/curves.d.ts +10 -5
- package/dist/modern/curves.d.ts.map +1 -1
- package/dist/modern/curves.js +43 -36
- package/dist/modern/ecdh.d.ts +2 -1
- package/dist/modern/ecdh.d.ts.map +1 -1
- package/dist/modern/ecdh.js +10 -9
- package/dist/modern/fn-dsa.d.ts.map +1 -1
- package/dist/modern/fn-dsa.js +9 -8
- package/dist/modern/hash.d.ts.map +1 -1
- package/dist/modern/hash.js +5 -3
- package/dist/modern/hpke-xwing.d.ts +10 -0
- package/dist/modern/hpke-xwing.d.ts.map +1 -0
- package/dist/modern/hpke-xwing.js +26 -0
- package/dist/modern/hpke.d.ts +1 -1
- package/dist/modern/hpke.d.ts.map +1 -1
- package/dist/modern/hpke.js +60 -28
- package/dist/modern/hybrid-combiner.d.ts +20 -0
- package/dist/modern/hybrid-combiner.d.ts.map +1 -0
- package/dist/modern/hybrid-combiner.js +79 -0
- package/dist/modern/index.d.ts +10 -10
- package/dist/modern/index.d.ts.map +1 -1
- package/dist/modern/index.js +17 -7
- package/dist/modern/kdf.d.ts.map +1 -1
- package/dist/modern/kdf.js +12 -12
- package/dist/modern/mac.d.ts +1 -0
- package/dist/modern/mac.d.ts.map +1 -1
- package/dist/modern/mac.js +24 -15
- package/dist/modern/password.d.ts.map +1 -1
- package/dist/modern/password.js +19 -18
- package/dist/modern/pq-hash-sign.d.ts.map +1 -1
- package/dist/modern/pq-hash-sign.js +23 -22
- package/dist/modern/pq-kem.d.ts +8 -0
- package/dist/modern/pq-kem.d.ts.map +1 -1
- package/dist/modern/pq-kem.js +71 -79
- package/dist/modern/pq-sign.d.ts +9 -2
- package/dist/modern/pq-sign.d.ts.map +1 -1
- package/dist/modern/pq-sign.js +60 -23
- package/dist/modern/pq.d.ts +0 -17
- package/dist/modern/pq.d.ts.map +1 -1
- package/dist/modern/pq.js +15 -43
- package/dist/modern/signing.d.ts +2 -1
- package/dist/modern/signing.d.ts.map +1 -1
- package/dist/modern/signing.js +14 -13
- package/dist/protocols/iso20022.d.ts.map +1 -1
- package/dist/protocols/iso20022.js +12 -6
- package/dist/protocols/opaque/ksf.js +2 -2
- package/dist/protocols/opaque/suite.d.ts +1 -8
- package/dist/protocols/opaque/suite.d.ts.map +1 -1
- package/dist/protocols/opaque/suite.js +5 -10
- package/dist/protocols/pqxdh.d.ts +9 -2
- package/dist/protocols/pqxdh.d.ts.map +1 -1
- package/dist/protocols/pqxdh.js +99 -94
- package/dist/protocols/ratchet.d.ts.map +1 -1
- package/dist/protocols/ratchet.js +14 -15
- package/dist/protocols/threshold.d.ts.map +1 -1
- package/dist/protocols/threshold.js +16 -15
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +26 -0
- package/dist/streaming/chunks.d.ts +31 -0
- package/dist/streaming/chunks.d.ts.map +1 -1
- package/dist/streaming/chunks.js +149 -13
- package/dist/streaming/stream-aead.d.ts +9 -0
- package/dist/streaming/stream-aead.d.ts.map +1 -1
- package/dist/streaming/stream-aead.js +27 -53
- package/dist/streaming/stream-hash.d.ts.map +1 -1
- package/dist/streaming/stream-hash.js +6 -4
- package/dist/streaming/stream-multi-pq-aead.d.ts +12 -0
- package/dist/streaming/stream-multi-pq-aead.d.ts.map +1 -1
- package/dist/streaming/stream-multi-pq-aead.js +82 -106
- package/dist/streaming/stream-pq-aead.d.ts +7 -2
- package/dist/streaming/stream-pq-aead.d.ts.map +1 -1
- package/dist/streaming/stream-pq-aead.js +29 -79
- package/dist/streaming/web-streams.d.ts +5 -2
- package/dist/streaming/web-streams.d.ts.map +1 -1
- package/dist/streaming/web-streams.js +90 -151
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +13 -0
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/key-rotation.d.ts.map +1 -1
- package/dist/tokens/key-rotation.js +4 -2
- package/dist/tokens/paseto.d.ts +2 -0
- package/dist/tokens/paseto.d.ts.map +1 -1
- package/dist/tokens/paseto.js +56 -29
- package/dist/types/types.d.ts +1 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +3 -2
- package/package.json +12 -2
- package/dist/config/config.d.ts +0 -8
- package/dist/config/config.d.ts.map +0 -1
- package/dist/config/config.js +0 -13
- package/dist/key/key.d.ts +0 -10
- package/dist/key/key.d.ts.map +0 -1
- package/dist/key/key.js +0 -25
package/dist/modern/kdf.js
CHANGED
|
@@ -2,35 +2,35 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.KDF_ALGORITHMS = void 0;
|
|
4
4
|
exports.kdfDerive = kdfDerive;
|
|
5
|
-
const
|
|
5
|
+
const kdf_backend_1 = require("../accel/kdf-backend");
|
|
6
6
|
const hkdf_js_1 = require("@noble/hashes/hkdf.js");
|
|
7
|
-
const pbkdf2_js_1 = require("@noble/hashes/pbkdf2.js");
|
|
8
7
|
const sha2_js_1 = require("@noble/hashes/sha2.js");
|
|
9
8
|
const utils_js_1 = require("@noble/ciphers/utils.js");
|
|
10
9
|
const cost_limits_1 = require("./cost-limits");
|
|
10
|
+
const errors_1 = require("../errors");
|
|
11
|
+
const encoding_1 = require("../encoding");
|
|
11
12
|
exports.KDF_ALGORITHMS = [
|
|
12
13
|
"scrypt",
|
|
13
14
|
"hkdf-sha256",
|
|
14
15
|
"pbkdf2-sha256",
|
|
15
16
|
];
|
|
16
|
-
const HEX_RE = /^[0-9a-fA-F]*$/;
|
|
17
17
|
function toBytes(input, encoding = "utf8") {
|
|
18
18
|
if (input instanceof Uint8Array)
|
|
19
19
|
return input;
|
|
20
20
|
if (encoding === "hex") {
|
|
21
|
-
if (!
|
|
22
|
-
throw new
|
|
21
|
+
if (!(0, encoding_1.isHex)(input)) {
|
|
22
|
+
throw new errors_1.CryptoError("Invalid hex string", errors_1.CryptoErrorCode.INVALID_HEX);
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return (0, encoding_1.decodeHex)(input);
|
|
25
25
|
}
|
|
26
|
-
return
|
|
26
|
+
return (0, encoding_1.utf8)(input);
|
|
27
27
|
}
|
|
28
28
|
function deriveScrypt(password, salt, keyLength, params) {
|
|
29
29
|
const N = params.N ?? 131072;
|
|
30
30
|
const r = params.r ?? 8;
|
|
31
31
|
const p = params.p ?? 1;
|
|
32
32
|
(0, cost_limits_1.checkScryptCosts)(N, r, p);
|
|
33
|
-
return (0,
|
|
33
|
+
return (0, kdf_backend_1.scrypt)(password, salt, { N, r, p, dkLen: keyLength });
|
|
34
34
|
}
|
|
35
35
|
function deriveHkdf(password, salt, keyLength, params) {
|
|
36
36
|
const info = params.info ? toBytes(params.info, "utf8") : undefined;
|
|
@@ -39,7 +39,7 @@ function deriveHkdf(password, salt, keyLength, params) {
|
|
|
39
39
|
function derivePbkdf2(password, salt, keyLength, params) {
|
|
40
40
|
const iterations = params.iterations ?? 600000;
|
|
41
41
|
(0, cost_limits_1.checkPbkdf2Iterations)(iterations);
|
|
42
|
-
return (0,
|
|
42
|
+
return (0, kdf_backend_1.pbkdf2)(sha2_js_1.sha256, password, salt, {
|
|
43
43
|
c: iterations,
|
|
44
44
|
dkLen: keyLength,
|
|
45
45
|
});
|
|
@@ -61,11 +61,11 @@ function kdfDerive(options) {
|
|
|
61
61
|
derived = derivePbkdf2(password, salt, keyLength, params);
|
|
62
62
|
break;
|
|
63
63
|
default:
|
|
64
|
-
throw new
|
|
64
|
+
throw new errors_1.CryptoError(`Unsupported KDF algorithm: ${options.algorithm}`, errors_1.CryptoErrorCode.UNSUPPORTED_ALGORITHM);
|
|
65
65
|
}
|
|
66
66
|
return {
|
|
67
|
-
derivedKey:
|
|
68
|
-
salt:
|
|
67
|
+
derivedKey: (0, encoding_1.toHex)(derived),
|
|
68
|
+
salt: (0, encoding_1.toHex)(salt),
|
|
69
69
|
algorithm: options.algorithm,
|
|
70
70
|
keyLength,
|
|
71
71
|
};
|
package/dist/modern/mac.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface HmacVerifyResult {
|
|
|
19
19
|
valid: boolean;
|
|
20
20
|
algorithm: HmacAlgorithm;
|
|
21
21
|
}
|
|
22
|
+
export declare const MIN_MAC_KEY_BYTES = 16;
|
|
22
23
|
export declare function computeHmac(options: HmacComputeOptions): HmacComputeResult;
|
|
23
24
|
export declare function verifyHmac(options: HmacVerifyOptions): HmacVerifyResult;
|
|
24
25
|
export declare const KMAC_ALGORITHMS: readonly ["kmac-128", "kmac-256"];
|
package/dist/modern/mac.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mac.d.ts","sourceRoot":"","sources":["../../src/modern/mac.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mac.d.ts","sourceRoot":"","sources":["../../src/modern/mac.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,eAAe,iEAMlB,CAAC;AAGX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAG7D,MAAM,WAAW,kBAAkB;IAEjC,SAAS,EAAE,aAAa,CAAC;IAEzB,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;IAEzB,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;CAC3B;AAGD,MAAM,WAAW,iBAAiB;IAEhC,GAAG,EAAE,MAAM,CAAC;IAEZ,SAAS,EAAE,aAAa,CAAC;CAC1B;AAGD,MAAM,WAAW,iBAAiB;IAEhC,SAAS,EAAE,aAAa,CAAC;IAEzB,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;IAEzB,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAE1B,GAAG,EAAE,MAAM,CAAC;CACb;AAGD,MAAM,WAAW,gBAAgB;IAE/B,KAAK,EAAE,OAAO,CAAC;IAEf,SAAS,EAAE,aAAa,CAAC;CAC1B;AA6CD,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAmBpC,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,iBAAiB,CAW1E;AAKD,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAavE;AAKD,eAAO,MAAM,eAAe,mCAAoC,CAAC;AAGjE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAG7D,MAAM,WAAW,kBAAkB;IAEjC,SAAS,EAAE,aAAa,CAAC;IAEzB,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;IAEzB,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAE1B,aAAa,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAEpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,MAAM,WAAW,iBAAiB;IAEhC,GAAG,EAAE,MAAM,CAAC;IAEZ,SAAS,EAAE,aAAa,CAAC;CAC1B;AAGD,MAAM,WAAW,iBAAiB;IAEhC,SAAS,EAAE,aAAa,CAAC;IAEzB,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;IAEzB,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAE1B,GAAG,EAAE,MAAM,CAAC;IAEZ,aAAa,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAEpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,MAAM,WAAW,gBAAgB;IAE/B,KAAK,EAAE,OAAO,CAAC;IAEf,SAAS,EAAE,aAAa,CAAC;CAC1B;AAoBD,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,iBAAiB,CA2B1E;AAKD,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CA6BvE"}
|
package/dist/modern/mac.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KMAC_ALGORITHMS = exports.HMAC_ALGORITHMS = void 0;
|
|
3
|
+
exports.KMAC_ALGORITHMS = exports.MIN_MAC_KEY_BYTES = exports.HMAC_ALGORITHMS = void 0;
|
|
4
4
|
exports.computeHmac = computeHmac;
|
|
5
5
|
exports.verifyHmac = verifyHmac;
|
|
6
6
|
exports.computeKmac = computeKmac;
|
|
@@ -10,6 +10,8 @@ const sha2_js_1 = require("@noble/hashes/sha2.js");
|
|
|
10
10
|
const sha3_js_1 = require("@noble/hashes/sha3.js");
|
|
11
11
|
const sha3_addons_js_1 = require("@noble/hashes/sha3-addons.js");
|
|
12
12
|
const utils_1 = require("../utils");
|
|
13
|
+
const errors_1 = require("../errors");
|
|
14
|
+
const encoding_1 = require("../encoding");
|
|
13
15
|
exports.HMAC_ALGORITHMS = [
|
|
14
16
|
"sha256",
|
|
15
17
|
"sha384",
|
|
@@ -17,17 +19,16 @@ exports.HMAC_ALGORITHMS = [
|
|
|
17
19
|
"sha3-256",
|
|
18
20
|
"sha3-512",
|
|
19
21
|
];
|
|
20
|
-
const HEX_RE = /^[0-9a-fA-F]*$/;
|
|
21
22
|
function toBytes(input, encoding = "utf8") {
|
|
22
23
|
if (input instanceof Uint8Array)
|
|
23
24
|
return input;
|
|
24
25
|
if (encoding === "hex") {
|
|
25
|
-
if (!
|
|
26
|
-
throw new
|
|
26
|
+
if (!(0, encoding_1.isHex)(input)) {
|
|
27
|
+
throw new errors_1.CryptoError("Invalid hex string", errors_1.CryptoErrorCode.INVALID_HEX);
|
|
27
28
|
}
|
|
28
|
-
return
|
|
29
|
+
return (0, encoding_1.decodeHex)(input);
|
|
29
30
|
}
|
|
30
|
-
return
|
|
31
|
+
return (0, encoding_1.utf8)(input);
|
|
31
32
|
}
|
|
32
33
|
const hashFunctions = {
|
|
33
34
|
sha256: sha2_js_1.sha256,
|
|
@@ -39,23 +40,31 @@ const hashFunctions = {
|
|
|
39
40
|
function getHashFn(algorithm) {
|
|
40
41
|
const fn = hashFunctions[algorithm];
|
|
41
42
|
if (!fn) {
|
|
42
|
-
throw new
|
|
43
|
+
throw new errors_1.CryptoError(`Unsupported HMAC algorithm: ${algorithm}. Supported: ${exports.HMAC_ALGORITHMS.join(", ")}`, errors_1.CryptoErrorCode.UNSUPPORTED_ALGORITHM);
|
|
43
44
|
}
|
|
44
45
|
return fn;
|
|
45
46
|
}
|
|
47
|
+
exports.MIN_MAC_KEY_BYTES = 16;
|
|
48
|
+
function macKey(hex) {
|
|
49
|
+
const key = toBytes(hex, "hex");
|
|
50
|
+
if (key.length < exports.MIN_MAC_KEY_BYTES) {
|
|
51
|
+
throw new errors_1.CryptoError(`MAC key must be at least ${exports.MIN_MAC_KEY_BYTES} bytes, got ${key.length}`, "INVALID_KEY");
|
|
52
|
+
}
|
|
53
|
+
return key;
|
|
54
|
+
}
|
|
46
55
|
function computeHmac(options) {
|
|
47
56
|
const hashFn = getHashFn(options.algorithm);
|
|
48
|
-
const key =
|
|
57
|
+
const key = macKey(options.key);
|
|
49
58
|
const data = toBytes(options.data, "utf8");
|
|
50
59
|
const mac = (0, hmac_js_1.hmac)(hashFn, key, data);
|
|
51
60
|
return {
|
|
52
|
-
mac:
|
|
61
|
+
mac: (0, encoding_1.toHex)(mac),
|
|
53
62
|
algorithm: options.algorithm,
|
|
54
63
|
};
|
|
55
64
|
}
|
|
56
65
|
function verifyHmac(options) {
|
|
57
66
|
const hashFn = getHashFn(options.algorithm);
|
|
58
|
-
const key =
|
|
67
|
+
const key = macKey(options.key);
|
|
59
68
|
const data = toBytes(options.data, "utf8");
|
|
60
69
|
const expectedMac = toBytes(options.mac, "hex");
|
|
61
70
|
const computedMac = (0, hmac_js_1.hmac)(hashFn, key, data);
|
|
@@ -77,9 +86,9 @@ const kmacDefaultLength = {
|
|
|
77
86
|
function computeKmac(options) {
|
|
78
87
|
const fn = kmacFunctions[options.algorithm];
|
|
79
88
|
if (!fn) {
|
|
80
|
-
throw new
|
|
89
|
+
throw new errors_1.CryptoError(`Unsupported KMAC algorithm: ${options.algorithm}. Supported: ${exports.KMAC_ALGORITHMS.join(", ")}`, errors_1.CryptoErrorCode.UNSUPPORTED_ALGORITHM);
|
|
81
90
|
}
|
|
82
|
-
const key =
|
|
91
|
+
const key = macKey(options.key);
|
|
83
92
|
const data = toBytes(options.data, "utf8");
|
|
84
93
|
const outputLength = options.outputLength ?? kmacDefaultLength[options.algorithm];
|
|
85
94
|
const opts = {
|
|
@@ -90,16 +99,16 @@ function computeKmac(options) {
|
|
|
90
99
|
}
|
|
91
100
|
const mac = fn(key, data, opts);
|
|
92
101
|
return {
|
|
93
|
-
mac:
|
|
102
|
+
mac: (0, encoding_1.toHex)(mac),
|
|
94
103
|
algorithm: options.algorithm,
|
|
95
104
|
};
|
|
96
105
|
}
|
|
97
106
|
function verifyKmac(options) {
|
|
98
107
|
const fn = kmacFunctions[options.algorithm];
|
|
99
108
|
if (!fn) {
|
|
100
|
-
throw new
|
|
109
|
+
throw new errors_1.CryptoError(`Unsupported KMAC algorithm: ${options.algorithm}. Supported: ${exports.KMAC_ALGORITHMS.join(", ")}`, errors_1.CryptoErrorCode.UNSUPPORTED_ALGORITHM);
|
|
101
110
|
}
|
|
102
|
-
const key =
|
|
111
|
+
const key = macKey(options.key);
|
|
103
112
|
const data = toBytes(options.data, "utf8");
|
|
104
113
|
const expectedMac = toBytes(options.mac, "hex");
|
|
105
114
|
const outputLength = options.outputLength ?? kmacDefaultLength[options.algorithm];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../src/modern/password.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../src/modern/password.ts"],"names":[],"mappings":"AAoCA,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAG/D,MAAM,WAAW,YAAY;IAE3B,CAAC,EAAE,MAAM,CAAC;IAEV,CAAC,EAAE,MAAM,CAAC;IAEV,CAAC,EAAE,MAAM,CAAC;CACX;AAGD,MAAM,WAAW,mBAAmB;IAElC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC;IAE9B,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAE3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAGD,MAAM,WAAW,kBAAkB;IAEjC,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE,YAAY,CAAC;IAErB,SAAS,EAAE,aAAa,CAAC;IAEzB,GAAG,EAAE,MAAM,CAAC;CACb;AAGD,MAAM,WAAW,qBAAqB;IAEpC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC;IAE9B,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE,YAAY,CAAC;IAErB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAGD,MAAM,WAAW,oBAAoB;IAEnC,KAAK,EAAE,OAAO,CAAC;CAChB;AAGD,MAAM,WAAW,gBAAgB;IAE/B,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC;IAE9B,GAAG,EAAE,MAAM,CAAC;CACb;AA2GD,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,kBAAkB,CAuB7E;AAKD,wBAAgB,cAAc,CAC5B,OAAO,EAAE,qBAAqB,GAC7B,oBAAoB,CActB;AAWD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,gBAAgB,GACxB,oBAAoB,CAgBtB"}
|
package/dist/modern/password.js
CHANGED
|
@@ -3,39 +3,40 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.hashPassword = hashPassword;
|
|
4
4
|
exports.verifyPassword = verifyPassword;
|
|
5
5
|
exports.verifyPasswordPhc = verifyPasswordPhc;
|
|
6
|
-
const
|
|
6
|
+
const kdf_backend_1 = require("../accel/kdf-backend");
|
|
7
7
|
const utils_js_1 = require("@noble/ciphers/utils.js");
|
|
8
8
|
const utils_1 = require("../utils");
|
|
9
9
|
const cost_limits_1 = require("./cost-limits");
|
|
10
|
-
const
|
|
10
|
+
const errors_1 = require("../errors");
|
|
11
|
+
const encoding_1 = require("../encoding");
|
|
11
12
|
function toBytes(input, encoding = "utf8") {
|
|
12
13
|
if (input instanceof Uint8Array)
|
|
13
14
|
return input;
|
|
14
15
|
if (encoding === "hex") {
|
|
15
|
-
if (!
|
|
16
|
-
throw new
|
|
16
|
+
if (!(0, encoding_1.isHex)(input)) {
|
|
17
|
+
throw new errors_1.CryptoError("Invalid hex string", errors_1.CryptoErrorCode.INVALID_HEX);
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
+
return (0, encoding_1.decodeHex)(input);
|
|
19
20
|
}
|
|
20
|
-
return
|
|
21
|
+
return (0, encoding_1.utf8)(input);
|
|
21
22
|
}
|
|
22
23
|
function getArgon2Fn(variant) {
|
|
23
24
|
switch (variant) {
|
|
24
25
|
case "argon2id":
|
|
25
|
-
return
|
|
26
|
+
return kdf_backend_1.argon2id;
|
|
26
27
|
case "argon2i":
|
|
27
|
-
return
|
|
28
|
+
return kdf_backend_1.argon2i;
|
|
28
29
|
case "argon2d":
|
|
29
|
-
return
|
|
30
|
+
return kdf_backend_1.argon2d;
|
|
30
31
|
default:
|
|
31
|
-
throw new
|
|
32
|
+
throw new errors_1.CryptoError(`Unsupported Argon2 variant: ${variant}. Supported: argon2id, argon2i, argon2d`, errors_1.CryptoErrorCode.UNSUPPORTED_ALGORITHM);
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
function toPhcString(variant, params, salt, hash) {
|
|
35
|
-
let saltB64 =
|
|
36
|
+
let saltB64 = (0, encoding_1.toBase64)(salt);
|
|
36
37
|
while (saltB64.endsWith("="))
|
|
37
38
|
saltB64 = saltB64.slice(0, -1);
|
|
38
|
-
let hashB64 =
|
|
39
|
+
let hashB64 = (0, encoding_1.toBase64)(hash);
|
|
39
40
|
while (hashB64.endsWith("="))
|
|
40
41
|
hashB64 = hashB64.slice(0, -1);
|
|
41
42
|
return `$${variant}$v=19$m=${params.m},t=${params.t},p=${params.p}$${saltB64}$${hashB64}`;
|
|
@@ -43,11 +44,11 @@ function toPhcString(variant, params, salt, hash) {
|
|
|
43
44
|
function parsePhcString(phc) {
|
|
44
45
|
const parts = phc.split("$").filter(Boolean);
|
|
45
46
|
if (parts.length < 5) {
|
|
46
|
-
throw new
|
|
47
|
+
throw new errors_1.CryptoError("Invalid PHC string format", errors_1.CryptoErrorCode.INVALID_INPUT);
|
|
47
48
|
}
|
|
48
49
|
const variant = parts[0];
|
|
49
50
|
if (!["argon2id", "argon2i", "argon2d"].includes(variant)) {
|
|
50
|
-
throw new
|
|
51
|
+
throw new errors_1.CryptoError(`Unsupported variant in PHC string: ${variant}`, errors_1.CryptoErrorCode.INVALID_INPUT);
|
|
51
52
|
}
|
|
52
53
|
const paramStr = parts[2];
|
|
53
54
|
const paramParts = paramStr.split(",");
|
|
@@ -61,8 +62,8 @@ function parsePhcString(phc) {
|
|
|
61
62
|
t: paramMap["t"],
|
|
62
63
|
p: paramMap["p"],
|
|
63
64
|
};
|
|
64
|
-
const salt =
|
|
65
|
-
const hash =
|
|
65
|
+
const salt = (0, encoding_1.fromBase64)(parts[3]);
|
|
66
|
+
const hash = (0, encoding_1.fromBase64)(parts[4]);
|
|
66
67
|
return { variant, params, salt, hash };
|
|
67
68
|
}
|
|
68
69
|
const DEFAULT_TIME_COST = 3;
|
|
@@ -85,8 +86,8 @@ function hashPassword(options) {
|
|
|
85
86
|
const hash = argon2Fn(password, salt, { t, m, p, dkLen });
|
|
86
87
|
const params = { t, m, p };
|
|
87
88
|
return {
|
|
88
|
-
hash:
|
|
89
|
-
salt:
|
|
89
|
+
hash: (0, encoding_1.toHex)(hash),
|
|
90
|
+
salt: (0, encoding_1.toHex)(salt),
|
|
90
91
|
params,
|
|
91
92
|
algorithm: variant,
|
|
92
93
|
phc: toPhcString(variant, params, salt, hash),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pq-hash-sign.d.ts","sourceRoot":"","sources":["../../src/modern/pq-hash-sign.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pq-hash-sign.d.ts","sourceRoot":"","sources":["../../src/modern/pq-hash-sign.ts"],"names":[],"mappings":"AAuCA,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,CAAC;AAGjB,MAAM,WAAW,mBAAmB;IAElC,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,gBAAgB;IAE/B,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,kBAAkB;IAEjC,KAAK,EAAE,OAAO,CAAC;IAEf,SAAS,EAAE,MAAM,CAAC;CACnB;AA2DD,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,mBAAmB,CAQxE;AAKD,wBAAgB,UAAU,CACxB,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GAAG,UAAU,GAC3B,gBAAgB,CASlB;AAKD,wBAAgB,YAAY,CAC1B,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GAAG,UAAU,EAC5B,YAAY,EAAE,MAAM,GACnB,kBAAkB,CAUpB"}
|
|
@@ -3,37 +3,38 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.slhDsaKeygen = slhDsaKeygen;
|
|
4
4
|
exports.slhDsaSign = slhDsaSign;
|
|
5
5
|
exports.slhDsaVerify = slhDsaVerify;
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const pq_backend_1 = require("../accel/pq-backend");
|
|
7
|
+
const errors_1 = require("../errors");
|
|
8
|
+
const encoding_1 = require("../encoding");
|
|
8
9
|
function assertHex(input, label) {
|
|
9
|
-
if (!
|
|
10
|
-
throw new
|
|
10
|
+
if (!(0, encoding_1.isHex)(input)) {
|
|
11
|
+
throw new errors_1.CryptoError(`Invalid hex string for ${label}`, errors_1.CryptoErrorCode.INVALID_HEX);
|
|
11
12
|
}
|
|
12
|
-
return
|
|
13
|
+
return (0, encoding_1.decodeHex)(input);
|
|
13
14
|
}
|
|
14
15
|
function toBytes(input) {
|
|
15
16
|
if (input instanceof Uint8Array)
|
|
16
17
|
return input;
|
|
17
|
-
return
|
|
18
|
+
return (0, encoding_1.utf8)(input);
|
|
18
19
|
}
|
|
19
20
|
const SLH_DSA_VARIANTS = {
|
|
20
|
-
"sha2-128f":
|
|
21
|
-
"sha2-128s":
|
|
22
|
-
"sha2-192f":
|
|
23
|
-
"sha2-192s":
|
|
24
|
-
"sha2-256f":
|
|
25
|
-
"sha2-256s":
|
|
26
|
-
"shake-128f":
|
|
27
|
-
"shake-128s":
|
|
28
|
-
"shake-192f":
|
|
29
|
-
"shake-192s":
|
|
30
|
-
"shake-256f":
|
|
31
|
-
"shake-256s":
|
|
21
|
+
"sha2-128f": pq_backend_1.slh_dsa_sha2_128f,
|
|
22
|
+
"sha2-128s": pq_backend_1.slh_dsa_sha2_128s,
|
|
23
|
+
"sha2-192f": pq_backend_1.slh_dsa_sha2_192f,
|
|
24
|
+
"sha2-192s": pq_backend_1.slh_dsa_sha2_192s,
|
|
25
|
+
"sha2-256f": pq_backend_1.slh_dsa_sha2_256f,
|
|
26
|
+
"sha2-256s": pq_backend_1.slh_dsa_sha2_256s,
|
|
27
|
+
"shake-128f": pq_backend_1.slh_dsa_shake_128f,
|
|
28
|
+
"shake-128s": pq_backend_1.slh_dsa_shake_128s,
|
|
29
|
+
"shake-192f": pq_backend_1.slh_dsa_shake_192f,
|
|
30
|
+
"shake-192s": pq_backend_1.slh_dsa_shake_192s,
|
|
31
|
+
"shake-256f": pq_backend_1.slh_dsa_shake_256f,
|
|
32
|
+
"shake-256s": pq_backend_1.slh_dsa_shake_256s,
|
|
32
33
|
};
|
|
33
34
|
function getVariant(variant) {
|
|
34
35
|
const impl = SLH_DSA_VARIANTS[variant];
|
|
35
36
|
if (!impl) {
|
|
36
|
-
throw new
|
|
37
|
+
throw new errors_1.CryptoError(`Unsupported SLH-DSA variant: ${variant}. Supported: ${Object.keys(SLH_DSA_VARIANTS).join(", ")}`, errors_1.CryptoErrorCode.UNSUPPORTED_ALGORITHM);
|
|
37
38
|
}
|
|
38
39
|
return impl;
|
|
39
40
|
}
|
|
@@ -44,8 +45,8 @@ function slhDsaKeygen(variant) {
|
|
|
44
45
|
const dsa = getVariant(variant);
|
|
45
46
|
const { publicKey, secretKey } = dsa.keygen();
|
|
46
47
|
return {
|
|
47
|
-
publicKey:
|
|
48
|
-
secretKey:
|
|
48
|
+
publicKey: (0, encoding_1.toHex)(publicKey),
|
|
49
|
+
secretKey: (0, encoding_1.toHex)(secretKey),
|
|
49
50
|
algorithm: algorithmName(variant),
|
|
50
51
|
};
|
|
51
52
|
}
|
|
@@ -55,7 +56,7 @@ function slhDsaSign(variant, secretKeyHex, message) {
|
|
|
55
56
|
const msg = toBytes(message);
|
|
56
57
|
const signature = dsa.sign(msg, secretKey);
|
|
57
58
|
return {
|
|
58
|
-
signature:
|
|
59
|
+
signature: (0, encoding_1.toHex)(signature),
|
|
59
60
|
algorithm: algorithmName(variant),
|
|
60
61
|
};
|
|
61
62
|
}
|
package/dist/modern/pq-kem.d.ts
CHANGED
|
@@ -41,7 +41,15 @@ export interface HybridKemDecapsulateResult {
|
|
|
41
41
|
}
|
|
42
42
|
export declare function mlKemKeygen(level: MlKemLevel): MlKemKeyPairResult;
|
|
43
43
|
export declare function mlKemEncapsulate(level: MlKemLevel, publicKeyHex: string): MlKemEncapsulateResult;
|
|
44
|
+
export declare function mlKemEncapsulate(publicKeyHex: string): MlKemEncapsulateResult;
|
|
44
45
|
export declare function mlKemDecapsulate(level: MlKemLevel, secretKeyHex: string, ciphertextHex: string): MlKemDecapsulateResult;
|
|
46
|
+
export declare function mlKemDecapsulate(secretKeyHex: string, ciphertextHex: string): MlKemDecapsulateResult;
|
|
47
|
+
export declare const mlKemGenerateKeyPair: () => MlKemKeyPairResult;
|
|
48
|
+
export declare const mlKemEncap: (level: MlKemLevel, publicKeyHex: string) => MlKemEncapsulateResult;
|
|
49
|
+
export declare const mlKemDecap: (level: MlKemLevel, secretKeyHex: string, ciphertextHex: string) => MlKemDecapsulateResult;
|
|
50
|
+
export type MlKemKeyPair = MlKemKeyPairResult;
|
|
51
|
+
export type MlKemEncapResult = MlKemEncapsulateResult;
|
|
52
|
+
export type MlKemDecapResult = MlKemDecapsulateResult;
|
|
45
53
|
export declare function hybridKemKeygen(kemLevel?: MlKemLevel): HybridKemKeyPair;
|
|
46
54
|
export declare function hybridKemEncapsulate(kemLevel: MlKemLevel, theirX25519Public: string, theirMlKemPublic: string): HybridKemEncapsulateResult;
|
|
47
55
|
export declare function hybridKemDecapsulate(kemLevel: MlKemLevel, ourX25519Private: string, ourMlKemSecret: string, theirX25519Ephemeral: string, mlKemCiphertext: string): HybridKemDecapsulateResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pq-kem.d.ts","sourceRoot":"","sources":["../../src/modern/pq-kem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pq-kem.d.ts","sourceRoot":"","sources":["../../src/modern/pq-kem.ts"],"names":[],"mappings":"AAgDA,MAAM,MAAM,UAAU,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAG1C,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,YAAY,GAAG,aAAa,CAAC;AAMzE,eAAO,MAAM,wBAAwB,EAAG,gBAAyB,CAAC;AAMlE,eAAO,MAAM,2BAA2B,EAAG,mBAA4B,CAAC;AAGxE,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAGX,MAAM,MAAM,kBAAkB,GAC1B,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