summaryrefslogtreecommitdiff
path: root/ext/crypto/lib.rs
AgeCommit message (Collapse)Author
2024-10-18refactor(ext/crypto): use concrete error types (#26167)Leo Kettmeir
2024-10-17refactor(ext/web): use concrete error types (#26185)Leo Kettmeir
2024-10-07feat(ext/crypto): X448 support (#26043)Divy Srivastava
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-07-12perf(ext/crypto): make randomUUID() 5x faster (#24510)Satya Rohith
2024-03-11chore: enable clippy unused_async rule (#22834)David Sherret
2024-01-01chore: update to Rust 1.75 (#21731)林炳权
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-10-30chore: upgrade rsa to 0.9 (#21016)Divy Srivastava
2023-10-27chore(ext/crypto): upgrade to ring 0.17 (#20824)Divy Srivastava
Ref https://github.com/denoland/deno/issues/18071
2023-10-26chore: update base64 crate (#20877)Luca Casonato
2023-09-21refactor: rewrite some ops to op2 macro (#20603)Bartek Iwańczuk
2023-09-13refactor: rewrite ext/crypto to op2 (#20477)Bartek Iwańczuk
2023-08-23fix(ext/web): add stream tests to detect v8slice split bug (#20253)Matt Mastracci
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-22refactor(serde_v8): split ZeroCopyBuf into JsBuffer and ToJsBuffer (#19566)Bartek Iwańczuk
`ZeroCopyBuf` was convenient to use, but sometimes it did hide details that some copies were necessary in certain cases. Also it made it way to easy for the caller to pass around and convert into different values. This commit splits `ZeroCopyBuf` into `JsBuffer` (an array buffer coming from V8) and `ToJsBuffer` (a Rust buffer that will be converted into a V8 array buffer). As a result some magical conversions were removed (they were never used) limiting the API surface and preparing for changes in #19534.
2023-06-05fix(ext/crypto): fix JWK import of Ed25519 (#19279)Levente Kurusa
Fixes: #18049 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-14refactor(core): bake single-thread assumptions into spawn/spawn_blocking ↵Matt Mastracci
(#19056) Partially supersedes #19016. This migrates `spawn` and `spawn_blocking` to `deno_core`, and removes the requirement for `spawn` tasks to be `Send` given our single-threaded executor. While we don't need to technically do anything w/`spawn_blocking`, this allows us to have a single `JoinHandle` type that works for both cases, and allows us to more easily experiment with alternative `spawn_blocking` implementations that do not require tokio (ie: rayon). Async ops (+~35%): Before: ``` time 1310 ms rate 763358 time 1267 ms rate 789265 time 1259 ms rate 794281 time 1266 ms rate 789889 ``` After: ``` time 956 ms rate 1046025 time 954 ms rate 1048218 time 924 ms rate 1082251 time 920 ms rate 1086956 ``` HTTP serve (+~4.4%): Before: ``` Running 10s test @ http://localhost:4500 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 68.78us 19.77us 1.43ms 86.84% Req/Sec 68.78k 5.00k 73.84k 91.58% 1381833 requests in 10.10s, 167.36MB read Requests/sec: 136823.29 Transfer/sec: 16.57MB ``` After: ``` Running 10s test @ http://localhost:4500 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 63.12us 17.43us 1.11ms 85.13% Req/Sec 71.82k 3.71k 77.02k 79.21% 1443195 requests in 10.10s, 174.79MB read Requests/sec: 142921.99 Transfer/sec: 17.31MB ``` Suggested-By: alice@ryhl.io Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-09fix(core): let V8 drive extension ESM loads (#18997)Luca Casonato
This now allows circular imports across extensions. Instead of load + eval of all ESM files in declaration order, all files are only loaded. Eval is done recursively by V8, only evaluating files that are listed in `Extension::esm_entry_point` fields. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-08refactor: prefix ops w/ crate they are defined in (#19044)Luca Casonato
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-17perf(core) Reduce copying and cloning in extension initialization (#18252)Matt Mastracci
Follow-up to #18210: * we are passing the generated `cfg` object into the state function rather than passing individual config fields * reduce cloning dramatically by making the state_fn `FnOnce` * `take` for `ExtensionBuilder` to avoid more unnecessary copies * renamed `config` to `options`
2023-03-17feat(core) deno_core::extension! macro to simplify extension registration ↵Matt Mastracci
(#18210) This implements two macros to simplify extension registration and centralize a lot of the boilerplate as a base for future improvements: * `deno_core::ops!` registers a block of `#[op]`s, optionally with type parameters, useful for places where we share lists of ops * `deno_core::extension!` is used to register an extension, and creates two methods that can be used at runtime/snapshot generation time: `init_ops` and `init_ops_and_esm`. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-09refactor: Split extension registration for runtime and snapshotting (#18095)Bartek Iwańczuk
This commit splits "<ext_name>::init" functions into "init_ops" and "init_ops_and_esm". That way we don't have to construct list of ESM sources on each startup if we're running with a snapshot. In a follow up commit "deno_core" will be changed to not have a split between "extensions" and "extensions_with_js" - it will be embedders' responsibility to pass appropriately configured extensions. Prerequisite for https://github.com/denoland/deno/pull/18080
2023-03-09refactor(core): Extension::builder_with_deps (#18093)Bartek Iwańczuk
Prerequisite for https://github.com/denoland/deno/pull/18080
2023-03-07refactor(core): don't use Result in ExtensionBuilder::state (#18066)Bartek Iwańczuk
There's no point for this API to expect result. If something fails it should result in a panic during build time to signal to embedder that setup is wrong.
2023-02-07 refactor: remove prefix from include_js_files & use extension name (#17683)Leo Kettmeir
2023-02-07refactor: Use ES modules for internal runtime code (#17648)Leo Kettmeir
This PR refactors all internal js files (except core) to be written as ES modules. `__bootstrap`has been mostly replaced with static imports in form in `internal:[path to file from repo root]`. To specify if files are ESM, an `esm` method has been added to `Extension`, similar to the `js` method. A new ModuleLoader called `InternalModuleLoader` has been added to enable the loading of internal specifiers, which is used in all situations except when a snapshot is only loaded, and not a new one is created from it. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-02-05 refactor: rename `deno` specifiers to `internal` (#17655)Leo Kettmeir
2023-01-18chore(ext/crypto): Update rsa to 0.7.0 (#16327)Kyle Willmon
Bump the rsa crate to 0.7.0 The API for the `rsa` crate has changed significantly, but I have verified that tests continue to pass throughout this update.
2023-01-08feat(core): allow specifying name and dependencies of an Extension (#17301)Leo Kettmeir
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-11-18chore: use Rust 1.65.0 (#16688)Aaron O'Mullan
2022-10-09perf(ext/crypto): optimize `getRandomValues` (#16212)Divy Srivastava
2022-10-04fix(ext/crypto): interoperable import/export (#16153)Filip Skokan
This PR updates RSA key import/export to a state which is interoperable with other implementations. For RSA the only OID in and out is `rsaEncryption`. For EC the only OID in and out is `id-ecpublickey` (fixed in #16152). see https://github.com/w3c/webcrypto/issues/307#issuecomment-995813032 see https://github.com/w3c/webcrypto/issues/307 see https://github.com/w3c/webcrypto/pull/305 see https://github.com/nodejs/node/pull/42816
2022-10-03fix(ext/crypto): curve25519 import export (#16140)Filip Skokan
2022-09-27feat(ext/crypto): add x25519 and Ed25519 CFRG curves (#14119)Divy Srivastava
2022-07-23feat(ext/crypto): deriveBits P-384 (#15138)diachedelic
This commit adds P-384 curve support for crypto.subtle.deriveBits. Co-authored-by: James Diacono <james@diacono.com.au>
2022-06-20chore(ext/crypto): update webcrypto deps (#14452)Divy Srivastava
2022-05-05chore: update deps (#14416)Luca Casonato
2022-03-17fix: cargo publish fails without absolute paths (#13993)Ryan Dahl
This reverts commit 4e3ed37037a2aa1edeac260dc3463a81d9cf9b88. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-03-16feat(ops): optional OpState (#13954)Aaron O'Mullan
2022-03-14feat(ops): custom arity (#13949)Aaron O'Mullan
Also cleanup & drop ignored wildcard op-args
2022-03-14feat(core): codegen ops (#13861)Divy Srivastava
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2022-03-14chore: improve build times for `ext/` changes (#13927)Divy Srivastava
2022-01-19feat(ext/crypto): implement pkcs8/spki/jwk exportKey for ECDSA and ECDH (#13104)Sean Michael Wykes
2022-01-11feat(ext/crypto): implement AES-KW for wrapKey/unwrapKey (#13286)Sean Michael Wykes
2022-01-07chore: update copyright to 2022 (#13306)Ryan Dahl
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2021-12-20refactor(ext/crypto): cleanup decrypt code (#13120)Divy Srivastava
2021-12-18refactor: use `once_cell` instead of `lazy_static` (#13135)Divy Srivastava
2021-12-16feat(ext/crypto): support importing ECSDA and ECDH (#13088)Sean Michael Wykes
Co-authored-by: Luca Casonato <hello@lcas.dev>
2021-12-15refactor(ext/crypto): clean up encrypt rust code (#13094)Luca Casonato
2021-12-13refactor(ext/crypto): generateKey rust cleanup (#13069)Luca Casonato