def err
bend-osdev-aead@0.1.0.0 · check.bend:36
import bend-osdev-aead@0.1.0.0/check.bend as Check
import Base
import bend-osdev-crypto@0.1.0.0/crypto.bend as Cr
36def err(e: Cr.CrError) -> String:
37 match e:
38 case Cr.CrBadKeyLength{n}:
39 cat("bad key length ", Nat.show(n))
40 case Cr.CrBadIvLength{n}:
41 cat("bad iv length ", Nat.show(n))
42 case Cr.CrBadNonceLength{n}:
43 cat("bad nonce length ", Nat.show(n))
44 case Cr.CrNotBlockMultiple{n}:
45 cat("not whole blocks ", Nat.show(n))
46 case Cr.CrTagMismatch{}:
47 "tag mismatch"
48 case Cr.CrTooShort{n}:
49 cat("too short ", Nat.show(n))
50 case _:
51 "other error"