Age | Commit message (Collapse) | Author |
|
Move all op related code of "ext/node" to "ext/node/ops" module.
These files were unnecessarily scattered around the extension.
|
|
|
|
Towards #18455
This commit implements the keypair generation for asymmetric keys for
the `generateKeyPair` API.
See how key material is managed in this implementation:
https://www.notion.so/denolandinc/node-crypto-design-99fc33f568d24e47a5e4b36002c5325d?pvs=4
Private and public key encoding depend on `KeyObject#export` which is
not implemented. I've also skipped ED448 and X448 since we need a crate
for that in WebCrypto too.
|
|
|
|
|
|
randomFillSync (#18658)
Pretty much as per the title, I'd welcome some feedback especially
around the
array/buffer handling in the two randomFill functions.
|
|
|
|
Towards #18455
|
|
Towards https://github.com/denoland/deno/issues/18455
|
|
Towards #18455
|
|
|
|
Towards #18455
This commit implements `checkPrimeSync` and `checkPrime` in node:crypto
using the Miller-Rabin primality test (fun fact: it actually is a test
for composite numbers)
It first compares the candidate against many known small primes and if
not, proceeds to run the Miller-Rabin primality test.
http://nickle.org/examples/miller-rabin.5c used as reference
implementation.
|
|
Towards #18455
|
|
|
|
|
|
|
|
```
> deno run -A ../test.mjs
cpu: unknown
runtime: deno 1.31.1 (aarch64-apple-darwin)
benchmark time (avg) (min … max) p75 p99 p995
------------------------------------------------- -----------------------------
2.22 µs/iter (2.2 µs … 2.28 µs) 2.22 µs 2.28 µs 2.28 µs
> target/release/deno run -A test.mjs
cpu: unknown
runtime: deno 1.31.1 (aarch64-apple-darwin)
benchmark time (avg) (min … max) p75 p99 p995
------------------------------------------------- -----------------------------
864.9 ns/iter (825.05 ns … 1.22 µs) 864.93 ns 1.22 µs 1.22 µs
```
|
|
Towards #17809
|
|
This commit moves "deno_std/node" in "ext/node" crate. The code is
transpiled and snapshotted during the build process.
During the first pass a minimal amount of work was done to create the
snapshot, a lot of code in "ext/node" depends on presence of "Deno"
global. This code will be gradually fixed in the follow up PRs to migrate
it to import relevant APIs from "internal:" modules.
Currently the code from snapshot is not used in any way, and all
Node/npm compatibility still uses code from
"https://deno.land/std/node" (or from the location specified by
"DENO_NODE_COMPAT_URL"). This will also be handled in a follow
up PRs.
---------
Co-authored-by: crowlkats <crowlkats@toaxl.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
|