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
12 changes: 6 additions & 6 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 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.3", default-features = false }
aead = { version = "0.6.0-rc.4", default-features = false }

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

[dependencies]
aead = { version = "0.6.0-rc.3", default-features = false }
aead = { version = "0.6.0-rc.4", default-features = false }
aes = { version = "0.9.0-rc.2", optional = true }
cipher = "0.5.0-rc.2"
ctr = "0.10.0-rc.2"
Expand All @@ -26,7 +26,7 @@ subtle = { version = "2", default-features = false }
zeroize = { version = "1", optional = true, default-features = false }

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

[features]
default = ["aes", "alloc", "getrandom"]
Expand Down
20 changes: 12 additions & 8 deletions aes-gcm-siv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@
//!
#![cfg_attr(feature = "getrandom", doc = "```")]
#![cfg_attr(not(feature = "getrandom"), doc = "```ignore")]
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! # fn main() -> Result<(), Box<dyn core::error::Error>> {
//! // NOTE: requires the `getrandom` feature is enabled
//!
//! use aes_gcm_siv::{
//! aead::{Aead, AeadCore, KeyInit},
//! aead::{Aead, AeadCore, Generate, Key, KeyInit},
//! Aes256GcmSiv, Nonce // Or `Aes128GcmSiv`
//! };
//!
//! let key = Aes256GcmSiv::generate_key().expect("key generation failure");
//! let key = Key::<Aes256GcmSiv>::generate();
//! let cipher = Aes256GcmSiv::new(&key);
//!
//! let nonce = Aes256GcmSiv::generate_nonce().expect("nonce failure"); // MUST be unique per message
//! let nonce = Nonce::generate(); // MUST be unique per message
//! let ciphertext = cipher.encrypt(&nonce, b"plaintext message".as_ref())?;
//!
//! let plaintext = cipher.decrypt(&nonce, ciphertext.as_ref())?;
Expand Down Expand Up @@ -54,16 +56,18 @@
not(all(feature = "getrandom", feature = "arrayvec")),
doc = "```ignore"
)]
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! # fn main() -> Result<(), Box<dyn core::error::Error>> {
//! // NOTE: requires the `arrayvec` and `getrandom` features are enabled
//!
//! use aes_gcm_siv::{
//! aead::{AeadInOut, AeadCore, Buffer, KeyInit, arrayvec::ArrayVec},
//! aead::{AeadInOut, AeadCore, Buffer, Generate, Key, KeyInit, arrayvec::ArrayVec},
//! Aes256GcmSiv, Nonce, // Or `Aes128GcmSiv`
//! };
//!
//! let key = Aes256GcmSiv::generate_key().expect("key generation failure");
//! let key = Key::<Aes256GcmSiv>::generate();
//! let cipher = Aes256GcmSiv::new(&key);
//!
//! let nonce = Aes256GcmSiv::generate_nonce().expect("nonce failure"); // 96-bits; unique per message
//! let nonce = Nonce::generate(); // 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");
//!
Expand Down
4 changes: 2 additions & 2 deletions aes-gcm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.3", default-features = false }
aead = { version = "0.6.0-rc.4", 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 }
Expand All @@ -28,7 +28,7 @@ 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.3", features = ["alloc", "dev"], default-features = false }
aead = { version = "0.6.0-rc.4", features = ["alloc", "dev"], default-features = false }
hex-literal = "1"

