Skip to content

Commit

Permalink
aes v0.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Feb 13, 2024
1 parent dd29253 commit f2dbee5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

7 changes: 7 additions & 0 deletions aes/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ 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.8.4 (2024-02-13)
### Changed
- Assert soundness preconditions for ARMv8 key expansion ([#407], [#408])

[#407]: https://github.com/RustCrypto/block-ciphers/pull/407
[#408]: https://github.com/RustCrypto/block-ciphers/pull/408

## 0.8.3 (2023-06-17)
### Added
- Support `aes_armv8` on Rust 1.61+ using `asm!` ([#365])
Expand Down
2 changes: 1 addition & 1 deletion aes/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aes"
version = "0.8.3"
version = "0.8.4"
description = "Pure Rust implementation of the Advanced Encryption Standard (a.k.a. Rijndael)"
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
Expand Down
6 changes: 4 additions & 2 deletions aes/src/armv8/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ pub unsafe fn expand_key<const L: usize, const N: usize>(key: &[u8; L]) -> [uint

let mut expanded_keys: [uint8x16_t; N] = mem::zeroed();

let columns =
slice::from_raw_parts_mut(expanded_keys.as_mut_ptr() as *mut u32, N * BLOCK_WORDS);
// Sanity check, as this is required in order for the following line to be sound.
const _: () = assert!(mem::align_of::<uint8x16_t>() >= mem::align_of::<u32>());
let keys_ptr: *mut u32 = expanded_keys.as_mut_ptr().cast();
let columns = slice::from_raw_parts_mut(keys_ptr, N * BLOCK_WORDS);

for (i, chunk) in key.chunks_exact(WORD_SIZE).enumerate() {
columns[i] = u32::from_ne_bytes(chunk.try_into().unwrap());
Expand Down

0 comments on commit f2dbee5

Please sign in to comment.