The XSalsa stream cipher, combined with the Poly1305 MAC

Functions

fn decrypt(m: []u8, c: []const u8, tag: [tag_length]u8, ad: []const u8, npub: [nonce_length]u8, k: [key_length]u8) AuthenticationError!void

m: message: output buffer should be of size c.len c: ciphertext tag: authentic…

m: message: output buffer should be of size c.len c: ciphertext tag: authentication tag ad: Associated Data npub: public nonce k: private key

fn encrypt(c: []u8, tag: *[tag_length]u8, m: []const u8, ad: []const u8, npub: [nonce_length]u8, k: [key_length]u8) void

c: ciphertext: output buffer should be of size m.len tag: authentication tag: o…

c: ciphertext: output buffer should be of size m.len tag: authentication tag: output MAC m: message ad: Associated Data npub: public nonce k: private key

Values

key_length
undefined

Key length in bytes.

nonce_length
undefined

Nonce length in bytes.

tag_length
comptime_int

Authentication tag length in bytes.