def LcAria.key

bend-osdev-legacy-ciphers@0.1.0.0 · aria.bend:4604

import bend-osdev-legacy-ciphers@0.1.0.0/aria.bend as Aria
import Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend as L

4604# a key of 16, 24 or 32 bytes (ARIA-128, -192, -256, by its length)
4605def LcAria.key(o: B.Octets) -> Result<&2, &2, L.LcError, LcAriaKey>:
4606  +xs = B.Octets.to_list(o)
4607  +n = B.len(xs)
4608  aria.key.pick(Bool.or(Nat.is_eq(n, 16n), Bool.or(Nat.is_eq(n, 24n), Nat.is_eq(n, 32n))), Nat.is_eq(n, 16n), Nat.is_eq(n, 24n), n, xs)

Uses (9)

Used by (5)