Skip to content

Commit

Permalink
docs and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
boorad committed Jan 26, 2024
1 parent 674977b commit eaa0886
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 21 deletions.
21 changes: 0 additions & 21 deletions example/src/testing/MochaRNAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ rootSuite.timeout(10 * 1000);
let mochaContext = rootSuite;
let only = false;

export const clearTests = () => {
rootSuite.suites.map((s) => {
s.tests = [];
});
rootSuite.suites = [];
rootSuite.tests = [];
mochaContext = rootSuite;
only = false;
};

export const it = (
name: string,
f: MochaTypes.Func | MochaTypes.AsyncFunc
Expand All @@ -27,17 +17,6 @@ export const it = (
}
};

// TODO: (boorad) needed anymore?
export const itOnly = (
name: string,
f: MochaTypes.Func | MochaTypes.AsyncFunc
): void => {
clearTests();
const test = new Mocha.Test(name, f);
mochaContext.addTest(test);
only = true;
};

export const describe = (name: string, f: () => void): void => {
const prevMochaContext = mochaContext;
mochaContext = new Mocha.Suite(
Expand Down
181 changes: 181 additions & 0 deletions implementation-coverage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# Implementation Coverage
This document attempts to describe the implementation status of Crypto APIs/Interfaces from Node.js in the `react-native-quick-crypto` library.

# `Crypto`
> TODO
# `SubtleCrypto`

> Note: A lot of isomorphic packages check the availability of `crypto.subtle` and use it instead of `crypto`. Until `crypto.subtle` is feature-complete, you might want to set it to `undefined` so that `crypto` gets used instead for transitive dependencies.
## `encrypt`
| Algorithm | Status |
| --------- | :----: |
| `RSA-OAEP` | |
| `AES-CTR` | |
| `AES-CBC` | |
| `AES-GCM` | |

## `decrypt`
| Algorithm | Status |
| --------- | :----: |
| `RSA-OAEP` | |
| `AES-CTR` | |
| `AES-CBC` | |
| `AES-GCM` | |

## `sign`
| Algorithm | Status |
| --------- | :----: |
| `RSASSA-PKCS1-v1_5` | |
| `RSA-PSS` | |
| `ECDSA` | |
| `Ed25519` | |
| `Ed448` | |
| `HMAC` | |

## `verify`
| Algorithm | Status |
| --------- | :----: |
| `RSASSA-PKCS1-v1_5` | |
| `RSA-PSS` | |
| `ECDSA` | |
| `Ed25519` | |
| `Ed448` | |
| `HMAC` | |

## `digest`
| Algorithm | Status |
| --------- | :----: |
| `SHA-1` | |
| `SHA-256` | |
| `SHA-384` | |
| `SHA-512` | |

## `generateKey`

### `CryptoKeyPair` algorithms
| Algorithm | Status |
| --------- | :----: |
| `RSASSA-PKCS1-v1_5` | |
| `RSA-PSS` | |
| `RSA-OAEP` | |
| `ECDSA` | |
| `Ed25519` | |
| `Ed448` | |
| `ECDH` | |
| `X25519` | |
| `X448` | |

### `CryptoKey` algorithms
| Algorithm | Status |
| --------- | :----: |
| `HMAC` | |
| `AES-CTR` | |
| `AES-CBC` | |
| `AES-GCM` | |
| `AES-KW` | |

## `deriveKey`
| Algorithm | Status |
| --------- | :----: |
| `ECDH` | |
| `X25519` | |
| `X448` | |
| `HKDF` | |
| `PBKDF2` | |

## `deriveBits`
| Algorithm | Status |
| --------- | :----: |
| `ECDH` | |
| `X25519` | |
| `X448` | |
| `HKDF` | |
| `PBKDF2` ||

## `importKey`
| Key Type | `spki` | `pkcs8` | `jwk` | `raw` |
| ------------------- | :----: | :-----: | :---: | :---: |
| `AES-CBC` | | | 𝑥 | 𝑥 |
| `AES-CTR` | | | 𝑥 | 𝑥 |
| `AES-GCM` | | | 𝑥 | 𝑥 |
| `AES-KW` | | | 𝑥 | 𝑥 |
| `ECDH` | 𝑥 | 𝑥 | 𝑥 ||
| `X25519` | 𝑥 | 𝑥 | 𝑥 | 𝑥 |
| `X448` | 𝑥 | 𝑥 | 𝑥 | 𝑥 |
| `ECDSA` | 𝑥 | 𝑥 | 𝑥 ||
| `Ed25519` | 𝑥 | 𝑥 | 𝑥 | 𝑥 |
| `Ed448` | 𝑥 | 𝑥 | 𝑥 | 𝑥 |
| `HDKF` | | | | |
| `HMAC` | | | 𝑥 | 𝑥 |
| `PBKDF2` | | | ||
| `RSA-OAEP` | 𝑥 | 𝑥 | 𝑥 | |
| `RSA-PSS` | 𝑥 | 𝑥 | 𝑥 | |
| `RSASSA-PKCS1-v1_5` | 𝑥 | 𝑥 | 𝑥 | |

* ` ` - not implemented in Node
* 𝑥 - implemented in Node, not RNQC
* ✔ - implemented in Node and RNQC

## `exportKey`
| Key Type | `spki` | `pkcs8` | `jwk` | `raw` |
| ------------------- | :----: | :-----: | :---: | :---: |
| `AES-CBC` | | | 𝑥 | 𝑥 |
| `AES-CTR` | | | 𝑥 | 𝑥 |
| `AES-GCM` | | | 𝑥 | 𝑥 |
| `AES-KW` | | | 𝑥 | 𝑥 |
| `ECDH` || 𝑥 | 𝑥 | 𝑥 |
| `ECDSA` || 𝑥 | 𝑥 | 𝑥 |
| `Ed25519` | 𝑥 | 𝑥 | 𝑥 | 𝑥 |
| `Ed448` | 𝑥 | 𝑥 | 𝑥 | 𝑥 |
| `HDKF` | | | | |
| `HMAC` | | | 𝑥 | 𝑥 |
| `PBKDF2` | | | | |
| `RSA-OAEP` | 𝑥 | 𝑥 | 𝑥 | |
| `RSA-PSS` | 𝑥 | 𝑥 | 𝑥 | |
| `RSASSA-PKCS1-v1_5` | 𝑥 | 𝑥 | 𝑥 | |

* ` ` - not implemented in Node
* 𝑥 - implemented in Node, not RNQC
* ✔ - implemented in Node and RNQC

## `wrapKey`

### wrapping algorithms
| Algorithm | Status |
| --------- | :----: |
| `RSA-OAEP` | |
| `AES-CTR` | |
| `AES-CBC` | |
| `AES-GCM` | |
| `AES-KW` | |

## `unwrapKey`

### wrapping algorithms
| Algorithm | Status |
| --------- | :----: |
| `RSA-OAEP` | |
| `AES-CTR` | |
| `AES-CBC` | |
| `AES-GCM` | |
| `AES-KW` | |

### unwrapped key algorithms
| Algorithm | Status |
| --------- | :----: |
| `RSASSA-PKCS1-v1_5` | |
| `RSA-PSS` | |
| `RSA-OAEP` | |
| `ECDSA` | |
| `Ed25519` | |
| `Ed448` | |
| `ECDH` | |
| `X25519` | |
| `X448` | |
| `HMAC` | |
| `AES-CTR` | |
| `AES-CBC` | |
| `AES-GCM` | |
| `AES-KW` | |

0 comments on commit eaa0886

Please sign in to comment.