@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebastienrousseau/crypto-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"description": "Post-quantum cryptography library for TypeScript and Node.js: ML-KEM, ML-DSA, SLH-DSA, HPKE, AES-GCM, XChaCha20-Poly1305, Ed25519, X25519, SHA-3, BLAKE3, Argon2id and OpenPGP.",
|
|
5
5
|
"author": "Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT OR Apache-2.0",
|
|
@@ -42,6 +42,9 @@
|
|
|
42
42
|
"accel": [
|
|
43
43
|
"./dist/accel/index.d.ts"
|
|
44
44
|
],
|
|
45
|
+
"testing": [
|
|
46
|
+
"./dist/testing/index.d.ts"
|
|
47
|
+
],
|
|
45
48
|
"pgp": [
|
|
46
49
|
"./dist/bin/cryptolib.d.ts"
|
|
47
50
|
]
|
|
@@ -88,6 +91,11 @@
|
|
|
88
91
|
"require": "./dist/accel/index.js",
|
|
89
92
|
"default": "./dist/accel/index.js"
|
|
90
93
|
},
|
|
94
|
+
"./testing": {
|
|
95
|
+
"types": "./dist/testing/index.d.ts",
|
|
96
|
+
"require": "./dist/testing/index.js",
|
|
97
|
+
"default": "./dist/testing/index.js"
|
|
98
|
+
},
|
|
91
99
|
"./pgp": {
|
|
92
100
|
"types": "./dist/bin/cryptolib.d.ts",
|
|
93
101
|
"require": "./dist/bin/cryptolib.js",
|
|
@@ -107,6 +115,7 @@
|
|
|
107
115
|
"@noble/hashes": "^2.4.0",
|
|
108
116
|
"@noble/post-quantum": "^0.7.1",
|
|
109
117
|
"@openpgp/web-stream-tools": "^0.3.1",
|
|
118
|
+
"eckey-utils": "^0.7.14",
|
|
110
119
|
"openpgp": "^6.3.2"
|
|
111
120
|
},
|
|
112
121
|
"devDependencies": {
|
|
@@ -161,7 +170,8 @@
|
|
|
161
170
|
"format": "prettier --write src/**/*.ts",
|
|
162
171
|
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
163
172
|
"start": "node dist/index.js",
|
|
164
|
-
"test": "c8 --check-coverage --lines 100 --branches
|
|
173
|
+
"test": "c8 --check-coverage --lines 100 --branches 100 --functions 100 --reporter=lcov --reporter=text mocha --config=.mocharc.cjs && mocha --config=.mocharc.vectors.cjs",
|
|
174
|
+
"test:run": "mocha --config=.mocharc.cjs && mocha --config=.mocharc.vectors.cjs",
|
|
165
175
|
"docs": "typedoc",
|
|
166
176
|
"examples:check": "tsc -p examples/tsconfig.json"
|
|
167
177
|
}
|
package/dist/config/config.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":";;;;;;AAGA,wBAgEE"}
|
package/dist/config/config.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const enums_1 = __importDefault(require("../enums"));
|
|
7
|
-
exports.default = {
|
|
8
|
-
preferredRSABits: enums_1.default.size.keySize2048,
|
|
9
|
-
preferredCurve: enums_1.default.curve.p256,
|
|
10
|
-
preferredType: enums_1.default.type.rsa,
|
|
11
|
-
preferredFormat: enums_1.default.format.armored,
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=config.js.map
|
package/dist/key/key.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const getPrivateKey: () => Promise<string>;
|
|
2
|
-
export declare const getPublicKey: () => Promise<string>;
|
|
3
|
-
export declare const getRevocationCertificate: () => Promise<string>;
|
|
4
|
-
declare const _default: {
|
|
5
|
-
getPrivateKey: () => Promise<string>;
|
|
6
|
-
getPublicKey: () => Promise<string>;
|
|
7
|
-
getRevocationCertificate: () => Promise<string>;
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
10
|
-
//# sourceMappingURL=key.d.ts.map
|
package/dist/key/key.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/key/key.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,aAAa,QAAa,OAAO,CAAC,MAAM,CAGpD,CAAC;AAKF,eAAO,MAAM,YAAY,QAAa,OAAO,CAAC,MAAM,CAGnD,CAAC;AAMF,eAAO,MAAM,wBAAwB,QAAa,OAAO,CAAC,MAAM,CAG/D,CAAC;;yBApBqC,OAAO,CAAC,MAAM,CAAC;wBAQhB,OAAO,CAAC,MAAM,CAAC;oCASH,OAAO,CAAC,MAAM,CAAC;;AAMjE,wBAOE"}
|
package/dist/key/key.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRevocationCertificate = exports.getPublicKey = exports.getPrivateKey = void 0;
|
|
4
|
-
const keystore_1 = require("./keystore");
|
|
5
|
-
const getPrivateKey = async () => {
|
|
6
|
-
const ks = await (0, keystore_1.loadKeystore)();
|
|
7
|
-
return ks.privateKeyArmored;
|
|
8
|
-
};
|
|
9
|
-
exports.getPrivateKey = getPrivateKey;
|
|
10
|
-
const getPublicKey = async () => {
|
|
11
|
-
const ks = await (0, keystore_1.loadKeystore)();
|
|
12
|
-
return ks.publicKeyArmored;
|
|
13
|
-
};
|
|
14
|
-
exports.getPublicKey = getPublicKey;
|
|
15
|
-
const getRevocationCertificate = async () => {
|
|
16
|
-
const ks = await (0, keystore_1.loadKeystore)();
|
|
17
|
-
return ks.revocationArmored;
|
|
18
|
-
};
|
|
19
|
-
exports.getRevocationCertificate = getRevocationCertificate;
|
|
20
|
-
exports.default = {
|
|
21
|
-
getPrivateKey: exports.getPrivateKey,
|
|
22
|
-
getPublicKey: exports.getPublicKey,
|
|
23
|
-
getRevocationCertificate: exports.getRevocationCertificate,
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=key.js.map
|