Function box_stream::crypto::encrypt_packet
[−]
[src]
pub unsafe fn encrypt_packet(
out: *mut u8,
plain_packet: *const u8,
packet_len: u16,
encryption_key: &[u8; 32],
nonce: &mut [u8; 24]
)
Writes the encrypted header and payload for a given plaintext packet into out
.
out
must be a pointer to at least CYPHER_HEADER_SIZE + packet_len
bytes.
packet_len
must be at most MAX_PACKET_SIZE