def err

bend-osdev-crypto@0.1.0.0 · check.bend:81

import bend-osdev-crypto@0.1.0.0/check.bend as Check
import Base
import bend-osdev-crypto@0.1.0.0/crypto.bend as Cr

81def err(e: Cr.CrError) -> String:
82  match e:
83    case Cr.CrBadKeyLength{n}:
84      cat("bad key length ", Nat.show(n))
85    case Cr.CrBadIvLength{n}:
86      cat("bad iv length ", Nat.show(n))
87    case Cr.CrNotBlockMultiple{n}:
88      cat("not whole blocks ", Nat.show(n))
89    case Cr.CrBadBlockSize{n}:
90      cat("bad block size ", Nat.show(n))
91    case Cr.CrTagMismatch{}:
92      "tag mismatch"
93    case Cr.CrBadOutputLength{n}:
94      cat("bad output length ", Nat.show(n))
95    case Cr.CrTooShort{n}:
96      cat("too short ", Nat.show(n))
97    case _:
98      "other error"

Uses (4)

Used by (3)