Loading openssl/src/derive.rs +3 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,9 @@ use pkey::{HasPrivate, HasPublic, PKeyRef}; /// A type used to derive a shared secret between two keys. pub struct Deriver<'a>(*mut ffi::EVP_PKEY_CTX, PhantomData<&'a ()>); unsafe impl<'a> Sync for Deriver<'a> {} unsafe impl<'a> Send for Deriver<'a> {} impl<'a> Deriver<'a> { /// Creates a new `Deriver` using the provided private key. /// Loading openssl/src/hash.rs +6 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,9 @@ impl MessageDigest { } } unsafe impl Sync for MessageDigest {} unsafe impl Send for MessageDigest {} #[derive(PartialEq, Copy, Clone)] enum State { Reset, Loading Loading @@ -99,6 +102,9 @@ pub struct Hasher { state: State, } unsafe impl Sync for Hasher {} unsafe impl Send for Hasher {} impl Hasher { /// Creates a new `Hasher` with the specified hash type. pub fn new(ty: MessageDigest) -> Result<Hasher, ErrorStack> { Loading openssl/src/sign.rs +6 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,9 @@ pub struct Signer<'a> { _p: PhantomData<&'a ()>, } unsafe impl<'a> Sync for Signer<'a> {} unsafe impl<'a> Send for Signer<'a> {} impl<'a> Drop for Signer<'a> { fn drop(&mut self) { // pkey_ctx is owned by the md_ctx, so no need to explicitly free it. Loading Loading @@ -244,6 +247,9 @@ pub struct Verifier<'a> { pkey_pd: PhantomData<&'a ()>, } unsafe impl<'a> Sync for Verifier<'a> {} unsafe impl<'a> Send for Verifier<'a> {} impl<'a> Drop for Verifier<'a> { fn drop(&mut self) { // pkey_ctx is owned by the md_ctx, so no need to explicitly free it. Loading openssl/src/symm.rs +6 −1 Original line number Diff line number Diff line Loading @@ -223,6 +223,9 @@ impl Cipher { } } unsafe impl Sync for Cipher {} unsafe impl Send for Cipher {} /// Represents a symmetric cipher context. /// /// Padding is enabled by default. Loading Loading @@ -288,6 +291,9 @@ pub struct Crypter { block_size: usize, } unsafe impl Sync for Crypter {} unsafe impl Send for Crypter {} impl Crypter { /// Creates a new `Crypter`. The initialisation vector, `iv`, is not necesarry for certain /// types of `Cipher`. Loading Loading @@ -963,7 +969,6 @@ mod tests { #[test] fn test_des_ede3_cbc() { let pt = "54686973206973206120746573742e"; let ct = "6f2867cfefda048a4046ef7e556c7132"; let key = "7cb66337f3d3c0fe7cb66337f3d3c0fe7cb66337f3d3c0fe"; Loading Loading
openssl/src/derive.rs +3 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,9 @@ use pkey::{HasPrivate, HasPublic, PKeyRef}; /// A type used to derive a shared secret between two keys. pub struct Deriver<'a>(*mut ffi::EVP_PKEY_CTX, PhantomData<&'a ()>); unsafe impl<'a> Sync for Deriver<'a> {} unsafe impl<'a> Send for Deriver<'a> {} impl<'a> Deriver<'a> { /// Creates a new `Deriver` using the provided private key. /// Loading
openssl/src/hash.rs +6 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,9 @@ impl MessageDigest { } } unsafe impl Sync for MessageDigest {} unsafe impl Send for MessageDigest {} #[derive(PartialEq, Copy, Clone)] enum State { Reset, Loading Loading @@ -99,6 +102,9 @@ pub struct Hasher { state: State, } unsafe impl Sync for Hasher {} unsafe impl Send for Hasher {} impl Hasher { /// Creates a new `Hasher` with the specified hash type. pub fn new(ty: MessageDigest) -> Result<Hasher, ErrorStack> { Loading
openssl/src/sign.rs +6 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,9 @@ pub struct Signer<'a> { _p: PhantomData<&'a ()>, } unsafe impl<'a> Sync for Signer<'a> {} unsafe impl<'a> Send for Signer<'a> {} impl<'a> Drop for Signer<'a> { fn drop(&mut self) { // pkey_ctx is owned by the md_ctx, so no need to explicitly free it. Loading Loading @@ -244,6 +247,9 @@ pub struct Verifier<'a> { pkey_pd: PhantomData<&'a ()>, } unsafe impl<'a> Sync for Verifier<'a> {} unsafe impl<'a> Send for Verifier<'a> {} impl<'a> Drop for Verifier<'a> { fn drop(&mut self) { // pkey_ctx is owned by the md_ctx, so no need to explicitly free it. Loading
openssl/src/symm.rs +6 −1 Original line number Diff line number Diff line Loading @@ -223,6 +223,9 @@ impl Cipher { } } unsafe impl Sync for Cipher {} unsafe impl Send for Cipher {} /// Represents a symmetric cipher context. /// /// Padding is enabled by default. Loading Loading @@ -288,6 +291,9 @@ pub struct Crypter { block_size: usize, } unsafe impl Sync for Crypter {} unsafe impl Send for Crypter {} impl Crypter { /// Creates a new `Crypter`. The initialisation vector, `iv`, is not necesarry for certain /// types of `Cipher`. Loading Loading @@ -963,7 +969,6 @@ mod tests { #[test] fn test_des_ede3_cbc() { let pt = "54686973206973206120746573742e"; let ct = "6f2867cfefda048a4046ef7e556c7132"; let key = "7cb66337f3d3c0fe7cb66337f3d3c0fe7cb66337f3d3c0fe"; Loading