summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/internal/crypto
AgeCommit message (Collapse)Author
2024-04-29fix(ext/node): exporting rsa public keys (#23596)Divy Srivastava
Initial support for exporting rsa public KeyObject. Current assumption is that RSA keys are stored in pkcs1 der format in key storage. Ref https://github.com/denoland/deno/issues/23471 Ref https://github.com/denoland/deno/issues/18928 Ref https://github.com/denoland/deno/issues/21124
2024-03-22fix(ext/node): handle KeyObject in `prepareAsymmetricKey` (#23026)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/20938
2024-03-21fix(ext/node): ECDH.publicKey() point encoding (#23013)Divy Srivastava
2024-03-18fix(ext/node): support public key point encoding in ECDH.generateKeys() (#22976)Satya Rohith
Towards https://github.com/denoland/deno/issues/22921 Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-03-14fix(ext/node): support `spki` format in createPublicKey (#22918)Divy Srivastava
2024-03-14fix(ext/node): crypto.getCipherInfo() (#22916)Divy Srivastava
Stub implementation of getCipherInfo(). Good enough for most cases. Note: We do not support all OpenSSL ciphers (likely never will) Fixes https://github.com/denoland/deno/issues/21805
2024-03-13fix(ext/node): initial `crypto.createPublicKey()` support (#22509)Asher Gomez
Closes #21807 Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-01-29refactor: Use virtul ops module (#22175)Bartek Iwańczuk
Follow up to #22157. This leaves us with 4 usages of `ensureFastOps()` in `deno` itself. There's also about 150 usages of `Deno.core.ops.<op_name>` left as well.
2024-01-29refactor: migrate 'ext/node' extension to virtual ops module (#22157)Bartek Iwańczuk
Follow up to https://github.com/denoland/deno/pull/22135
2024-01-10refactor: use `core.ensureFastOps()` (#21888)Kenta Moriuchi
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-27perf: remove opAsync (#21690)Matt Mastracci
`opAsync` requires a lookup by name on each async call. This is a mechanical translation of all opAsync calls to ensureFastOps. The `opAsync` API on Deno.core will be removed at a later time.
2023-12-07refactor: pull 'core', 'internals', 'primordials' from ES module (#21462)Bartek Iwańczuk
This commit refactors how we access "core", "internals" and "primordials" objects coming from `deno_core`, in our internal JavaScript code. Instead of capturing them from "globalThis.__bootstrap" namespace, we import them from recently added "ext:core/mod.js" file.
2023-12-03fix(ext/node): sign with PEM private keys (#21287)Divy Srivastava
Add support for signing with a RSA PEM private key: `pkcs8` and `pkcs1`. Fixes https://github.com/denoland/deno/issues/18972 Ref #21124 Verified fix with `npm:sshpk`. Unverfied but fixes `npm:google-auth-library`, `npm:web-push` & `oracle/oci-typescript-sdk` --------- Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-11-09fix(node): implement createPrivateKey (#20981)Divy Srivastava
Towards #18455
2023-09-23fix(node): supported arguments to `randomFillSync` (#20637)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/20634
2023-09-07feat: support import attributes (#20342)David Sherret
2023-09-06fix(ext/node): implement AES GCM cipher (#20368)Divy Srivastava
Adds support for AES-GCM 128/256 bit keys in `node:crypto` and `setAAD()`, `setAuthTag()` and `getAuthTag()` Uses https://github.com/littledivy/aead-gcm-stream Fixes https://github.com/denoland/deno/issues/19836 https://github.com/denoland/deno/issues/20353
2023-08-26fix(node): propagate create cipher errors (#20280)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/19002
2023-08-11fix(node): object keys in publicEncrypt (#20128)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/19935
2023-07-02refactor: rename built-in node modules from ext:deno_node/ to node: (#19680)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19510
2023-06-27chore(ext/node): disable prefer-primordials on a per-file basis (#19553)Kenta Moriuchi
2023-06-27test(ext/node): port crypto_test.ts from deno_std (#19561)Felipe Baltor
2023-06-23fix(serde_v8): Do not coerce values in serde_v8 (#19569)Divy Srivastava
Fixes #19568 Values are not coerced to the desired type during deserialisation. This makes serde_v8 stricter. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-06refactor(core): ensureFastOps is an op-generating proxy (#19377)Matt Mastracci
Startup benchmark shows no changes (within 1ms, identical system/user times).
2023-05-16feat(node/crypto): Builtin Diffie-Hellman Groups (#19137)Levente Kurusa
Towards #18455
2023-05-15feat(node/crypto): Diffie Hellman Support (#18943)Levente Kurusa
Support crypto.DiffieHellman class in ext/node/crypto
2023-05-01refactor: migrate async ops to generated wrappers (#18937)Bartek Iwańczuk
Migrates some of existing async ops to generated wrappers introduced in https://github.com/denoland/deno/pull/18887. As a result "core.opAsync2" was removed. I will follow up with more PRs that migrate all the async ops to generated wrappers.
2023-04-27feat(node/crypto): Elliptic Curve Diffie-Hellman (ECDH) support (#18832)Levente Kurusa
- ECDH class - crypto.createECDH() - Supported curves: - secp256k1 - prime256v1 / secp256r1 - secp384r1 - secp224r1 Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-27fix(ext/node): prime generation (#18861)Divy Srivastava
Towards https://github.com/denoland/deno/issues/18455 `safe`, `add` and `rem` options are not implemented because there is no rust crate that provides this functionality (except rust-openssl maybe) and its just not clear if this API is used widely.
2023-04-25fix(ext/node): fix hash.flush (#18818)Yoshiya Hinosawa
2023-04-19fix(ext/node): implement asymmetric keygen (#18651)Divy Srivastava
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.
2023-04-19fix(ext/node): add crypto.sign|verify methods (#18765)Yoshiya Hinosawa
2023-04-18refactor(node/crypto): scrypt polyfill to rust (#18746)Levente Kurusa
2023-04-18fix(ext/node): implement crypto.createVerify (#18703)Yoshiya Hinosawa
2023-04-12refactor(node/crypto): port polyfill to Rust for randomInt, randomFill, ↵Levente Kurusa
randomFillSync (#18658) Pretty much as per the title, I'd welcome some feedback especially around the array/buffer handling in the two randomFill functions.
2023-04-07fix(ext/node): add X509Certificate (#18625)Divy Srivastava
Towards #18455
2023-04-06fix(ext/node): implement hkdf-expand (#18612)Divy Srivastava
Towards https://github.com/denoland/deno/issues/18455
2023-04-06fix(ext/node): add symmetric keygen (#18609)Divy Srivastava
Towards #18455
2023-03-31perf(ext/websocket): use opAsync2 to avoid spread deopt (#18525)Divy Srivastava
This commit adds a new core API `opAsync2` to call an async op with atmost 2 arguments. Spread argument iterators has a pretty big perf hit when calling ops. | name | avg msg/sec/core | | --- | --- | | 1.32.1 | `127820.750000` | | #18506 | `140079.000000` | | #18506 + #18509 | `150104.250000` | | #18506 + #18509 + this | `157340.000000` |
2023-03-28fix(ext/node): implement crypto.Sign (RSA/PEM/SHA{224,256,384,512}) (#18471)Yoshiya Hinosawa
2023-03-28feat(ext/node): add `crypto.checkPrime` API (#18465)Divy Srivastava
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.
2023-03-28chore(ext/node): port pbkdf2 to Rust (#18470)Divy Srivastava
Towards #18455
2023-03-25fix(ext/node): add aes-128-ecb algorithm support (#18412)Yoshiya Hinosawa
2023-03-24feat(ext/node): implement crypto.createSecretKey (#18413)Divy Srivastava
This commit adds the `crypto.createSecretKey` API. Key management: This follows the same approach as our WebCrypto CryptoKey impl where we use WeakMap for storing key material and a handle is passed around, such that (only internal) JS can access the key material and we don't have to explicitly close a Rust resource. As a result, `createHmac` now accepts a secret KeyObject. Closes https://github.com/denoland/deno/issues/17844
2023-03-24fix(ext/node): make cipher/decipher transform stream (#18408)Yoshiya Hinosawa
2023-03-18fix(ext/node): add createDecipheriv (#18245)Yoshiya Hinosawa
2023-03-16fix(ext/node): resource leak in createHmac (#18229)Divy Srivastava
This commit fixes https://github.com/denoland/deno/issues/18140. Verified that test fails on `main`.
2023-03-14fix(ext/node): add crypto.createCipheriv (#18091)Yoshiya Hinosawa
2023-03-14chore(ext/node): copy internal/crypto/types.ts from std (#18156)Yoshiya Hinosawa