open
Verify and decrypt a message using a recipient's secret key public_key and a sender's public_key.
Function parameters
Parameters
- m:[]u8
- c:[]const u8
- npub:[nonce_length]u8
- public_key:[public_length]u8
- secret_key:[secret_length]u8
The XSalsa stream cipher, combined with the Poly1305 MAC
Types
- XSalsa20Poly1305
- The XSalsa stream cipher, combined with the Poly1305 MAC
- SecretBox
- NaCl-compatible secretbox API.
- Box
- NaCl-compatible box API.
- SealedBox
- libsodium-compatible sealed boxes
The Salsa stream cipher.
Functions
Source
Implementation
pub fn open(m: []u8, c: []const u8, npub: [nonce_length]u8, public_key: [public_length]u8, secret_key: [secret_length]u8) (IdentityElementError || WeakPublicKeyError || AuthenticationError)!void {
const shared_key = try createSharedSecret(public_key, secret_key);
return SecretBox.open(m, c, npub, shared_key);
}