[features]
Expand Down
18 changes: 11 additions & 7 deletions aes-gcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
#![cfg_attr(feature = "getrandom", doc = "```")]
#![cfg_attr(not(feature = "getrandom"), doc = "```ignore")]
//! # fn main() -> Result<(), Box<dyn core::error::Error>> {
//! // NOTE: requires the `getrandom` feature is enabled
//!
//! use aes_gcm::{
//! aead::{Aead, AeadCore, KeyInit},
//! Aes256Gcm, Nonce, Key // Or `Aes128Gcm`
//! aead::{Aead, AeadCore, Generate, Key, KeyInit},
//! Aes256Gcm, Nonce, // Or `Aes128Gcm`
//! };
//!
//! let key = Aes256Gcm::generate_key().expect("generate key");
//! let key = Key::<Aes256Gcm>::generate();
//! let cipher = Aes256Gcm::new(&key);
//!
//! let nonce = Aes256Gcm::generate_nonce().expect("generate nonce"); // MUST be unique per message
//! let nonce = Nonce::generate(); // MUST be unique per message
//! let ciphertext = cipher.encrypt(&nonce, b"plaintext message".as_ref())?;
//!
//! let plaintext = cipher.decrypt(&nonce, ciphertext.as_ref())?;
Expand Down Expand Up @@ -56,15 +58,17 @@
doc = "```ignore"
)]
//! # fn main() -> Result<(), Box<dyn core::error::Error>> {
//! // NOTE: requires the `arrayvec` and `getrandom` features are enabled
//!
//! use aes_gcm::{
//! aead::{AeadCore, AeadInOut, KeyInit, arrayvec::ArrayVec},
//! aead::{AeadCore, AeadInOut, Generate, Key, KeyInit, arrayvec::ArrayVec},
//! Aes256Gcm, Nonce, // Or `Aes128Gcm`
//! };
//!
//! let key = Aes256Gcm::generate_key().expect("key generation failure");
//! let key = Key::<Aes256Gcm>::generate();
//! let cipher = Aes256Gcm::new(&key);
//!
//! let nonce = Aes256Gcm::generate_nonce().expect("nonce failure"); // MUST be unique per message
//! let nonce = Nonce::generate(); // MUST be unique per message
//! let mut buffer: ArrayVec<u8, 128> = ArrayVec::new(); // Note: buffer needs 16-bytes overhead for auth tag
//! buffer.try_extend_from_slice(b"plaintext message").unwrap();
//!
Expand Down
4 changes: 2 additions & 2 deletions aes-siv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = "0.6.0-rc.3"
aead = "0.6.0-rc.4"
aes = "0.9.0-rc.2"
cipher = "0.5.0-rc.2"
cmac = "0.8.0-rc.3"
Expand All @@ -30,7 +30,7 @@ pmac = { version = "0.8.0-rc.3", optional = true }
zeroize = { version = "1", optional = true, default-features = false }

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

Expand Down
16 changes: 10 additions & 6 deletions aes-siv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@
#![cfg_attr(feature = "getrandom", doc = "```")]
#![cfg_attr(not(feature = "getrandom"), doc = "```ignore")]
//! # fn main() -> Result<(), Box<dyn core::error::Error>> {
//! // NOTE: requires the `getrandom` feature is enabled
//!
//! use aes_siv::{
//! aead::{Aead, AeadCore, KeyInit},
//! aead::{Aead, AeadCore, Generate, Key, KeyInit},
//! Aes256SivAead, Nonce // Or `Aes128SivAead`
//! };
//!
//! let key = Aes256SivAead::generate_key().expect("key generation failure");
//! let key = Key::<Aes256SivAead>::generate();
//! let cipher = Aes256SivAead::new(&key);
//!
//! let nonce = Aes256SivAead::generate_nonce().expect("nonce failure"); // MUST be unique per message
//! let nonce = Nonce::generate(); // MUST be unique per message
//! let ciphertext = cipher.encrypt(&nonce, b"plaintext message".as_ref())?;
//!
//! let plaintext = cipher.decrypt(&nonce, ciphertext.as_ref())?;
Expand Down Expand Up @@ -55,15 +57,17 @@
doc = "```ignore"
)]
//! # fn main() -> Result<(), Box<dyn core::error::Error>> {
//! // NOTE: requires the `arrayvec` and `getrandom` features are enabled
//!
//! use aes_siv::{
//! aead::{AeadCore, AeadInOut, KeyInit, arrayvec::ArrayVec},
//! aead::{AeadCore, AeadInOut, Generate, Key, KeyInit, arrayvec::ArrayVec},
//! Aes256SivAead, Nonce, // Or `Aes128SivAead`
//! };
//!
//! let key = Aes256SivAead::generate_key().expect("key generation failure");
//! let key = Key::<Aes256SivAead>::generate();
//! let cipher = Aes256SivAead::new(&key);
//!
//! let nonce = Aes256SivAead::generate_nonce().expect("nonce failure"); // MUST be unique per message
//! let nonce = Nonce::generate(); // MUST be unique per message
//! let mut buffer: ArrayVec<u8, 128> = ArrayVec::new(); // Note: buffer needs 16-bytes overhead for auth tag
//! buffer.try_extend_from_slice(b"plaintext message").unwrap();
//!
Expand Down
4 changes: 2 additions & 2 deletions ascon-aead128/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.3", default-features = false }
aead = { version = "0.6.0-rc.4", default-features = false }
subtle = { version = "2", default-features = false }
zeroize = { version = "1.8", optional = true, default-features = false, features = ["derive"] }
ascon = "0.5.0-rc.0"

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

