[wasm] chore: use new key method
This commit is contained in:
parent
440df8a06b
commit
5432002253
@ -19,8 +19,7 @@ impl JsQMC2 {
|
|||||||
/// Create a new QMC2 (mgg/mflac) cipher instance.
|
/// Create a new QMC2 (mgg/mflac) cipher instance.
|
||||||
#[wasm_bindgen(constructor)]
|
#[wasm_bindgen(constructor)]
|
||||||
pub fn new(ekey: &str) -> Result<JsQMC2, JsError> {
|
pub fn new(ekey: &str) -> Result<JsQMC2, JsError> {
|
||||||
let key = umc_qmc::ekey::decrypt(ekey).map_err(map_js_error)?;
|
let cipher = QMCv2Cipher::new_from_ekey(ekey).map_err(map_js_error)?;
|
||||||
let cipher = QMCv2Cipher::new(key).map_err(map_js_error)?;
|
|
||||||
Ok(JsQMC2(cipher))
|
Ok(JsQMC2(cipher))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user