chore: clear pre-existing clippy + fmt in crypto tests
Fix rustfmt drift and two clippy lints (`doc_markdown` missing backticks around `NativeRuntime`) that surfaced after the Rust 1.94 toolchain update. No functional change.
This commit is contained in:
@@ -80,7 +80,10 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn sha1_rfc3174_abc() {
|
fn sha1_rfc3174_abc() {
|
||||||
assert_eq!(hex(&sha1_hash(b"abc")), "a9993e364706816aba3e25717850c26c9cd0d89d");
|
assert_eq!(
|
||||||
|
hex(&sha1_hash(b"abc")),
|
||||||
|
"a9993e364706816aba3e25717850c26c9cd0d89d"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//! End-to-end tests for the `SHA1` / `SHA256` / `SHA512` Forth host words.
|
//! End-to-end tests for the `SHA1` / `SHA256` / `SHA512` Forth host words.
|
||||||
//!
|
//!
|
||||||
//! These run inside a real WAFER VM (NativeRuntime). The Forth program writes
|
//! These run inside a real WAFER VM (`NativeRuntime`). The Forth program writes
|
||||||
//! a counted string into `PAD`, calls the hash word, then the test reads the
|
//! a counted string into `PAD`, calls the hash word, then the test reads the
|
||||||
//! digest out of WAFER linear memory and compares it to the RFC-3174 / FIPS-180
|
//! digest out of WAFER linear memory and compares it to the RFC-3174 / FIPS-180
|
||||||
//! reference vectors.
|
//! reference vectors.
|
||||||
@@ -26,10 +26,16 @@ fn hash_via_forth(word: &str, input: &[u8]) -> Vec<u8> {
|
|||||||
|
|
||||||
// Stack now: ( c-addr2 u2 ). Read u2 then c-addr2 from data stack.
|
// Stack now: ( c-addr2 u2 ). Read u2 then c-addr2 from data stack.
|
||||||
let stack = vm.data_stack();
|
let stack = vm.data_stack();
|
||||||
assert!(stack.len() >= 2, "expected (addr len) on stack, got {stack:?}");
|
assert!(
|
||||||
|
stack.len() >= 2,
|
||||||
|
"expected (addr len) on stack, got {stack:?}"
|
||||||
|
);
|
||||||
let u2 = stack[0] as usize;
|
let u2 = stack[0] as usize;
|
||||||
let addr2 = stack[1] as u32;
|
let addr2 = stack[1] as u32;
|
||||||
assert_eq!(addr2, HASH_SCRATCH_BASE, "digest should land in HASH_SCRATCH");
|
assert_eq!(
|
||||||
|
addr2, HASH_SCRATCH_BASE,
|
||||||
|
"digest should land in HASH_SCRATCH"
|
||||||
|
);
|
||||||
|
|
||||||
// Read the digest out of WAFER linear memory.
|
// Read the digest out of WAFER linear memory.
|
||||||
let mut bytes = Vec::with_capacity(u2);
|
let mut bytes = Vec::with_capacity(u2);
|
||||||
|
|||||||
Reference in New Issue
Block a user