From bd153237fc6eb0a841f4d8b8d79f3383b7115b00 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 3 Dec 2019 13:58:24 +0100 Subject: openpgp: Rename openpgp::conversions to openpgp::fmt. --- openpgp/src/crypto/aead.rs | 2 +- openpgp/src/crypto/ecdh.rs | 2 +- openpgp/src/crypto/keygrip.rs | 6 +++--- openpgp/src/crypto/mod.rs | 2 +- openpgp/src/crypto/mpis.rs | 4 ++-- openpgp/src/crypto/s2k.rs | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) (limited to 'openpgp/src/crypto') diff --git a/openpgp/src/crypto/aead.rs b/openpgp/src/crypto/aead.rs index 50255d2f..4e16c888 100644 --- a/openpgp/src/crypto/aead.rs +++ b/openpgp/src/crypto/aead.rs @@ -9,7 +9,7 @@ use crate::types::{ AEADAlgorithm, SymmetricAlgorithm, }; -use crate::conversions::{ +use crate::fmt::{ write_be_u64, }; use crate::Error; diff --git a/openpgp/src/crypto/ecdh.rs b/openpgp/src/crypto/ecdh.rs index 9f281865..d6c21897 100644 --- a/openpgp/src/crypto/ecdh.rs +++ b/openpgp/src/crypto/ecdh.rs @@ -13,7 +13,7 @@ use crate::types::{ SymmetricAlgorithm, PublicKeyAlgorithm, }; -use crate::conversions::{ +use crate::fmt::{ write_be_u64, read_be_u64, }; diff --git a/openpgp/src/crypto/keygrip.rs b/openpgp/src/crypto/keygrip.rs index 5e79247b..adb05ed0 100644 --- a/openpgp/src/crypto/keygrip.rs +++ b/openpgp/src/crypto/keygrip.rs @@ -40,7 +40,7 @@ impl std::str::FromStr for Keygrip { impl Keygrip { /// Parses a keygrip. pub fn from_hex(hex: &str) -> Result { - let bytes = crate::conversions::from_hex(hex, true)?; + let bytes = crate::fmt::from_hex(hex, true)?; if bytes.len() != 20 { return Err(Error::InvalidArgument( format!("Expected 20 bytes, got {}", bytes.len())).into()); @@ -212,13 +212,13 @@ fn ecc_param(curve: &Curve, i: usize) -> MPI { (_, _) => unreachable!(), }; - crate::conversions::from_hex(hex, true).unwrap().into() + crate::fmt::from_hex(hex, true).unwrap().into() } #[cfg(test)] mod tests { use super::*; - use crate::conversions::from_hex; + use crate::fmt::from_hex; /// Test vectors from libgcrypt/tests/basic.c. #[test] diff --git a/openpgp/src/crypto/mod.rs b/openpgp/src/crypto/mod.rs index fd43481c..667f2d82 100644 --- a/openpgp/src/crypto/mod.rs +++ b/openpgp/src/crypto/mod.rs @@ -217,6 +217,6 @@ fn hash_file_test() { hash.digest(&mut digest); assert_eq!(*expected.get(&algo).unwrap(), - &crate::conversions::to_hex(&digest[..], false)); + &crate::fmt::to_hex(&digest[..], false)); } } diff --git a/openpgp/src/crypto/mpis.rs b/openpgp/src/crypto/mpis.rs index f3113f63..7dd731f5 100644 --- a/openpgp/src/crypto/mpis.rs +++ b/openpgp/src/crypto/mpis.rs @@ -170,7 +170,7 @@ impl fmt::Debug for MPI { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_fmt(format_args!( "{} bits: {}", self.bits(), - crate::conversions::to_hex(&*self.value, true))) + crate::fmt::to_hex(&*self.value, true))) } } @@ -264,7 +264,7 @@ impl fmt::Debug for ProtectedMPI { if cfg!(debug_assertions) { f.write_fmt(format_args!( "{} bits: {}", self.bits(), - crate::conversions::to_hex(&*self.value, true))) + crate::fmt::to_hex(&*self.value, true))) } else { f.write_str("") } diff --git a/openpgp/src/crypto/s2k.rs b/openpgp/src/crypto/s2k.rs index 2a819c47..f0614ab0 100644 --- a/openpgp/src/crypto/s2k.rs +++ b/openpgp/src/crypto/s2k.rs @@ -286,7 +286,7 @@ impl Arbitrary for S2K { mod tests { use super::*; - use crate::conversions::to_hex; + use crate::fmt::to_hex; use crate::SymmetricAlgorithm; use crate::Packet; use crate::parse::{Parse, PacketParser}; -- cgit v1.2.3