Skip to content

Commit

Permalink
Bump aead dependency to v0.5 (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Aug 14, 2022
1 parent c7b7884 commit 56e3c97
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
15 changes: 13 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -21,7 +21,7 @@ opaque-debug = "0.3"
ring = { version = "0.16", default-features = false }

# optional features
aead = { version = "0.4", optional = true, default-features = false }
aead = { version = "0.5", optional = true, default-features = false }
digest = { version = "0.9", optional = true }
ecdsa = { version = "0.13", optional = true, default-features = false }
ed25519 = { version = "1.4", optional = true, default-features = false }
Expand Down
6 changes: 4 additions & 2 deletions src/aead.rs
@@ -1,6 +1,6 @@
//! Authenticated Encryption with Associated Data Algorithms: AES-GCM, ChaCha20Poly1305

pub use aead::{AeadCore, AeadInPlace, Buffer, Error, NewAead};
pub use aead::{AeadCore, AeadInPlace, Buffer, Error, KeyInit, KeySizeUser};

#[cfg(feature = "alloc")]
pub use aead::{Aead, Payload};
Expand All @@ -27,9 +27,11 @@ pub struct ChaCha20Poly1305(Cipher);

macro_rules! impl_aead {
($cipher:ty, $algorithm:expr, $key_size:ty) => {
impl NewAead for $cipher {
impl KeySizeUser for $cipher {
type KeySize = $key_size;
}

impl KeyInit for $cipher {
fn new(key: &GenericArray<u8, Self::KeySize>) -> Self {
let key = UnboundKey::new(&$algorithm, key.as_slice()).unwrap();
Self(Cipher::new(key))
Expand Down
2 changes: 1 addition & 1 deletion tests/aead/aes128gcm.rs
Expand Up @@ -3,7 +3,7 @@
use super::common::TestVector;
use hex_literal::hex;
use ring_compat::{
aead::{Aead, AeadInPlace, Aes128Gcm, NewAead, Payload},
aead::{Aead, AeadInPlace, Aes128Gcm, KeyInit, Payload},
generic_array::GenericArray,
};

Expand Down
2 changes: 1 addition & 1 deletion tests/aead/aes256gcm.rs
Expand Up @@ -3,7 +3,7 @@
use super::common::TestVector;
use hex_literal::hex;
use ring_compat::{
aead::{Aead, AeadInPlace, Aes256Gcm, NewAead, Payload},
aead::{Aead, AeadInPlace, Aes256Gcm, KeyInit, Payload},
generic_array::GenericArray,
};

Expand Down
2 changes: 1 addition & 1 deletion tests/aead/chacha20poly1305.rs
Expand Up @@ -4,7 +4,7 @@
//! <https://tools.ietf.org/html/rfc8439#section-2.8.2>

use ring_compat::{
aead::{Aead, ChaCha20Poly1305, NewAead, Payload},
aead::{Aead, ChaCha20Poly1305, KeyInit, Payload},
generic_array::GenericArray,
};

Expand Down

0 comments on commit 56e3c97

Please sign in to comment.