diff options
author | Azul <azul@riseup.net> | 2020-12-04 20:06:17 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2020-12-08 10:35:58 +0100 |
commit | b956d36cb50cac28aa9da0e373fb33c9a4c120af (patch) | |
tree | c20bb42230aed97494b6abe494bc8e22053f58a6 /openpgp/src/crypto/mpi.rs | |
parent | 4a971af5abe70d41485df141a3d9fa97eaab5f1c (diff) |
openpgp: Ensure public types are Send and Sync.
- See #627.
Diffstat (limited to 'openpgp/src/crypto/mpi.rs')
-rw-r--r-- | openpgp/src/crypto/mpi.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openpgp/src/crypto/mpi.rs b/openpgp/src/crypto/mpi.rs index 9eac133b..541fd3b5 100644 --- a/openpgp/src/crypto/mpi.rs +++ b/openpgp/src/crypto/mpi.rs @@ -43,6 +43,7 @@ pub struct MPI { /// Integer value as big-endian with leading zeros stripped. value: Box<[u8]>, } +assert_send_and_sync!{MPI} impl From<Vec<u8>> for MPI { fn from(v: Vec<u8>) -> Self { @@ -296,6 +297,7 @@ pub struct ProtectedMPI { /// Integer value as big-endian. value: Protected, } +assert_send_and_sync!{ProtectedMPI} impl From<Vec<u8>> for ProtectedMPI { fn from(m: Vec<u8>) -> Self { @@ -504,6 +506,7 @@ pub enum PublicKey { rest: Box<[u8]>, }, } +assert_send_and_sync!{PublicKey} impl PublicKey { /// Returns the length of the public key in bits. @@ -664,6 +667,7 @@ pub enum SecretKeyMaterial { rest: Protected, }, } +assert_send_and_sync!{SecretKeyMaterial} impl fmt::Debug for SecretKeyMaterial { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { @@ -864,6 +868,7 @@ pub enum SecretKeyChecksum { /// Sum of the decrypted secret key octets modulo 65536. Sum16, } +assert_send_and_sync!{SecretKeyChecksum} impl Default for SecretKeyChecksum { fn default() -> Self { @@ -913,6 +918,7 @@ pub enum Ciphertext { rest: Box<[u8]>, }, } +assert_send_and_sync!{Ciphertext} impl Ciphertext { /// Returns, if known, the public-key algorithm for this @@ -1023,6 +1029,7 @@ pub enum Signature { rest: Box<[u8]>, }, } +assert_send_and_sync!{Signature} impl Hash for Signature { fn hash(&self, mut hash: &mut dyn hash::Digest) { |