[][src]Function sodalite::secretbox

pub fn secretbox(
    c: &mut [u8],
    m: &[u8],
    n: &SecretboxNonce,
    k: &SecretboxKey
) -> Result<(), ()>

Encrypt and authenticate message m using nonce n and secret key k.

Cipher text is returned in c.

Panics

  • If first 32 bytes of m are not zero.
  • If length of c is not the same as the length of m.