Use re-exported aead and generic-array dependencies

This drops them as direct dependencies, and ensures we are using the
correct versions of them.
This commit is contained in:
Jack Grigg 2019-12-28 15:52:40 -06:00
parent 6e35cff353
commit 63a1eba118
No known key found for this signature in database
GPG key ID: 9E8255172BBF9898
5 changed files with 11 additions and 12 deletions

2
Cargo.lock generated
View file

@ -48,7 +48,6 @@ dependencies = [
name = "age"
version = "0.1.0"
dependencies = [
"aead 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bech32 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -64,7 +63,6 @@ dependencies = [
"dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"fuse_mt 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
"getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"gumdrop 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hkdf 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -24,9 +24,7 @@ maintenance = { status = "experimental" }
base64 = "0.10"
# - ChaCha20-Poly1305 from RFC 7539
aead = "0.1"
chacha20poly1305 = "0.1"
generic-array = "0.12"
# - X25519 from RFC 7748
x25519-dalek = "0.6"

View file

@ -44,8 +44,8 @@ impl fmt::Display for Error {
}
}
impl From<aead::Error> for Error {
fn from(_: aead::Error) -> Self {
impl From<chacha20poly1305::aead::Error> for Error {
fn from(_: chacha20poly1305::aead::Error) -> Self {
Error::DecryptionFailed
}
}

View file

@ -1,11 +1,12 @@
//! Primitive cryptographic operations used by `age`.
use aead::{Aead, NewAead};
use chacha20poly1305::ChaCha20Poly1305;
use generic_array::typenum::U32;
use chacha20poly1305::{
aead::{self, Aead, NewAead},
ChaCha20Poly1305,
};
use hkdf::Hkdf;
use hmac::{
crypto_mac::{MacError, MacResult},
crypto_mac::{generic_array::typenum::U32, MacError, MacResult},
Hmac, Mac,
};
use scrypt::{errors::InvalidParams, scrypt as scrypt_inner, ScryptParams};

View file

@ -2,8 +2,10 @@
//!
//! [STREAM]: https://eprint.iacr.org/2015/189.pdf
use aead::{Aead, NewAead};
use chacha20poly1305::ChaCha20Poly1305;
use chacha20poly1305::{
aead::{Aead, NewAead},
ChaCha20Poly1305,
};
use std::io::{self, Read, Seek, SeekFrom, Write};
use super::armor::ArmoredWriter;