From e76698eee4d87626112db7716d87a48cc878a0fd Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Mon, 27 Nov 2023 14:45:35 +0300 Subject: [PATCH] rc5: minor code tweak (#393) --- Cargo.lock | 14 +++++++------- rc5/src/core/backend.rs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44aa4777..5aad667e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -93,9 +93,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -159,9 +159,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.147" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "magma" @@ -180,7 +180,7 @@ dependencies = [ [[package]] name = "rc5" -version = "0.1.0" +version = "0.1.0-pre" dependencies = [ "cipher", ] @@ -228,9 +228,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "version_check" diff --git a/rc5/src/core/backend.rs b/rc5/src/core/backend.rs index dea60da1..bee5fefb 100644 --- a/rc5/src/core/backend.rs +++ b/rc5/src/core/backend.rs @@ -175,8 +175,8 @@ where fn words_from_block(block: &Block) -> (W, W) { // Block size is 2 * word::BYTES so the unwrap is safe - let a = W::from_le_bytes(block[..W::Bytes::USIZE].try_into().unwrap()); - let b = W::from_le_bytes(block[W::Bytes::USIZE..].try_into().unwrap()); + let a = W::from_le_bytes(block[..W::Bytes::USIZE].into()); + let b = W::from_le_bytes(block[W::Bytes::USIZE..].into()); (a, b) }