hpke 1.0.5 → 1.1.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.ts CHANGED
@@ -1331,6 +1331,8 @@ export type KEMFactory = () => Readonly<KEM>
1331
1331
  * - {@link KDF_HKDF_SHA512 | HKDF-SHA512}
1332
1332
  * - {@link KDF_SHAKE128 | SHAKE128}
1333
1333
  * - {@link KDF_SHAKE256 | SHAKE256}
1334
+ * - {@link KDF_TurboSHAKE128 | TurboSHAKE128}
1335
+ * - {@link KDF_TurboSHAKE256 | TurboSHAKE256}
1334
1336
  *
1335
1337
  * > [!TIP]\
1336
1338
  * > {@link CipherSuite} is not limited to using only these exported KDF implementations. Any function
@@ -2532,6 +2534,66 @@ export const KDF_SHAKE256: KDFFactory = function (): SHAKE {
2532
2534
  }
2533
2535
  }
2534
2536
 
2537
+ /**
2538
+ * TurboSHAKE128 key derivation function.
2539
+ *
2540
+ * A one-stage KDF using the TurboSHAKE128 extendable-output function (XOF) with an output length
2541
+ * (Nh) of 32 bytes.
2542
+ *
2543
+ * Depends on the following Web Cryptography algorithms being supported in the runtime:
2544
+ *
2545
+ * - TurboSHAKE128 digest
2546
+ *
2547
+ * This is a factory function that must be passed to the {@link CipherSuite} constructor.
2548
+ *
2549
+ * > [!TIP]\
2550
+ * > An implementation of this algorithm not reliant on Web Cryptography is also exported by
2551
+ * > [`@panva/hpke-noble`](https://www.npmjs.com/package/@panva/hpke-noble)
2552
+ *
2553
+ * @group KDF Algorithms
2554
+ * @see [HPKE-PQ One-Stage KDFs](https://datatracker.ietf.org/doc/html/draft-ietf-hpke-pq-04.html#section-5)
2555
+ */
2556
+ export const KDF_TurboSHAKE128: KDFFactory = function (): SHAKE {
2557
+ return {
2558
+ id: 0x0012,
2559
+ type: 'KDF',
2560
+ name: 'TurboSHAKE128',
2561
+ Nh: 32,
2562
+ algorithm: 'TurboSHAKE128',
2563
+ ...SHAKE_SHARED(),
2564
+ }
2565
+ }
2566
+
2567
+ /**
2568
+ * TurboSHAKE256 key derivation function.
2569
+ *
2570
+ * A one-stage KDF using the TurboSHAKE256 extendable-output function (XOF) with an output length
2571
+ * (Nh) of 64 bytes.
2572
+ *
2573
+ * Depends on the following Web Cryptography algorithms being supported in the runtime:
2574
+ *
2575
+ * - TurboSHAKE256 digest
2576
+ *
2577
+ * This is a factory function that must be passed to the {@link CipherSuite} constructor.
2578
+ *
2579
+ * > [!TIP]\
2580
+ * > An implementation of this algorithm not reliant on Web Cryptography is also exported by
2581
+ * > [`@panva/hpke-noble`](https://www.npmjs.com/package/@panva/hpke-noble)
2582
+ *
2583
+ * @group KDF Algorithms
2584
+ * @see [HPKE-PQ One-Stage KDFs](https://datatracker.ietf.org/doc/html/draft-ietf-hpke-pq-04.html#section-5)
2585
+ */
2586
+ export const KDF_TurboSHAKE256: KDFFactory = function (): SHAKE {
2587
+ return {
2588
+ id: 0x0013,
2589
+ type: 'KDF',
2590
+ name: 'TurboSHAKE256',
2591
+ Nh: 64,
2592
+ algorithm: 'TurboSHAKE256',
2593
+ ...SHAKE_SHARED(),
2594
+ }
2595
+ }
2596
+
2535
2597
  async function getPublicKeyByExport(
2536
2598
  name: string,
2537
2599
  key: CryptoKey,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hpke",
3
- "version": "1.0.5",
3
+ "version": "1.1.0",
4
4
  "description": "Hybrid Public Key Encryption (HPKE) for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes",
5
5
  "keywords": [
6
6
  "browser",
@@ -56,21 +56,21 @@
56
56
  "@noble/curves": "^2.0.1",
57
57
  "@noble/hashes": "^2.0.1",
58
58
  "@noble/post-quantum": "^0.5.4",
59
- "@types/node": "^24.10.11",
60
- "@types/web": "^0.0.327",
61
- "amaro": "^1.1.7",
62
- "esbuild": "^0.27.0",
59
+ "@types/node": "^24.12.0",
60
+ "@types/web": "^0.0.344",
61
+ "amaro": "^1.1.8",
62
+ "esbuild": "^0.27.4",
63
63
  "playwright": "^1.58.2",
64
64
  "prettier": "^3.8.1",
65
65
  "prettier-plugin-jsdoc": "^1.8.0",
66
66
  "remark-behead": "^3.1.0",
67
67
  "remark-insert-headings": "^0.0.0",
68
68
  "remark-toc": "^9.0.0",
69
- "serve": "^14.2.5",
70
- "typedoc": "^0.28.16",
71
- "typedoc-plugin-markdown": "^4.10.0",
69
+ "serve": "^14.2.6",
70
+ "typedoc": "^0.28.18",
71
+ "typedoc-plugin-markdown": "^4.11.0",
72
72
  "typedoc-plugin-remark": "^2.0.1",
73
- "typescript": "^5.9.3"
73
+ "typescript": "^6.0.2"
74
74
  },
75
75
  "publishConfig": {
76
76
  "access": "public"