[qmc] feat: add helper method to create QMCv2 Decipher from EKey
This commit is contained in:
parent
7502b310d2
commit
07fe0263d2
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user