hpke 1.1.7 → 1.1.9

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.
Files changed (6) hide show
  1. package/README.md +30 -19
  2. package/index.d.ts +133 -90
  3. package/index.d.ts.map +1 -1
  4. package/index.js +301 -253
  5. package/index.ts +389 -341
  6. package/package.json +12 -11
package/README.md CHANGED
@@ -89,19 +89,19 @@ Below are the algorithms built in (based on Web Cryptography) and their runtime
89
89
 
90
90
  ### Key Encapsulation Mechanisms (KEM)
91
91
 
92
- | Name | Node.js | Deno | Bun | CF Workers | [Browsers][] | [Extensibility][] |
93
- | :--------------------------------------------- | :-----: | :--: | :-: | :--------: | :----------: | :---------------: |
94
- | DHKEM(P-256, HKDF-SHA256) <sub>`0x0010`</sub> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
95
- | DHKEM(P-384, HKDF-SHA384) <sub>`0x0011`</sub> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
96
- | DHKEM(P-521, HKDF-SHA512) <sub>`0x0012`</sub> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
97
- | DHKEM(X25519, HKDF-SHA256) <sub>`0x0020`</sub> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
98
- | DHKEM(X448, HKDF-SHA512) <sub>`0x0021`</sub> | ✓ | ✓ | | | | ✓ |
99
- | ML-KEM-512 <sub>`0x0040`</sub> | ✓ | ✓ | | | | ✓ |
100
- | ML-KEM-768 <sub>`0x0041`</sub> | ✓ | ✓ | ✓ | | | ✓ |
101
- | ML-KEM-1024 <sub>`0x0042`</sub> | ✓ | ✓ | ✓ | | | ✓ |
102
- | MLKEM768-P256 <sub>`0x0050`</sub> | ✓ | ✓ | | | | ✓ |
103
- | MLKEM768-X25519 <sub>`0x647a`</sub> | ✓ | ✓ | | | | ✓ |
104
- | MLKEM1024-P384 <sub>`0x0051`</sub> | ✓ | ✓ | | | | ✓ |
92
+ | Name | Node.js | Deno | Bun | CF Workers | [Browsers][] | [Extensibility][] |
93
+ | :--------------------------------------------- | :-----: | :--: | :-: | :-----------: | :----------: | :---------------: |
94
+ | DHKEM(P-256, HKDF-SHA256) <sub>`0x0010`</sub> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
95
+ | DHKEM(P-384, HKDF-SHA384) <sub>`0x0011`</sub> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
96
+ | DHKEM(P-521, HKDF-SHA512) <sub>`0x0012`</sub> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
97
+ | DHKEM(X25519, HKDF-SHA256) <sub>`0x0020`</sub> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
98
+ | DHKEM(X448, HKDF-SHA512) <sub>`0x0021`</sub> | ✓ | ✓ | | | | ✓ |
99
+ | ML-KEM-512 <sub>`0x0040`</sub> | ✓ | ✓ | | | | ✓ |
100
+ | ML-KEM-768 <sub>`0x0041`</sub> | ✓ | ✓ | ✓ | ✓[^cf-modern] | ◐[^chromium] | ✓ |
101
+ | ML-KEM-1024 <sub>`0x0042`</sub> | ✓ | ✓ | ✓ | ✓[^cf-modern] | ◐[^chromium] | ✓ |
102
+ | MLKEM768-P256 <sub>`0x0050`</sub> | ✓ | ✓ | | | | ✓ |
103
+ | MLKEM768-X25519 <sub>`0x647a`</sub> | ✓ | ✓ | | ✓[^cf-modern] | ◐[^chromium] | ✓ |
104
+ | MLKEM1024-P384 <sub>`0x0051`</sub> | ✓ | ✓ | | | | ✓ |
105
105
 
106
106
  ### Key Derivation Functions (KDF)
107
107
 
@@ -117,15 +117,26 @@ Below are the algorithms built in (based on Web Cryptography) and their runtime
117
117
 
118
118
  ### Authenticated Encryption (AEAD)
119
119
 
120
- | Name | Node.js | Deno | Bun | CF Workers | [Browsers][] | [Extensibility][] |
121
- | :----------------------------------- | :-----: | :--: | :-: | :--------: | :----------: | :---------------: |
122
- | AES-128-GCM <sub>`0x0001`</sub> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
123
- | AES-256-GCM <sub>`0x0002`</sub> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
124
- | ChaCha20Poly1305 <sub>`0x0003`</sub> | ✓ | ✓ | ✓ | | | ✓ |
120
+ | Name | Node.js | Deno | Bun | CF Workers | [Browsers][] | [Extensibility][] |
121
+ | :----------------------------------- | :-----: | :--: | :-: | :-----------: | :----------: | :---------------: |
122
+ | AES-128-GCM <sub>`0x0001`</sub> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
123
+ | AES-256-GCM <sub>`0x0002`</sub> | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
124
+ | ChaCha20Poly1305 <sub>`0x0003`</sub> | ✓ | ✓ | ✓ | ✓[^cf-modern] | ◐[^chromium] | ✓ |
125
+
126
+ [^chromium]: Chromium
127
+
128
+ [^firefox]: Firefox
129
+
130
+ [^webkit]: WebKit
131
+
132
+ [^cf-modern]:
133
+ Requires the
134
+ [`webcrypto_modern_algorithms`](https://developers.cloudflare.com/workers/configuration/compatibility-flags/#web-crypto-modern-algorithms)
135
+ compatibility flag.
125
136
 
126
137
  ## Specifications
127
138
 
128
- - [Hybrid Public Key Encryption](https://datatracker.ietf.org/doc/html/draft-ietf-hpke-hpke-04)
139
+ - [Hybrid Public Key Encryption](https://datatracker.ietf.org/doc/html/draft-ietf-hpke-hpke-06)
129
140
  - [Post-Quantum and Post-Quantum/Traditional Hybrid Algorithms for HPKE](https://datatracker.ietf.org/doc/html/draft-ietf-hpke-pq-05)
130
141
 
131
142
  The algorithm implementations are being tested using test vectors from their respective