[kwm] refactor: rename cipher to decipher

This commit is contained in:
鲁树人 2024-09-15 20:43:57 +01:00
parent 1e1d642149
commit 2222e7bc50
2 changed files with 4 additions and 4 deletions

View File

@ -105,7 +105,7 @@ impl Header {
})
}
pub fn get_cipher<T>(&self, ekey: Option<T>) -> Result<Cipher>
pub fn get_decipher<T>(&self, ekey: Option<T>) -> Result<Cipher>
where
T: AsRef<[u8]>,
{

View File

@ -25,9 +25,9 @@ impl JsKuwoHeader {
}
/// Create an instance of cipher (decipher) for decryption
#[wasm_bindgen(js_name=makeCipher)]
pub fn make_cipher(&self, ekey: Option<String>) -> Result<JsCipher, JsError> {
let cipher = self.0.get_cipher(ekey).map_err(map_js_error)?;
#[wasm_bindgen(js_name=makeDecipher)]
pub fn make_decipher(&self, ekey: Option<String>) -> Result<JsCipher, JsError> {
let cipher = self.0.get_decipher(ekey).map_err(map_js_error)?;
Ok(JsCipher(cipher))
}
}