Function chain_crypto::multilock::decrypt
source · pub fn decrypt(
app_info: &[u8],
sk: &Scalar,
data: &[u8],
out: &mut [u8]
) -> Result<(), DecryptionError>
Expand description
Decrypt data in the asymmetric lock. this is the dual of ‘encrypt’. The data should in the form:
EPHEMERAL_PUBLIC_KEY || SESSION_KEYS || ENCRYPTED-DATA || POLY1305-TAG
Return
Error if:
- header is invalid
- version is unknown
- data is too small
- any of the point is not in the first format
- tag don’t match Success otherwise
Panics
If output ‘out’ is not of correct size