From 219c0008a028167430025ca669bbcc89fb17eff6 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 11 Aug 2020 13:54:42 +0200 Subject: openpgp: Make S2K helper methods private. --- openpgp/src/crypto/s2k.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'openpgp/src/crypto/s2k.rs') 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 { + pub(crate) fn encode_count(hash_bytes: u32) -> Result { // eeee.mmmm -> (16 + mmmm) * 2^(6 + e) let msb = 32 - hash_bytes.leading_zeros(); -- cgit v1.2.3