Skip to content

Commit 314d8d2

Browse files
authored
feat: implement supports(), getPublicKey(), raw-public, and Argon2 subtle APIs (#924)
1 parent 6ffd3f1 commit 314d8d2

11 files changed

Lines changed: 1099 additions & 267 deletions

File tree

.docs/implementation-coverage.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This document attempts to describe the implementation status of Crypto APIs/Inte
77
* ❌ - implemented in Node, not RNQC
88
* ✅ - implemented in Node and RNQC
99
* 🚧 - work in progress
10+
* `-` - not applicable to React Native
1011

1112
## Post-Quantum Cryptography (PQC)
1213

@@ -124,7 +125,7 @@ These algorithms provide quantum-resistant cryptography.
124125
*`crypto.decapsulate(key, ciphertext[, callback])`
125126
*`crypto.diffieHellman(options[, callback])`
126127
*`crypto.encapsulate(key[, callback])`
127-
* `crypto.fips` deprecated
128+
* `-` `crypto.fips` deprecated, not applicable to RN
128129
*`crypto.generateKey(type, options, callback)`
129130
* 🚧 `crypto.generateKeyPair(type, options, callback)`
130131
* 🚧 `crypto.generateKeyPairSync(type, options)`
@@ -134,7 +135,7 @@ These algorithms provide quantum-resistant cryptography.
134135
*`crypto.getCipherInfo(nameOrNid[, options])`
135136
*`crypto.getCiphers()`
136137
*`crypto.getCurves()`
137-
* `crypto.getFips()`
138+
* `-` `crypto.getFips()` not applicable to RN
138139
*`crypto.getHashes()`
139140
*`crypto.getRandomValues(typedArray)`
140141
*`crypto.hash(algorithm, data[, outputEncoding])`
@@ -153,9 +154,9 @@ These algorithms provide quantum-resistant cryptography.
153154
*`crypto.randomUUID([options])`
154155
*`crypto.scrypt(password, salt, keylen[, options], callback)`
155156
*`crypto.scryptSync(password, salt, keylen[, options])`
156-
* `crypto.secureHeapUsed()`
157-
* `crypto.setEngine(engine[, flags])`
158-
* `crypto.setFips(bool)`
157+
* `-` `crypto.secureHeapUsed()` not applicable to RN
158+
* `-` `crypto.setEngine(engine[, flags])` not applicable to RN
159+
* `-` `crypto.setFips(bool)` not applicable to RN
159160
*`crypto.sign(algorithm, data, key[, callback])`
160161
*`crypto.subtle` (see below)
161162
*`crypto.timingSafeEqual(a, b)`
@@ -260,7 +261,7 @@ These ciphers are **not available in Node.js** but are provided by RNQC via libs
260261
# `SubtleCrypto`
261262

262263
* 🚧 Class: `SubtleCrypto`
263-
* static `supports(operation, algorithm[, lengthOrAdditionalAlgorithm])`
264+
* static `supports(operation, algorithm[, lengthOrAdditionalAlgorithm])`
264265
*`subtle.decapsulateBits(decapsulationAlgorithm, decapsulationKey, ciphertext)`
265266
*`subtle.decapsulateKey(decapsulationAlgorithm, decapsulationKey, ciphertext, sharedKeyAlgorithm, extractable, usages)`
266267
*`subtle.decrypt(algorithm, key, data)`
@@ -272,7 +273,7 @@ These ciphers are **not available in Node.js** but are provided by RNQC via libs
272273
* 🚧 `subtle.encrypt(algorithm, key, data)`
273274
* 🚧 `subtle.exportKey(format, key)`
274275
* 🚧 `subtle.generateKey(algorithm, extractable, keyUsages)`
275-
* `subtle.getPublicKey(key, keyUsages)`
276+
* `subtle.getPublicKey(key, keyUsages)`
276277
* 🚧 `subtle.importKey(format, keyData, algorithm, extractable, keyUsages)`
277278
*`subtle.sign(algorithm, key, data)`
278279
*`subtle.unwrapKey(format, wrappedKey, unwrappingKey, unwrapAlgo, unwrappedKeyAlgo, extractable, keyUsages)`
@@ -292,6 +293,9 @@ These ciphers are **not available in Node.js** but are provided by RNQC via libs
292293
## `subtle.deriveBits`
293294
| Algorithm | Status |
294295
| --------- | :----: |
296+
| `Argon2d` ||
297+
| `Argon2i` ||
298+
| `Argon2id` ||
295299
| `ECDH` ||
296300
| `X25519` ||
297301
| `X448` ||
@@ -301,6 +305,9 @@ These ciphers are **not available in Node.js** but are provided by RNQC via libs
301305
## `subtle.deriveKey`
302306
| Algorithm | Status |
303307
| --------- | :----: |
308+
| `Argon2d` ||
309+
| `Argon2i` ||
310+
| `Argon2id` ||
304311
| `ECDH` ||
305312
| `HKDF` ||
306313
| `PBKDF2` ||
@@ -341,8 +348,8 @@ These ciphers are **not available in Node.js** but are provided by RNQC via libs
341348
| `ChaCha20-Poly1305` | | || || | |
342349
| `ECDH` ||||| || |
343350
| `ECDSA` ||||| || |
344-
| `Ed25519` ||||| | | |
345-
| `Ed448` ||||| | | |
351+
| `Ed25519` ||||| | | |
352+
| `Ed448` ||||| | | |
346353
| `HMAC` | | |||| | |
347354
| `ML-DSA-44` |||| | |||
348355
| `ML-DSA-65` |||| | |||
@@ -389,10 +396,15 @@ These ciphers are **not available in Node.js** but are provided by RNQC via libs
389396
| `AES-OCB` ||
390397
| `ChaCha20-Poly1305` ||
391398
| `HMAC` ||
399+
| `KMAC128` ||
400+
| `KMAC256` ||
392401

393402
## `subtle.importKey`
394403
| Key Type | `spki` | `pkcs8` | `jwk` | `raw` | `raw-secret` | `raw-public` | `raw-seed` |
395404
| ------------------- | :----: | :-----: | :---: | :---: | :----------: | :----------: | :--------: |
405+
| `Argon2d` | | | | || | |
406+
| `Argon2i` | | | | || | |
407+
| `Argon2id` | | | | || | |
396408
| `AES-CBC` | | |||| | |
397409
| `AES-CTR` | | |||| | |
398410
| `AES-GCM` | | |||| | |
@@ -401,9 +413,9 @@ These ciphers are **not available in Node.js** but are provided by RNQC via libs
401413
| `ChaCha20-Poly1305` | | || || | |
402414
| `ECDH` ||||| || |
403415
| `ECDSA` ||||| || |
404-
| `Ed25519` ||||| | | |
405-
| `Ed448` ||||| | | |
406-
| `HKDF` | | | || | | |
416+
| `Ed25519` ||||| | | |
417+
| `Ed448` ||||| | | |
418+
| `HKDF` | | | || | | |
407419
| `HMAC` | | |||| | |
408420
| `ML-DSA-44` |||| | |||
409421
| `ML-DSA-65` |||| | |||
@@ -425,6 +437,8 @@ These ciphers are **not available in Node.js** but are provided by RNQC via libs
425437
| `Ed25519` ||
426438
| `Ed448` ||
427439
| `HMAC` ||
440+
| `KMAC128` ||
441+
| `KMAC256` ||
428442
| `ML-DSA-44` ||
429443
| `ML-DSA-65` ||
430444
| `ML-DSA-87` ||
@@ -477,6 +491,8 @@ These ciphers are **not available in Node.js** but are provided by RNQC via libs
477491
| `Ed25519` ||
478492
| `Ed448` ||
479493
| `HMAC` ||
494+
| `KMAC128` ||
495+
| `KMAC256` ||
480496
| `ML-DSA-44` ||
481497
| `ML-DSA-65` ||
482498
| `ML-DSA-87` ||

.zed/settings.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)