Function decrypt

Source
pub fn decrypt<'a>(
    ciphertext: &[u8],
    passphrase: &[u8],
) -> PyResult<Cow<'a, [u8]>>
Expand description

Decrypts ciphertext and into a newly allocated bytes.

ยงErrors

Returns an error if any of the following are true:

  • ciphertext is shorter than 164 bytes.
  • The magic number is invalid.
  • The version number is the unsupported abcrypt version number.
  • The version number is the unrecognized abcrypt version number.
  • The Argon2 type is invalid.
  • The Argon2 version is invalid.
  • 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.