mirror of
https://git.um-react.app/um/lib_um_crypto_rust.git
synced 2026-03-07 20:19:51 +00:00
[qmc] feat: add helper method to create QMCv2 Decipher from EKey
This commit is contained in:
@@ -35,6 +35,11 @@ impl QMCv2Cipher {
|
|||||||
Ok(cipher)
|
Ok(cipher)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn new_from_ekey<T: AsRef<[u8]>>(ekey_str: T) -> Result<Self> {
|
||||||
|
let key = ekey::decrypt(ekey_str)?;
|
||||||
|
Self::new(key)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn decrypt<T>(&self, data: &mut T, offset: usize)
|
pub fn decrypt<T>(&self, data: &mut T, offset: usize)
|
||||||
where
|
where
|
||||||
T: AsMut<[u8]> + ?Sized,
|
T: AsMut<[u8]> + ?Sized,
|
||||||
|
|||||||
Reference in New Issue
Block a user