summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/s2k.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-07-09 12:51:10 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-07-15 12:47:53 +0200
commit775f0c039349335df880d35db7df6c131419f0eb (patch)
tree2d16928f3a629b7afae95cf1b9d518c5603a9f93 /openpgp/src/crypto/s2k.rs
parentcaec575e3c44e6045e29aa452ad31f91d04ec139 (diff)
Prepare for Rust 2018.
- This is the result of running `cargo fix --edition`, with some manual adjustments. - The vast majority of changes merely qualify module paths with 'crate::'. - Two instances of adding an anonymous pattern to a trait's function. - `async` is a keyword in Rust 2018, and hence it needs to be escaped (e.g. in the case of the net::r#async module). - The manual adjustments were needed due to various shortcomings of the analysis employed by `cargo fix`, e.g. unexpanded macros, procedural macros, lalrpop grammars.
Diffstat (limited to 'openpgp/src/crypto/s2k.rs')
-rw-r--r--openpgp/src/crypto/s2k.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/openpgp/src/crypto/s2k.rs b/openpgp/src/crypto/s2k.rs
index b2b95f68..72b790e5 100644
--- a/openpgp/src/crypto/s2k.rs
+++ b/openpgp/src/crypto/s2k.rs
@@ -6,11 +6,11 @@
//!
//! [Section 3.7 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-3.7
-use Error;
-use Result;
-use HashAlgorithm;
-use crypto::Password;
-use crypto::SessionKey;
+use crate::Error;
+use crate::Result;
+use crate::HashAlgorithm;
+use crate::crypto::Password;
+use crate::crypto::SessionKey;
use std::fmt;
@@ -56,7 +56,7 @@ pub enum S2K {
impl Default for S2K {
fn default() -> Self {
let mut salt = [0u8; 8];
- ::crypto::random(&mut salt);
+ crate::crypto::random(&mut salt);
S2K::Iterated {
// SHA2-256, being optimized for implementations on
// architectures with a word size of 32 bit, has a more
@@ -286,15 +286,15 @@ impl Arbitrary for S2K {
mod tests {
use super::*;
- use conversions::to_hex;
- use SymmetricAlgorithm;
- use Packet;
- use parse::{Parse, PacketParser};
- use serialize::Serialize;
+ use crate::conversions::to_hex;
+ use crate::SymmetricAlgorithm;
+ use crate::Packet;
+ use crate::parse::{Parse, PacketParser};
+ use crate::serialize::Serialize;
#[test]
fn s2k_parser_test() {
- use packet::SKESK;
+ use crate::packet::SKESK;
struct Test<'a> {
filename: &'a str,
@@ -396,7 +396,7 @@ mod tests {
];
for test in tests.iter() {
- let path = ::tests::message(&format!("s2k/{}", test.filename));
+ let path = crate::tests::message(&format!("s2k/{}", test.filename));
let mut pp = PacketParser::from_bytes(path).unwrap().unwrap();
if let Packet::SKESK(SKESK::V4(ref skesk)) = pp.packet {
assert_eq!(skesk.symmetric_algo(), test.cipher_algo);
@@ -423,7 +423,7 @@ mod tests {
quickcheck! {
fn s2k_roundtrip(s2k: S2K) -> bool {
- use serialize::SerializeInto;
+ use crate::serialize::SerializeInto;
eprintln!("in {:?}", s2k);
use std::io::Cursor;