Twofish.LcTwofish.key_padded: def of bend-osdev-legacy-ciphers@0.1.0.0 Import: import bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend as Twofish Lines 358-362 of bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend&start_line=358&end_line=362 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 # a key of 1 to 32 bytes, zero-padded as the specification says def LcTwofish.key_padded(o: B.Octets) -> Result<&2, &2, L.LcError, LcTwofishKey>: +xs = B.Octets.to_list(o) +n = B.len(xs) tf.pad.pick(Bool.and(Nat.is_lt(0n, n), Nat.is_le(n, 16n)), Nat.is_le(n, 24n), Nat.is_le(n, 32n), n, xs) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.to_list https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=len https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend&name=LcError https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend&name=LcTwofishKey https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend&name=tf.pad.pick