mirror of
https://git.um-react.app/um/lib_um_crypto_rust.git
synced 2026-03-08 04:29:54 +00:00
[kwm] refactor: rename cipher to decipher
This commit is contained in:
@@ -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]>,
|
||||
{
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user