Skip to content

Commit a8936d9

Browse files
committed
keccak v0.1.6
Backported cherry-pick of: ARMv8 `asm!` cleanups (#101) We pass in `state.as_mut_ptr()` as `x0`, which was previously marked as `in`. However, it's modified in the `asm!`, e.g.: sub x0, x0, #192 Note: it's also post-incremented by `ld1.1d` as state is loaded. Since it's modified, it needs to be `inout`. This marks it as such, using the `=> _` syntax to discard the result, then it's reset, then modified as state is written). Similar mutations were occurring with `x1` and `x8` as well, which have been modified accordingly.
1 parent 40c50c1 commit a8936d9

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

‎keccak/CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.1.6 (2026-02-13)
9+
### Fixed
10+
- ARMv8 `asm!` invocation had incorrect operand type ([#103])
11+
12+
[#103]: https://github.com/RustCrypto/sponges/pull/103
13+
814
## 0.1.5 (2024-01-12)
915
### Changed
1016
- Enable ARMv8 ASM backend for `p1600` ([#68])

‎keccak/Cargo.lock‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎keccak/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "keccak"
3-
version = "0.1.5"
3+
version = "0.1.6"
44
description = """
55
Pure Rust implementation of the Keccak sponge function including the keccak-f
66
and keccak-p variants

‎keccak/src/armv8.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub unsafe fn p1600_armv8_sha3_asm(state: &mut [u64; 25], round_count: usize) {
1919
// NOTE: This loop actually computes two f1600 functions in
2020
// parallel, in both the lower and the upper 64-bit of the
2121
// 128-bit registers v0-v24.
22-
0: sub x8, x8, #1
22+
0: sub x8, x8, #1
2323
2424
// Theta Calculations
2525
eor3.16b v25, v20, v15, v10
@@ -112,9 +112,9 @@ pub unsafe fn p1600_armv8_sha3_asm(state: &mut [u64; 25], round_count: usize) {
112112
st1.1d {{v20-v23}}, [x0], #32
113113
st1.1d {{v24}}, [x0]
114114
",
115-
in("x0") state.as_mut_ptr(),
116-
in("x1") crate::RC[24-round_count..].as_ptr(),
117-
in("x8") round_count,
115+
inout("x0") state.as_mut_ptr() => _,
116+
inout("x1") crate::RC[24-round_count..].as_ptr() => _,
117+
inout("x8") round_count => _,
118118
clobber_abi("C"),
119119
options(nostack)
120120
);

0 commit comments

Comments
 (0)