diff --git a/.github/workflows/chacha20.yml b/.github/workflows/chacha20.yml index addbafe3..53ecf600 100644 --- a/.github/workflows/chacha20.yml +++ b/.github/workflows/chacha20.yml @@ -211,4 +211,4 @@ jobs: toolchain: ${{ matrix.rust }} targets: ${{ matrix.target }} - uses: RustCrypto/actions/cross-install@master - - run: RUSTFLAGS="${{ matrix.rustflags }}" cross test --package chacha20 --target ${{ matrix.target }} + - run: RUSTFLAGS="${{ matrix.rustflags }}" cross test --package chacha20 --target ${{ matrix.target }} --all-features diff --git a/chacha20/src/rng.rs b/chacha20/src/rng.rs index 12dbc9ea..86f04bac 100644 --- a/chacha20/src/rng.rs +++ b/chacha20/src/rng.rs @@ -362,6 +362,10 @@ macro_rules! impl_chacha_rng { #[inline] fn generate(&mut self, r: &mut Self::Results) { self.0.generate(&mut r.0); + #[cfg(target_endian = "big")] + for word in r.0.iter_mut() { + *word = word.to_le(); + } } } @@ -1066,7 +1070,7 @@ pub(crate) mod tests { tester_array = [0u8; LEN]; dest_pos = 0; - // test fill_bytes with lengths starting at N bytes, decreasing by 1, + // test fill_bytes with lengths starting at `N` bytes, decreasing by 1, // down to 1 byte for test_len in 1..=N { let debug_start_word_pos = rng.get_word_pos();