diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-07-02 14:44:14 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-07-02 15:27:12 +0200 |
commit | a5548dc2e4db5b4a5469e7b320f37f89e32bb1b3 (patch) | |
tree | 63f8035242560edea8712159b03c7a7218938cc7 /openpgp/src/crypto | |
parent | 1d30a4e19d3a812418f81b028781136cdb688492 (diff) |
openpgp: Make the crypto::hash module public, remove re-export.
Diffstat (limited to 'openpgp/src/crypto')
-rw-r--r-- | openpgp/src/crypto/hash.rs | 11 | ||||
-rw-r--r-- | openpgp/src/crypto/mod.rs | 4 | ||||
-rw-r--r-- | openpgp/src/crypto/mpis.rs | 2 |
3 files changed, 11 insertions, 6 deletions
diff --git a/openpgp/src/crypto/hash.rs b/openpgp/src/crypto/hash.rs index 693a795e..625cb5c8 100644 --- a/openpgp/src/crypto/hash.rs +++ b/openpgp/src/crypto/hash.rs @@ -37,8 +37,15 @@ impl HashAlgorithm { } } - /// Creates a new Nettle hash context for this algorith. Fails if Sequoia - /// does not support this algorithm. See `is_supported`. + /// Creates a new Nettle hash context for this algorith. + /// + /// # Errors + /// + /// Fails with `Error::UnsupportedHashAlgorithm` if Sequoia does + /// not support this algorithm. See + /// [`HashAlgorithm::is_supported`]. + /// + /// [`HashAlgorithm::is_supported`]: #method.is_supported pub fn context(self) -> Result<Box<nettle::Hash>> { use nettle::hash::*; use nettle::hash::insecure_do_not_use::Sha1; diff --git a/openpgp/src/crypto/mod.rs b/openpgp/src/crypto/mod.rs index cc1bdc18..8a37e509 100644 --- a/openpgp/src/crypto/mod.rs +++ b/openpgp/src/crypto/mod.rs @@ -12,7 +12,7 @@ use Result; pub(crate) mod aead; mod asymmetric; pub(crate) mod ecdh; -mod hash; +pub mod hash; mod keygrip; pub use self::keygrip::Keygrip; pub(crate) mod mem; @@ -27,8 +27,6 @@ pub use self::asymmetric::{ KeyPair, }; -pub use self::hash::Hash; - /// Holds a session key. /// /// The session key is cleared when dropped. diff --git a/openpgp/src/crypto/mpis.rs b/openpgp/src/crypto/mpis.rs index 5eb44f9a..117529ea 100644 --- a/openpgp/src/crypto/mpis.rs +++ b/openpgp/src/crypto/mpis.rs @@ -13,7 +13,7 @@ use constants::{ PublicKeyAlgorithm, SymmetricAlgorithm, }; -use crypto::Hash; +use crypto::hash::Hash; use crypto::mem::{secure_cmp, Protected}; use serialize::Serialize; |