[features]
default = ["alloc", "getrandom"]
Expand Down
39 changes: 12 additions & 27 deletions ascon-aead128/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,17 @@
#![cfg_attr(feature = "getrandom", doc = "```")]
#![cfg_attr(not(feature = "getrandom"), doc = "```ignore")]
//! # fn main() -> Result<(), Box<dyn core::error::Error>> {
//! // NOTE: requires the `getrandom` feature is enabled
//!
//! use ascon_aead128::{
//! AsconAead128, Key, Nonce,
//! aead::{Aead, KeyInit, AeadCore}
//! aead::{Aead, Generate, KeyInit, AeadCore},
//! AsconAead128, AsconAead128Key, AsconAead128Nonce
//! };
//!
//! let key = AsconAead128::generate_key().expect("key generation failure");
//! let key = AsconAead128Key::generate();
//! let cipher = AsconAead128::new(&key);
//!
//! let nonce = AsconAead128::generate_nonce().expect("generate nonce"); // 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(())
//! # }
//! ```
//!
//! With randomly sampled keys and nonces (requires `getrandom` feature):
//!
#![cfg_attr(feature = "getrandom", doc = "```")]
#![cfg_attr(not(feature = "getrandom"), doc = "```ignore")]
//! # fn main() -> Result<(), Box<dyn core::error::Error>> {
//! use ascon_aead128::{AsconAead128, aead::{Aead, AeadCore, KeyInit}};
//!
//! let key = AsconAead128::generate_key().expect("key generation failure");
//! let cipher = AsconAead128::new(&key);
//!
//! let nonce = AsconAead128::generate_nonce().expect("generate nonce"); // MUST be unique per message
//! let nonce = AsconAead128Nonce::generate(); // MUST be unique per message
//! let ciphertext = cipher.encrypt(&nonce, b"plaintext message".as_ref())?;
//!
//! let plaintext = cipher.decrypt(&nonce, ciphertext.as_ref())?;
Expand Down Expand Up @@ -74,15 +57,17 @@
doc = "```ignore"
)]
//! # fn main() -> Result<(), Box<dyn core::error::Error>> {
//! // NOTE: requires the `arrayvec` and `getrandom` features are enabled
//!
//! use ascon_aead128::{
//! AsconAead128, Key, Nonce,
//! aead::{AeadCore, AeadInOut, KeyInit, arrayvec::ArrayVec}
//! aead::{AeadCore, AeadInOut, Generate, KeyInit, arrayvec::ArrayVec},
//! AsconAead128, AsconAead128Key, AsconAead128Nonce
//! };
//!
//! let key = AsconAead128::generate_key().expect("key generation failure");
//! let key = AsconAead128Key::generate();
//! let cipher = AsconAead128::new(&key);
//!
//! let nonce = AsconAead128::generate_nonce().expect("generate nonce"); // MUST be unique per message
//! let nonce = AsconAead128Nonce::generate(); // MUST be unique per message
//! let mut buffer: ArrayVec<u8, 128> = ArrayVec::new(); // Buffer needs 16-bytes overhead for authentication tag
//! buffer.try_extend_from_slice(b"plaintext message").unwrap();
//!
Expand Down
2 changes: 1 addition & 1 deletion belt-dwp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.3", default-features = false }
aead = { version = "0.6.0-rc.4", default-features = false }
belt-block = { version = "0.2.0-rc.2" }
belt-ctr = { version = "0.2.0-rc.2" }
opaque-debug = { version = "0.3" }
Expand Down
34 changes: 19 additions & 15 deletions belt-dwp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@
//!
//! Simple usage (allocating, no associated data):
//!
//! ```
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! # #[cfg(feature = "getrandom")] {
#![cfg_attr(feature = "getrandom", doc = "```")]
#![cfg_attr(not(feature = "getrandom"), doc = "```ignore")]
//! # fn main() -> Result<(), Box<dyn core::error::Error>> {
//! use belt_dwp::{
//! aead::{Aead, AeadCore, KeyInit}, Nonce, BeltDwp
//! aead::{Aead, AeadCore, Generate, Key, KeyInit},
//! BeltDwp, Nonce
//! };
//!
//! let key = BeltDwp::generate_key().unwrap();
//! let key = Key::<BeltDwp>::generate();
//! let cipher = BeltDwp::new(&key);
//! let nonce = BeltDwp::generate_nonce().unwrap(); // 128-bits; unique per message
//! let nonce = Nonce::generate(); // 128-bits; 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(()) }
//! # Ok(()) }
//! ```
//!
//! ## In-place Usage (eliminates `alloc` requirement)
Expand All @@ -43,17 +44,20 @@
//! It can then be passed as the `buffer` parameter to the in-place encrypt
//! and decrypt methods:
//!
//! ```
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! # #[cfg(all(feature = "getrandom", feature = "arrayvec"))] {
#![cfg_attr(all(feature = "getrandom", feature = "arrayvec"), doc = "```")]
#![cfg_attr(
not(all(feature = "getrandom", feature = "arrayvec")),
doc = "```ignore"
)]
//! # fn main() -> Result<(), Box<dyn core::error::Error>> {
//! use belt_dwp::{
//! aead::{AeadInOut, KeyInit, arrayvec::ArrayVec},
//! Nonce, BeltDwp
//! aead::{AeadInOut, Generate, Key, KeyInit, arrayvec::ArrayVec},
//! BeltDwp, Nonce
//! };
//!
//! let key = BeltDwp::generate_key().unwrap();
//! let key = Key::<BeltDwp>::generate();
//! let cipher = BeltDwp::new(&key);
//! let nonce = Nonce::try_from(&b"unique nonce1234"[..]).unwrap(); // 128-bits; unique per message
//! let nonce = Nonce::generate(); // 128-bits; MUST be unique per message
//!
//! let mut buffer: ArrayVec<u8, 128> = ArrayVec::new(); // Note: buffer needs 16-bytes overhead for auth tag
//! buffer.try_extend_from_slice(b"plaintext message").unwrap();
Expand All @@ -67,7 +71,7 @@
//! // Decrypt `buffer` in-place, replacing its ciphertext context with the original plaintext
//! cipher.decrypt_in_place(&nonce, b"", &mut buffer)?;
//! assert_eq!(buffer.as_ref(), b"plaintext message");
//! # }; Ok(()) }
//! # Ok(()) }
//! ```

pub use aead::{self, AeadCore, AeadInOut, Error, Key, KeyInit, KeySizeUser, Tag};
Expand Down
4 changes: 2 additions & 2 deletions ccm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ keywords = ["encryption", "aead"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.3", default-features = false }
aead = { version = "0.6.0-rc.4", default-features = false }
cipher = { version = "0.5.0-rc.2", default-features = false }
ctr = { version = "0.10.0-rc.2", default-features = false }
subtle = { version = "2", default-features = false }

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

Expand Down
Loading