Skip to content

Commit d66feac

Browse files
committed
[fix] clippy warnings and version conflict source.
1 parent 7a96abf commit d66feac

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

Cargo.lock

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

platform/impls/rustcrypto/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ aes = { version = "0.8", default-features = false }
2727
ctr = { version = "0.9", default-features = false }
2828
aes-gcm = { version = "0.10", default-features = false, features = ["aes"] }
2929
cipher = { version = "0.4", default-features = false }
30-
generic-array = { version = "0.14", default-features = false }
3130

3231
# Traits and utilities
3332
zerocopy = { workspace = true }

platform/impls/rustcrypto/src/cipher.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ use openprot_hal_blocking::cipher::{
77

88
// RustCrypto imports for AES-CTR implementation
99
use aes::Aes256;
10-
use cipher::{KeyIvInit, StreamCipher, StreamCipherSeek};
10+
use cipher::{generic_array::GenericArray, KeyIvInit, StreamCipher, StreamCipherSeek};
1111
use ctr::Ctr64BE;
12-
use generic_array::GenericArray;
1312

1413
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
1514
pub enum RustCryptoCipherError {

platform/impls/rustcrypto/src/controller.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl DigestOp for DigestContext256 {
162162
// Convert SHA-256 output (32 bytes) to Digest<8> (8 x 32-bit words)
163163
let mut words = [0u32; 8];
164164
for (i, chunk) in result.chunks_exact(4).enumerate() {
165-
words[i] = u32::from_le_bytes([chunk[0], chunk[1], chunk[2], chunk[3]]);
165+
words[i] = u32::from_le_bytes(chunk.try_into().expect("chunk is exactly 4 bytes"));
166166
}
167167

168168
let digest = Digest::new(words);
@@ -194,7 +194,7 @@ impl DigestOp for DigestContext384 {
194194
// Convert SHA-384 output (48 bytes) to Digest<12> (12 x 32-bit words)
195195
let mut words = [0u32; 12];
196196
for (i, chunk) in result.chunks_exact(4).enumerate() {
197-
words[i] = u32::from_le_bytes([chunk[0], chunk[1], chunk[2], chunk[3]]);
197+
words[i] = u32::from_le_bytes(chunk.try_into().expect("chunk is exactly 4 bytes"));
198198
}
199199

200200
let digest = Digest::new(words);
@@ -226,7 +226,7 @@ impl DigestOp for DigestContext512 {
226226
// Convert SHA-512 output (64 bytes) to Digest<16> (16 x 32-bit words)
227227
let mut words = [0u32; 16];
228228
for (i, chunk) in result.chunks_exact(4).enumerate() {
229-
words[i] = u32::from_le_bytes([chunk[0], chunk[1], chunk[2], chunk[3]]);
229+
words[i] = u32::from_le_bytes(chunk.try_into().expect("chunk is exactly 4 bytes"));
230230
}
231231

232232
let digest = Digest::new(words);

0 commit comments

Comments
 (0)