@push.rocks/smartcrypto 3.2.0 → 3.4.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/.smartconfig.json CHANGED
@@ -56,7 +56,9 @@
56
56
  }
57
57
  }
58
58
  },
59
- "@git.zone/tsdoc": {
60
- "legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license.md) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
59
+ "@git.zone/tsrepo": {
60
+ "docs": {
61
+ "legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license.md) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
62
+ }
61
63
  }
62
64
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartcrypto',
6
- version: '3.2.0',
6
+ version: '3.4.0',
7
7
  description: 'A library providing easy methods for cryptographic operations, including key pair generation.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx5QkFBeUI7SUFDL0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLCtGQUErRjtDQUM3RyxDQUFBIn0=
@@ -7,5 +7,6 @@ export { SmartCryptoError } from './smartcrypto.errors.js';
7
7
  export type { ISmartCryptoErrorJson, TSmartCryptoErrorCode, } from './smartcrypto.errors.js';
8
8
  export * from './smartcrypto.webcrypto.js';
9
9
  export * from './smartcrypto.x25519.js';
10
+ export * from './smartcrypto.mlkem768.js';
10
11
  export * from './smartcrypto.hash.js';
11
12
  export * from './smartcrypto.x509.js';
package/dist_ts/index.js CHANGED
@@ -5,6 +5,7 @@ export * from './smartcrypto.classes.publickey.js';
5
5
  export { SmartCryptoError } from './smartcrypto.errors.js';
6
6
  export * from './smartcrypto.webcrypto.js';
7
7
  export * from './smartcrypto.x25519.js';
8
+ export * from './smartcrypto.mlkem768.js';
8
9
  export * from './smartcrypto.hash.js';
9
10
  export * from './smartcrypto.x509.js';
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHNDQUFzQyxDQUFDO0FBQ3JELGNBQWMsa0NBQWtDLENBQUM7QUFDakQsY0FBYyxxQ0FBcUMsQ0FBQztBQUNwRCxjQUFjLG9DQUFvQyxDQUFDO0FBS25ELE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBSzNELGNBQWMsNEJBQTRCLENBQUM7QUFDM0MsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsdUJBQXVCLENBQUMifQ==
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHNDQUFzQyxDQUFDO0FBQ3JELGNBQWMsa0NBQWtDLENBQUM7QUFDakQsY0FBYyxxQ0FBcUMsQ0FBQztBQUNwRCxjQUFjLG9DQUFvQyxDQUFDO0FBS25ELE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBSzNELGNBQWMsNEJBQTRCLENBQUM7QUFDM0MsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLDJCQUEyQixDQUFDO0FBQzFDLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyx1QkFBdUIsQ0FBQyJ9
@@ -0,0 +1,54 @@
1
+ export declare const MLKEM768_PUBLIC_KEY_BYTES = 1184;
2
+ export declare const MLKEM768_SECRET_KEY_BYTES = 2400;
3
+ export declare const MLKEM768_CIPHERTEXT_BYTES = 1088;
4
+ export declare const MLKEM768_SHARED_SECRET_BYTES = 32;
5
+ export declare const MLKEM768_SEED_BYTES = 64;
6
+ export declare const MLKEM768_SPKI_BYTES: number;
7
+ export interface IMlKem768KeyPair {
8
+ /** Raw 1184-byte FIPS 203 encapsulation key (`ek`). */
9
+ publicKey: Uint8Array;
10
+ /** Raw 2400-byte FIPS 203 decapsulation key (`dk`). */
11
+ secretKey: Uint8Array;
12
+ }
13
+ export interface IMlKem768EncapsulationResult {
14
+ /** 1088-byte FIPS 203 ciphertext (`c`). */
15
+ ciphertext: Uint8Array;
16
+ /** 32-byte shared secret (`K`). */
17
+ sharedSecret: Uint8Array;
18
+ }
19
+ /**
20
+ * Validates a raw 1184-byte FIPS 203 ML-KEM-768 encapsulation key (length and
21
+ * FIPS 203 §7.2 modulus check on every 12-bit coefficient).
22
+ */
23
+ export declare const assertValidMlKem768PublicKey: (publicKeyArg: Uint8Array) => void;
24
+ /**
25
+ * Deterministic FIPS 203 `ML-KEM.KeyGen_internal(d, z)` from a 64-byte seed (`d || z`).
26
+ */
27
+ export declare const mlKem768KeyGenFromSeed: (seedArg: Uint8Array) => IMlKem768KeyPair;
28
+ /**
29
+ * Generates a fresh random FIPS 203 ML-KEM-768 keypair.
30
+ */
31
+ export declare const generateMlKem768KeyPair: () => IMlKem768KeyPair;
32
+ /**
33
+ * Deterministic FIPS 203 `ML-KEM.Encaps_internal(ek, m)` from a 32-byte message `m`.
34
+ */
35
+ export declare const mlKem768EncapsulateDeterministic: (publicKeyArg: Uint8Array, messageArg: Uint8Array) => IMlKem768EncapsulationResult;
36
+ /**
37
+ * FIPS 203 `ML-KEM.Encaps(ek)`: encapsulates a fresh 32-byte shared secret to `publicKeyArg`.
38
+ */
39
+ export declare const mlKem768Encapsulate: (publicKeyArg: Uint8Array) => IMlKem768EncapsulationResult;
40
+ /**
41
+ * FIPS 203 `ML-KEM.Decaps(dk, c)`: decapsulates `ciphertextArg` with constant-time
42
+ * implicit rejection on ciphertext mismatch.
43
+ */
44
+ export declare const mlKem768Decapsulate: (secretKeyArg: Uint8Array, ciphertextArg: Uint8Array) => Uint8Array;
45
+ /**
46
+ * Wraps a validated raw 1184-byte ML-KEM-768 public key in canonical ASN.1 DER
47
+ * SubjectPublicKeyInfo (1206 bytes, compatible with OpenSSL 3.5 / Node.js).
48
+ */
49
+ export declare const mlKem768PublicKeyToSpki: (publicKeyArg: Uint8Array) => Uint8Array;
50
+ /**
51
+ * Extracts and validates the raw 1184-byte ML-KEM-768 public key from a canonical
52
+ * 1206-byte ASN.1 DER SubjectPublicKeyInfo buffer.
53
+ */
54
+ export declare const spkiToMlKem768PublicKey: (spkiArg: Uint8Array) => Uint8Array;