mirror of
https://github.com/trussed-dev/trussed-staging.git
synced 2026-06-20 04:16:23 -07:00
Replace heapless with heapless-bytes
This commit is contained in:
+2
-1
@@ -83,7 +83,8 @@ log-warn = []
|
||||
log-error = []
|
||||
|
||||
[patch.crates-io]
|
||||
trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "ac106d63ab5e19021b0e37f0efb4313f8168a110" }
|
||||
# trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "ac106d63ab5e19021b0e37f0efb4313f8168a110" }
|
||||
trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "refs/pull/207/head" }
|
||||
|
||||
trussed-chunked = { path = "extensions/chunked" }
|
||||
trussed-hkdf = { path = "extensions/hkdf" }
|
||||
|
||||
+2
-2
@@ -182,7 +182,7 @@ impl ExtensionImpl<ChunkedExtension> for super::StagingBackend {
|
||||
});
|
||||
let nonce: &StreamNonce<ChaCha8Poly1305, StreamLE31<ChaCha8Poly1305>> =
|
||||
(&nonce).into();
|
||||
let aead = ChaCha8Poly1305::new((&*key.material).into());
|
||||
let aead = ChaCha8Poly1305::new(key.material.as_slice().into());
|
||||
let encryptor = EncryptorLE31::<ChaCha8Poly1305>::from_aead(aead, nonce);
|
||||
store::start_chunked_write(
|
||||
&store,
|
||||
@@ -210,7 +210,7 @@ impl ExtensionImpl<ChunkedExtension> for super::StagingBackend {
|
||||
filestore.read(&request.path, request.location)?;
|
||||
let nonce: &StreamNonce<ChaCha8Poly1305, StreamLE31<ChaCha8Poly1305>> =
|
||||
(&**nonce).into();
|
||||
let aead = ChaCha8Poly1305::new((&*key.material).into());
|
||||
let aead = ChaCha8Poly1305::new(key.material.as_slice().into());
|
||||
let decryptor = DecryptorLE31::<ChaCha8Poly1305>::from_aead(aead, nonce);
|
||||
backend_ctx.chunked_io_state =
|
||||
Some(ChunkedIoState::EncryptedRead(EncryptedChunkedReadState {
|
||||
|
||||
@@ -45,7 +45,7 @@ fn wrap_key_to_file(
|
||||
let nonce = (&*nonce).try_into().unwrap();
|
||||
|
||||
let key = keystore.load_key(Secrecy::Secret, Some(KIND), &request.wrapping_key)?;
|
||||
let chachakey: [u8; KEY_LEN] = (&*key.material).try_into().unwrap();
|
||||
let chachakey: [u8; KEY_LEN] = key.material.as_slice().try_into().unwrap();
|
||||
let mut aead = ChaCha8Poly1305::new(&GenericArray::clone_from_slice(&chachakey));
|
||||
let tag = aead
|
||||
.encrypt_in_place_detached(
|
||||
@@ -90,7 +90,7 @@ fn unwrap_key_from_file(
|
||||
let tag = (&*tag).try_into().unwrap();
|
||||
|
||||
let key = keystore.load_key(Secrecy::Secret, Some(KIND), &request.key)?;
|
||||
let chachakey: [u8; KEY_LEN] = (&*key.material).try_into().unwrap();
|
||||
let chachakey: [u8; KEY_LEN] = key.material.as_slice().try_into().unwrap();
|
||||
let mut aead = ChaCha8Poly1305::new(&GenericArray::clone_from_slice(&chachakey));
|
||||
if aead
|
||||
.decrypt_in_place_detached(
|
||||
|
||||
Reference in New Issue
Block a user