mirror of
https://git.um-react.app/um/lib_um_crypto_rust.git
synced 2026-03-07 20:19:51 +00:00
[xmly] feat #5: implement xmly decipher
This commit is contained in:
@@ -22,3 +22,14 @@ where
|
||||
{
|
||||
ENGINE.decode(data)
|
||||
}
|
||||
|
||||
pub fn decode_overwrite<T>(data: &mut T) -> Result<&[u8], DecodeError>
|
||||
where
|
||||
T: AsMut<[u8]> + ?Sized,
|
||||
{
|
||||
let data = data.as_mut();
|
||||
let decoded = decode(&mut data[..])?;
|
||||
let len = decoded.len();
|
||||
data[..len].copy_from_slice(&decoded);
|
||||
Ok(&data[..len])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user