Merge remote-tracking branch 'origin/main' into fix/constant-time-eq-length-leak
This commit is contained in:
commit
b3c995c849
11 changed files with 1257 additions and 128 deletions
|
|
@ -240,8 +240,9 @@ fn hex_encode(data: &[u8]) -> String {
|
|||
}
|
||||
|
||||
/// Hex-decode a hex string to bytes.
|
||||
#[allow(clippy::manual_is_multiple_of)]
|
||||
fn hex_decode(hex: &str) -> Result<Vec<u8>> {
|
||||
if hex.len() % 2 != 0 {
|
||||
if !hex.len().is_multiple_of(2) {
|
||||
anyhow::bail!("Hex string has odd length");
|
||||
}
|
||||
(0..hex.len())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue