Function abcrypt_wasm::decrypt
source · pub fn decrypt(ciphertext: &[u8], passphrase: &[u8]) -> Result<Vec<u8>, JsError>Expand description
Decrypts ciphertext and into a newly allocated Uint8Array.
§Errors
Returns Err if any of the following are true:
ciphertextis shorter than 156 bytes.- The magic number is invalid.
- The version number is the unrecognized abcrypt version number.
- The Argon2 parameters are invalid.
- The Argon2 context is invalid.
- The MAC (authentication tag) of the header is invalid.
- The MAC (authentication tag) of the ciphertext is invalid.