// A ChaCha20-Poly1305 key is 32 bytes: another length stops the actor, on // both backends (ADR 0071). import std/bytes import std/crypto import std/io import std/string pub fn main :: -> () / { let key = bytes.from_string (string.repeat "k" 32) let nonce = bytes.from_string (string.repeat "n" 12) let message = bytes.from_string "m" io.println "{bytes.length (crypto.chacha20_poly1305_seal key nonce message message)}" let short = bytes.slice key 0 31 io.println "never printed {bytes.length (crypto.chacha20_poly1305_seal short nonce message message)}" } //> 17 //! panic: crypto: a ChaCha20-Poly1305 key is 32 bytes, not 31