summaryrefslogtreecommitdiff
path: root/ext/crypto/decrypt.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-09-13 17:54:19 +0200
committerGitHub <noreply@github.com>2023-09-13 17:54:19 +0200
commit109a42ab0728d4e3e2429fd090eb2f432a6fc9f5 (patch)
tree5a777a0eb166b7eeda32e635e5651751670a6c08 /ext/crypto/decrypt.rs
parent8f0270c0cf7ed28943686325b8d329bcd2f497b2 (diff)
refactor: rewrite ext/crypto to op2 (#20477)
Diffstat (limited to 'ext/crypto/decrypt.rs')
-rw-r--r--ext/crypto/decrypt.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/crypto/decrypt.rs b/ext/crypto/decrypt.rs
index 07b2e3e67..551f33972 100644
--- a/ext/crypto/decrypt.rs
+++ b/ext/crypto/decrypt.rs
@@ -19,7 +19,7 @@ use ctr::Ctr64BE;
use deno_core::error::custom_error;
use deno_core::error::type_error;
use deno_core::error::AnyError;
-use deno_core::op;
+use deno_core::op2;
use deno_core::unsync::spawn_blocking;
use deno_core::JsBuffer;
use deno_core::ToJsBuffer;
@@ -75,10 +75,11 @@ pub enum DecryptAlgorithm {
},
}
-#[op]
+#[op2(async)]
+#[serde]
pub async fn op_crypto_decrypt(
- opts: DecryptOptions,
- data: JsBuffer,
+ #[serde] opts: DecryptOptions,
+ #[buffer] data: JsBuffer,
) -> Result<ToJsBuffer, AnyError> {
let key = opts.key;
let fun = move || match opts.algorithm {