package crypto import ( "crypto/rand" "io" "log/slog" "os" ) func NewSalt() [16]byte { salt := [16]byte{} if _, err := io.ReadFull(rand.Reader, salt[:]); err != nil { slog.Error("crypto: failed to read salt", "error", err) os.Exit(1) } return salt } func NewNonce() [12]byte { nonce := [12]byte{} if _, err := io.ReadFull(rand.Reader, nonce[:]); err != nil { slog.Error("crypto: failed to read nonce", "error", err) os.Exit(1) } return nonce }