diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-08-11 13:54:42 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-08-11 14:32:13 +0200 |
commit | 219c0008a028167430025ca669bbcc89fb17eff6 (patch) | |
tree | 37195f319b590105bcf8f5bc3b9e07ec463f0283 /openpgp | |
parent | be3f737fcf90c3a06fbb46f6c16c7acdba2b577e (diff) |
openpgp: Make S2K helper methods private.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/crypto/s2k.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openpgp/src/crypto/s2k.rs b/openpgp/src/crypto/s2k.rs index 11aa0435..09a6a178 100644 --- a/openpgp/src/crypto/s2k.rs +++ b/openpgp/src/crypto/s2k.rs @@ -199,7 +199,7 @@ impl S2K { /// The returned value is larger or equal `hash_bytes`, or /// `0x3e00000` if `hash_bytes` is larger than or equal /// `0x3e00000`. - pub fn nearest_hash_count(hash_bytes: usize) -> u32 { + fn nearest_hash_count(hash_bytes: usize) -> u32 { use std::usize; match hash_bytes { @@ -218,7 +218,7 @@ impl S2K { } /// Decodes the OpenPGP encoding of the number of bytes to hash. - pub fn decode_count(coded: u8) -> u32 { + pub(crate) fn decode_count(coded: u8) -> u32 { use std::cmp; let mantissa = 16 + (coded as u32 & 15); @@ -235,7 +235,7 @@ impl S2K { /// encoded. See also [`S2K::nearest_hash_count()`]. /// /// [`S2K::nearest_hash_count()`]: #method.nearest_hash_count - pub fn encode_count(hash_bytes: u32) -> Result<u8> { + pub(crate) fn encode_count(hash_bytes: u32) -> Result<u8> { // eeee.mmmm -> (16 + mmmm) * 2^(6 + e) let msb = 32 - hash_bytes.leading_zeros(); |