Skip to content

Commit 120d9ca

Browse files
authored
feat(hkdf): implement HKDF with WebCrypto support and native C++ backend (#848)
1 parent 1625b10 commit 120d9ca

File tree

28 files changed

+833
-178
lines changed

28 files changed

+833
-178
lines changed

bun.lock

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/implementation-coverage.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ These algorithms provide quantum-resistant cryptography.
138138
*`crypto.getHashes()`
139139
*`crypto.getRandomValues(typedArray)`
140140
*`crypto.hash(algorithm, data[, options])`
141-
* `crypto.hkdf(digest, ikm, salt, info, keylen, callback)`
142-
* `crypto.hkdfSync(digest, ikm, salt, info, keylen)`
141+
* `crypto.hkdf(digest, ikm, salt, info, keylen, callback)`
142+
* `crypto.hkdfSync(digest, ikm, salt, info, keylen)`
143143
*`crypto.pbkdf2(password, salt, iterations, keylen, digest, callback)`
144144
*`crypto.pbkdf2Sync(password, salt, iterations, keylen, digest)`
145145
*`crypto.privateDecrypt(privateKey, buffer)`
@@ -282,14 +282,14 @@ These algorithms provide quantum-resistant cryptography.
282282
| `ECDH` ||
283283
| `X25519` ||
284284
| `X448` ||
285-
| `HKDF` | |
285+
| `HKDF` | |
286286
| `PBKDF2` ||
287287

288288
## `subtle.deriveKey`
289289
| Algorithm | Status |
290290
| --------- | :----: |
291291
| `ECDH` ||
292-
| `HKDF` | |
292+
| `HKDF` | |
293293
| `PBKDF2` ||
294294
| `X25519` ||
295295
| `X448` ||
@@ -390,7 +390,7 @@ These algorithms provide quantum-resistant cryptography.
390390
| `ECDSA` ||||| || |
391391
| `Ed25519` ||||| || |
392392
| `Ed448` ||||| || |
393-
| `HKDF` | | | | || | |
393+
| `HKDF` | | | | || | |
394394
| `HMAC` | | |||| | |
395395
| `ML-DSA-44` |||| | |||
396396
| `ML-DSA-65` |||| | |||

example/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ if (typeof global.structuredClone === 'undefined') {
3131
import 'event-target-polyfill';
3232

3333
// readable-stream
34-
// @ts-expect-error - although process.version is readonly, we're setting it for readable-stream
35-
global.process.version = 'v22.0.0';
34+
if (global.process == null) {
35+
// @ts-expect-error - process is not defined
36+
global.process = {};
37+
}
38+
if (global.process.version == null) {
39+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
40+
(global.process as any).version = 'v22.0.0';
41+
}
3642

3743
import { AppRegistry } from 'react-native';
3844
import App from './src/App';

0 commit comments

Comments
 (0)