huskies: merge 927
This commit is contained in:
@@ -248,6 +248,7 @@ fn hex_encode(bytes: &[u8]) -> String {
|
||||
bytes.iter().map(|b| format!("{b:02x}")).collect()
|
||||
}
|
||||
|
||||
#[allow(clippy::string_slice)] // s is hex (ASCII-only); i advances in steps of 2, always within bounds
|
||||
fn hex_decode(s: &str) -> Option<Vec<u8>> {
|
||||
if !s.len().is_multiple_of(2) {
|
||||
return None;
|
||||
@@ -330,6 +331,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::string_slice)] // sig is hex (ASCII-only); subtracting 4 stays within bounds for any valid sig
|
||||
fn verify_rejects_truncated_signature() {
|
||||
let kp = make_keypair();
|
||||
let pubkey = public_key_hex(&kp);
|
||||
|
||||
Reference in New Issue
Block a user