From bd481bf095f920a419ea55543f911e087f98f36f Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Wed, 16 Mar 2022 00:33:46 +0100 Subject: feat(ops): optional OpState (#13954) --- ext/crypto/decrypt.rs | 5 ----- ext/crypto/encrypt.rs | 5 ----- ext/crypto/export_key.rs | 2 -- ext/crypto/generate_key.rs | 5 ----- ext/crypto/import_key.rs | 2 -- ext/crypto/lib.rs | 8 -------- 6 files changed, 27 deletions(-) (limited to 'ext/crypto') diff --git a/ext/crypto/decrypt.rs b/ext/crypto/decrypt.rs index a8666de89..b3989a7f6 100644 --- a/ext/crypto/decrypt.rs +++ b/ext/crypto/decrypt.rs @@ -1,6 +1,3 @@ -use std::cell::RefCell; -use std::rc::Rc; - use crate::shared::*; use aes::BlockEncrypt; use aes::NewBlockCipher; @@ -25,7 +22,6 @@ use deno_core::error::custom_error; use deno_core::error::type_error; use deno_core::error::AnyError; use deno_core::op; -use deno_core::OpState; use deno_core::ZeroCopyBuf; use rsa::pkcs1::FromRsaPrivateKey; use rsa::PaddingScheme; @@ -79,7 +75,6 @@ pub enum DecryptAlgorithm { #[op] pub async fn op_crypto_decrypt( - _state: Rc>, opts: DecryptOptions, data: ZeroCopyBuf, ) -> Result { diff --git a/ext/crypto/encrypt.rs b/ext/crypto/encrypt.rs index b93ca0952..9d0dd3565 100644 --- a/ext/crypto/encrypt.rs +++ b/ext/crypto/encrypt.rs @@ -1,6 +1,3 @@ -use std::cell::RefCell; -use std::rc::Rc; - use crate::shared::*; use aes::cipher::NewCipher; @@ -27,7 +24,6 @@ use ctr::flavors::Ctr64BE; use ctr::flavors::CtrFlavor; use deno_core::error::type_error; use deno_core::error::AnyError; -use deno_core::OpState; use deno_core::ZeroCopyBuf; use rand::rngs::OsRng; use rsa::pkcs1::FromRsaPublicKey; @@ -83,7 +79,6 @@ pub enum EncryptAlgorithm { #[op] pub async fn op_crypto_encrypt( - _state: Rc>, opts: EncryptOptions, data: ZeroCopyBuf, ) -> Result { diff --git a/ext/crypto/export_key.rs b/ext/crypto/export_key.rs index 8131f859d..64d2d1079 100644 --- a/ext/crypto/export_key.rs +++ b/ext/crypto/export_key.rs @@ -1,7 +1,6 @@ use deno_core::error::custom_error; use deno_core::error::AnyError; use deno_core::op; -use deno_core::OpState; use deno_core::ZeroCopyBuf; use rsa::pkcs1::UIntBytes; use serde::Deserialize; @@ -87,7 +86,6 @@ pub enum ExportKeyResult { #[op] pub fn op_crypto_export_key( - _state: &mut OpState, opts: ExportKeyOptions, key_data: RawKeyData, ) -> Result { diff --git a/ext/crypto/generate_key.rs b/ext/crypto/generate_key.rs index 22f0913ec..99f9fac62 100644 --- a/ext/crypto/generate_key.rs +++ b/ext/crypto/generate_key.rs @@ -1,10 +1,6 @@ -use std::cell::RefCell; -use std::rc::Rc; - use crate::shared::*; use deno_core::error::AnyError; use deno_core::op; -use deno_core::OpState; use deno_core::ZeroCopyBuf; use elliptic_curve::rand_core::OsRng; use num_traits::FromPrimitive; @@ -44,7 +40,6 @@ pub enum GenerateKeyOptions { #[op] pub async fn op_crypto_generate_key( - _state: Rc>, opts: GenerateKeyOptions, ) -> Result { let fun = || match opts { diff --git a/ext/crypto/import_key.rs b/ext/crypto/import_key.rs index 3d29c9947..9b8a9aa5c 100644 --- a/ext/crypto/import_key.rs +++ b/ext/crypto/import_key.rs @@ -1,6 +1,5 @@ use deno_core::error::AnyError; use deno_core::op; -use deno_core::OpState; use deno_core::ZeroCopyBuf; use elliptic_curve::pkcs8::der::Decodable as Pkcs8Decodable; use elliptic_curve::pkcs8::PrivateKeyInfo; @@ -90,7 +89,6 @@ pub enum ImportKeyResult { #[op] pub fn op_crypto_import_key( - _state: &mut OpState, opts: ImportKeyOptions, key_data: KeyData, ) -> Result { diff --git a/ext/crypto/lib.rs b/ext/crypto/lib.rs index e45e3d272..a2dc8e626 100644 --- a/ext/crypto/lib.rs +++ b/ext/crypto/lib.rs @@ -17,9 +17,7 @@ use deno_core::ZeroCopyBuf; use serde::Deserialize; use shared::operation_error; -use std::cell::RefCell; use std::num::NonZeroU32; -use std::rc::Rc; use p256::elliptic_curve::sec1::FromEncodedPoint; use p256::pkcs8::FromPrivateKey; @@ -169,7 +167,6 @@ pub struct SignArg { #[op] pub async fn op_crypto_sign_key( - _state: Rc>, args: SignArg, zero_copy: ZeroCopyBuf, ) -> Result { @@ -324,7 +321,6 @@ pub struct VerifyArg { #[op] pub async fn op_crypto_verify_key( - _state: Rc>, args: VerifyArg, zero_copy: ZeroCopyBuf, ) -> Result { @@ -485,7 +481,6 @@ pub struct DeriveKeyArg { #[op] pub async fn op_crypto_derive_bits( - _state: Rc>, args: DeriveKeyArg, zero_copy: Option, ) -> Result { @@ -807,7 +802,6 @@ pub fn op_crypto_random_uuid(state: &mut OpState) -> Result { #[op] pub async fn op_crypto_subtle_digest( - _state: Rc>, algorithm: CryptoHash, data: ZeroCopyBuf, ) -> Result { @@ -831,7 +825,6 @@ pub struct WrapUnwrapKeyArg { #[op] pub fn op_crypto_wrap_key( - _state: &mut OpState, args: WrapUnwrapKeyArg, data: ZeroCopyBuf, ) -> Result { @@ -861,7 +854,6 @@ pub fn op_crypto_wrap_key( #[op] pub fn op_crypto_unwrap_key( - _state: &mut OpState, args: WrapUnwrapKeyArg, data: ZeroCopyBuf, ) -> Result { -- cgit v1.2.3