Loading openssl/src/cipher_ctx.rs +5 −6 Original line number Original line Diff line number Diff line Loading @@ -102,18 +102,17 @@ impl CipherCtx { Ok(CipherCtx::from_ptr(ptr)) Ok(CipherCtx::from_ptr(ptr)) } } } } } impl CipherCtxRef { #[corresponds(EVP_CIPHER_CTX_copy)] #[corresponds(EVP_CIPHER_CTX_copy)] pub fn clone(&self) -> Result<Self, ErrorStack> { pub fn copy(&mut self, src: &CipherCtx) -> Result<(), ErrorStack> { let n = CipherCtx::new()?; unsafe { unsafe { cvt(ffi::EVP_CIPHER_CTX_copy(n.as_ptr(), self.as_ptr()))?; cvt(ffi::EVP_CIPHER_CTX_copy(self.as_ptr(), src.as_ptr()))?; } Ok(()) Ok(n) } } } } impl CipherCtxRef { /// Initializes the context for encryption. /// Initializes the context for encryption. /// /// /// Normally this is called once to set all of the cipher, key, and IV. However, this process can be split up /// Normally this is called once to set all of the cipher, key, and IV. However, this process can be split up Loading Loading
openssl/src/cipher_ctx.rs +5 −6 Original line number Original line Diff line number Diff line Loading @@ -102,18 +102,17 @@ impl CipherCtx { Ok(CipherCtx::from_ptr(ptr)) Ok(CipherCtx::from_ptr(ptr)) } } } } } impl CipherCtxRef { #[corresponds(EVP_CIPHER_CTX_copy)] #[corresponds(EVP_CIPHER_CTX_copy)] pub fn clone(&self) -> Result<Self, ErrorStack> { pub fn copy(&mut self, src: &CipherCtx) -> Result<(), ErrorStack> { let n = CipherCtx::new()?; unsafe { unsafe { cvt(ffi::EVP_CIPHER_CTX_copy(n.as_ptr(), self.as_ptr()))?; cvt(ffi::EVP_CIPHER_CTX_copy(self.as_ptr(), src.as_ptr()))?; } Ok(()) Ok(n) } } } } impl CipherCtxRef { /// Initializes the context for encryption. /// Initializes the context for encryption. /// /// /// Normally this is called once to set all of the cipher, key, and IV. However, this process can be split up /// Normally this is called once to set all of the cipher, key, and IV. However, this process can be split up Loading