Skip to content

Commit 7b811ba

Browse files
authored
Merge pull request #53 from bjoernQ/fix/rust-crypto-on-32bit-machines
Make RustCrypto work on 32-bit machines
2 parents 3b091c2 + e6b95f9 commit 7b811ba

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

matter/src/crypto/crypto_rustcrypto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl CryptoKeyPair for KeyPair {
155155
let bytes = key.to_bytes();
156156
let slice = bytes.as_slice();
157157
let len = slice.len();
158-
priv_key.copy_from_slice(slice);
158+
priv_key[..slice.len()].copy_from_slice(slice);
159159
Ok(len)
160160
}
161161
KeyType::Public(_) => Err(Error::Crypto),

matter/src/secure_channel/crypto_rustcrypto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ impl CryptoSpake2 for CryptoRustCrypto {
226226

227227
impl CryptoRustCrypto {
228228
fn add_to_tt(tt: &mut sha2::Sha256, buf: &[u8]) -> Result<(), Error> {
229-
tt.update(buf.len().to_le_bytes());
229+
tt.update((buf.len() as u64).to_le_bytes());
230230
if !buf.is_empty() {
231231
tt.update(buf);
232232
}

0 commit comments

Comments
 (0)