Function seal [src]
Encrypt and authenticate m using a nonce npub and a key k.
c must be exactly tag_length longer than m, as it will store both the ciphertext and the authentication tag.
Prototype
pub fn seal(c: []u8, m: []const u8, npub: [nonce_length]u8, k: [key_length]u8) void
Parameters
c: []u8
m: []const u8
npub: [nonce_length]u8
k: [key_length]u8
Source
pub fn seal(c: []u8, m: []const u8, npub: [nonce_length]u8, k: [key_length]u8) void {
debug.assert(c.len == tag_length + m.len);
XSalsa20Poly1305.encrypt(c[tag_length..], c[0..tag_length], m, "", npub, k);
}