summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-12-03 13:58:24 +0100
committerJustus Winter <justus@sequoia-pgp.org>2019-12-03 13:58:24 +0100
commitbd153237fc6eb0a841f4d8b8d79f3383b7115b00 (patch)
tree07b7e8ad7b12d68da2b86729b68a219cff3cf6e0 /openpgp/src/crypto
parent88442e46a8f5639c4493713baeb5b90f7cf6a84b (diff)
openpgp: Rename openpgp::conversions to openpgp::fmt.
Diffstat (limited to 'openpgp/src/crypto')
-rw-r--r--openpgp/src/crypto/aead.rs2
-rw-r--r--openpgp/src/crypto/ecdh.rs2
-rw-r--r--openpgp/src/crypto/keygrip.rs6
-rw-r--r--openpgp/src/crypto/mod.rs2
-rw-r--r--openpgp/src/crypto/mpis.rs4
-rw-r--r--openpgp/src/crypto/s2k.rs2
6 files changed, 9 insertions, 9 deletions
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<Self> {
- 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("<Redacted>")
}
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};