Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chacha20: rng - stream ID endianness #389

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

nstilt1
Copy link
Contributor

@nstilt1 nstilt1 commented Feb 1, 2025

Just checking to see if GitHub actions fails here
Fixes #388

@nstilt1 nstilt1 marked this pull request as draft February 1, 2025 17:09
@tarcieri
Copy link
Member

tarcieri commented Feb 1, 2025

This run in particular tests a big endian target: https://github.com/RustCrypto/stream-ciphers/actions/runs/13090675363/job/36526942407?pr=389

@nstilt1 nstilt1 marked this pull request as ready for review February 1, 2025 18:38
@@ -345,6 +347,11 @@ macro_rules! impl_chacha_rng {
#[inline]
fn generate(&mut self, r: &mut Self::Results) {
self.0.generate(&mut r.0);
if 1u32.to_le() != 1 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the #[cfg(target_endian = "big")] check is more explicit/clear. Any given target only has one endianness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chacha20: rng - StreamID endianness issue?
2 participants