Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 39 additions & 39 deletions Cargo.lock

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

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@ members = [
[patch.crates-io]
aead-stream = { path = "aead-stream" }
aes-gcm = { path = "aes-gcm" }

# https://github.com/RustCrypto/traits/pull/2019
aead = { git = "https://github.com/RustCrypto/traits.git" }
crypto-common = { git = "https://github.com/RustCrypto/traits.git" }
2 changes: 1 addition & 1 deletion aead-stream/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.2", default-features = false }
aead = { version = "0.6.0-rc.3", default-features = false }

[features]
alloc = ["aead/alloc"]
16 changes: 8 additions & 8 deletions aes-gcm-siv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.2", default-features = false }
aes = { version = "0.9.0-rc.1", optional = true }
cipher = "0.5.0-rc.1"
ctr = "0.10.0-rc.1"
polyval = { version = "0.7.0-rc.2", default-features = false }
aead = { version = "0.6.0-rc.3", default-features = false }
aes = { version = "0.9.0-rc.2", optional = true }
cipher = "0.5.0-rc.2"
ctr = "0.10.0-rc.2"
polyval = { version = "0.7.0-rc.3", default-features = false }
subtle = { version = "2", default-features = false }
zeroize = { version = "1", optional = true, default-features = false }

[dev-dependencies]
aead = { version = "0.6.0-rc.2", features = ["dev"], default-features = false }
aead = { version = "0.6.0-rc.3", features = ["dev"], default-features = false }

[features]
default = ["aes", "alloc", "os_rng"]
default = ["aes", "alloc", "getrandom"]
alloc = ["aead/alloc"]
arrayvec = ["aead/arrayvec"]
bytes = ["aead/bytes"]
os_rng = ["aead/os_rng", "rand_core"]
getrandom = ["aead/getrandom"]
rand_core = ["aead/rand_core"]

[package.metadata.docs.rs]
Expand Down
29 changes: 17 additions & 12 deletions aes-gcm-siv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@
//!
//! Simple usage (allocating, no associated data):
//!
#![cfg_attr(feature = "os_rng", doc = "```")]
#![cfg_attr(not(feature = "os_rng"), doc = "```ignore")]
#![cfg_attr(feature = "getrandom", doc = "```")]
#![cfg_attr(not(feature = "getrandom"), doc = "```ignore")]
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! use aes_gcm_siv::{
//! aead::{Aead, AeadCore, KeyInit, rand_core::OsRng},
//! aead::{Aead, AeadCore, KeyInit},
//! Aes256GcmSiv, Nonce // Or `Aes128GcmSiv`
//! };
//!
//! let key = Aes256GcmSiv::generate_key().expect("generate key");
//! let key = Aes256GcmSiv::generate_key().expect("key generation failure");
//! let cipher = Aes256GcmSiv::new(&key);
//! let nonce = Aes256GcmSiv::generate_nonce().expect("generate nonce"); // 96-bits; unique per message
//!
//! let nonce = Aes256GcmSiv::generate_nonce().expect("nonce failure"); // MUST be unique per message
//! let ciphertext = cipher.encrypt(&nonce, b"plaintext message".as_ref())?;
//!
//! let plaintext = cipher.decrypt(&nonce, ciphertext.as_ref())?;
//! assert_eq!(&plaintext, b"plaintext message");
//! # Ok(())
Expand All @@ -47,29 +49,32 @@
//! It can then be passed as the `buffer` parameter to the in-place encrypt
//! and decrypt methods:
//!
#![cfg_attr(all(feature = "os_rng", feature = "arrayvec"), doc = "```")]
#![cfg_attr(not(all(feature = "os_rng", feature = "arrayvec")), doc = "```ignore")]
#![cfg_attr(all(feature = "getrandom", feature = "arrayvec"), doc = "```")]
#![cfg_attr(
not(all(feature = "getrandom", feature = "arrayvec")),
doc = "```ignore"
)]
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! use aes_gcm_siv::{
//! aead::{AeadInOut, Buffer, KeyInit, rand_core::OsRng, arrayvec::ArrayVec},
//! aead::{AeadInOut, AeadCore, Buffer, KeyInit, arrayvec::ArrayVec},
//! Aes256GcmSiv, Nonce, // Or `Aes128GcmSiv`
//! };
//!
//! let key = Aes256GcmSiv::generate_key().expect("generate key");
//! let key = Aes256GcmSiv::generate_key().expect("key generation failure");
//! let cipher = Aes256GcmSiv::new(&key);
//! let nonce = Nonce::from_slice(b"unique nonce"); // 96-bits; unique per message
//!
//! let nonce = Aes256GcmSiv::generate_nonce().expect("nonce failure"); // 96-bits; unique per message
//! let mut buffer: ArrayVec<u8, 128> = ArrayVec::new(); // Note: buffer needs 16-bytes overhead for auth tag
//! buffer.extend_from_slice(b"plaintext message");
//!
//! // Encrypt `buffer` in-place, replacing the plaintext contents with ciphertext
//! cipher.encrypt_in_place(nonce, b"", &mut buffer)?;
//! cipher.encrypt_in_place(&nonce, b"", &mut buffer)?;
//!
//! // `buffer` now contains the message ciphertext
//! assert_ne!(buffer.as_ref(), b"plaintext message");
//!
//! // Decrypt `buffer` in-place, replacing its ciphertext context with the original plaintext
//! cipher.decrypt_in_place(nonce, b"", &mut buffer)?;
//! cipher.decrypt_in_place(&nonce, b"", &mut buffer)?;
//! assert_eq!(buffer.as_ref(), b"plaintext message");
//! # Ok(())
//! # }
Expand Down
19 changes: 11 additions & 8 deletions aes-gcm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,27 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.2", default-features = false }
aes = { version = "0.9.0-rc.1", optional = true }
cipher = "0.5.0-rc.1"
ctr = "0.10.0-rc.1"
ghash = { version = "0.6.0-rc.2", default-features = false }
aead = { version = "0.6.0-rc.3", default-features = false }
cipher = "0.5.0-rc.2"
ctr = "0.10.0-rc.2"
ghash = { version = "0.6.0-rc.3", default-features = false }
subtle = { version = "2", default-features = false }

# optional dependencies
aes = { version = "0.9.0-rc.2", optional = true }
zeroize = { version = "1", optional = true, default-features = false }

[dev-dependencies]
aead = { version = "0.6.0-rc.2", features = ["alloc", "dev"], default-features = false }
aead = { version = "0.6.0-rc.3", features = ["alloc", "dev"], default-features = false }
hex-literal = "1"

[features]
default = ["aes", "alloc", "os_rng"]
default = ["aes", "alloc", "getrandom"]
alloc = ["aead/alloc"]

arrayvec = ["aead/arrayvec"]
bytes = ["aead/bytes"]
os_rng = ["aead/os_rng", "rand_core"]
getrandom = ["aead/getrandom"]
rand_core = ["aead/rand_core"]

[package.metadata.docs.rs]
Expand Down
Loading