Function chain_crypto::asymlock::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 || ENCRYPTED-DATA || POLY1305-TAG
Return
Error if:
- data is too small
- point is not in the first format
- tag don’t match Success otherwise
Panics
If output ‘out’ is not 48 bytes less than ‘data’