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
3 changes: 3 additions & 0 deletions .github/workflows/chacha20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ jobs:

# Tests for the AVX-512 backend
avx512:
# It looks like Intel blocks `curl` downloads, so the job is disabled
# until a fix is found
if: false
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
6 changes: 6 additions & 0 deletions chacha20/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.10.1 (UNRELEASED)
### Added
- `ChaCha20LegacyCore` type and `Nonce` type alias ([#570])

[#570]: https://github.com/RustCrypto/stream-ciphers/pull/570

## 0.10.0 (2026-02-07)
### Added
- `rand_core` v0.10 support ([#333], [#513])
Expand Down
1 change: 1 addition & 0 deletions chacha20/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ missing_debug_implementations = "warn"
missing_docs = "warn"
trivial_casts = "warn"
trivial_numeric_casts = "warn"
unreachable_pub = "warn"
unused_lifetimes = "warn"
unused_qualifications = "warn"

Expand Down
2 changes: 1 addition & 1 deletion chacha20/src/chacha.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub use cipher::{
use cipher::{
IvSizeUser, KeyIvInit, KeySizeUser, StreamCipherCoreWrapper,
array::Array,
consts::{U12, U32, U64},
Expand Down
4 changes: 1 addition & 3 deletions chacha20/src/legacy.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Legacy version of ChaCha20 with a 64-bit nonce

use crate::chacha::Key;
use crate::{ChaChaCore, R20};
use crate::{ChaChaCore, Key, R20, variants::Legacy};
use cipher::{
IvSizeUser, KeyIvInit, KeySizeUser, StreamCipherCoreWrapper,
array::Array,
Expand All @@ -10,7 +9,6 @@ use cipher::{

/// Nonce type used by [`ChaCha20Legacy`].
pub type LegacyNonce = Array<u8, U8>;
use crate::variants::Legacy;

/// The ChaCha20 stream cipher (legacy "djb" construction with 64-bit nonce).
pub type ChaCha20Legacy = StreamCipherCoreWrapper<ChaCha20LegacyCore>;
Expand Down
6 changes: 4 additions & 2 deletions chacha20/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ mod rng;
mod xchacha;

#[cfg(feature = "cipher")]
pub use chacha::{ChaCha8, ChaCha12, ChaCha20, Key, KeyIvInit};
pub use chacha::{ChaCha8, ChaCha12, ChaCha20, Key, Nonce};
#[cfg(feature = "cipher")]
pub use cipher;
#[cfg(feature = "cipher")]
pub use cipher::KeyIvInit;
#[cfg(feature = "legacy")]
pub use legacy::{ChaCha20Legacy, LegacyNonce};
pub use legacy::{ChaCha20Legacy, ChaCha20LegacyCore, LegacyNonce};
#[cfg(feature = "rng")]
pub use rand_core;
#[cfg(feature = "rng")]
Expand Down
5 changes: 1 addition & 4 deletions chacha20/src/xchacha.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! XChaCha is an extended nonce variant of ChaCha

use crate::{
CONSTANTS, ChaChaCore, R8, R12, R20, Rounds, STATE_WORDS, quarter_round, variants::Ietf,
CONSTANTS, ChaChaCore, Key, R8, R12, R20, Rounds, STATE_WORDS, quarter_round, variants::Ietf,
};
use cipher::{
BlockSizeUser, IvSizeUser, KeyIvInit, KeySizeUser, StreamCipherClosure, StreamCipherCore,
Expand All @@ -13,9 +13,6 @@ use cipher::{
#[cfg(feature = "zeroize")]
use zeroize::ZeroizeOnDrop;

/// Key type used by all ChaCha variants.
pub type Key = Array<u8, U32>;

/// Nonce type used by XChaCha variants.
pub type XNonce = Array<u8, U24>;

Expand Down