Blowfish.LcBlowfish.key_any: def of bend-osdev-legacy-ciphers@0.1.0.0 Import: import bend-osdev-legacy-ciphers@0.1.0.0/blowfish.bend as Blowfish Lines 369-374 of bend-osdev-legacy-ciphers@0.1.0.0/blowfish.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/blowfish.bend&start_line=369&end_line=374 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 72 bytes: the key schedule takes up to 72 (18 words of P), # and some test sets use keys shorter than 4 bytes def LcBlowfish.key_any(o: B.Octets) -> Result<&2, &2, L.LcError, LcBlowfishKey>: +xs = B.Octets.to_list(o) +n = B.len(xs) bf.key.pick(Bool.and(Nat.is_le(1n, n), Nat.is_le(n, 72n)), xs) Uses (9): 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=Result https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.1/bytes.bend&name=Octets https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.1/bytes.bend&name=Octets.to_list https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.1/bytes.bend&name=len https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/blowfish.bend&name=LcBlowfishKey https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/blowfish.bend&name=bf.key.pick https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend&name=LcError