PROOF.echainiv_r: def of bend-osdev-aead@0.1.0.0 Import: import bend-osdev-aead@0.1.0.0/PROOF.bend as PROOF Lines 197-204 of bend-osdev-aead@0.1.0.0/PROOF.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-aead@0.1.0.0/PROOF.bend&start_line=197&end_line=204 import Base import bend-osdev-bytes@0.1.0.0/bytes.bend as B import bend-osdev-bytes@0.1.0.0/LAWS.bend as BL import bend-osdev-crypto@0.1.0.0/crypto.bend as Cr import bend-osdev-aead@0.1.0.0/echainiv.bend as Ec def echainiv_r(~KA: Data, ~KC: Data, ~open: KA -> B.Octets -> B.Octets -> B.Octets -> Result<&2, &2, Cr.CrError, B.Octets>, ~ivlen: Nat, +ka: KA, +kc: KC, +salt: B.Octets, +seq: B.Octets, +iv: B.Octets, +aad: B.Octets, +p: B.Octets, r: Result<&2, &2, Cr.CrError, B.Octets>, hl: {B.Octets.len(iv) == ivlen : Nat}, h: {Result.bind(&2, &2, Cr.CrError, B.Octets, B.Octets, r, c => open(ka, iv, B.Octets.append(aad, iv), c)) == Result.map(&2, &2, Cr.CrError, B.Octets, B.Octets, c => p, r) : Result<&2, &2, Cr.CrError, B.Octets>}) -> {Result.bind(&2, &2, Cr.CrError, B.Octets, B.Octets, Result.map(&2, &2, Cr.CrError, B.Octets, B.Octets, c => B.Octets.append(iv, c), r), c => Ec.AdEchainiv.open(~KA, ~KC, ~open, ~ivlen, Ec.AdEchainivKey{ka, kc, salt}, seq, aad, c)) == Result.map(&2, &2, Cr.CrError, B.Octets, B.Octets, c => p, Result.map(&2, &2, Cr.CrError, B.Octets, B.Octets, c => B.Octets.append(iv, c), r)) : Result<&2, &2, Cr.CrError, B.Octets>}: match r: case Fail{e}: {==} case Done{+c}: %hl : {Ec.ad.ec.open.go(~KA, ~KC, ~open, Ec.AdEchainivKey{ka, kc, salt}, aad, B.Octets.len(B.Octets.append(iv, c)), B.Octets.split_at(_, B.Octets.append(iv, c))) == Done{p} : Result<&2, &2, Cr.CrError, B.Octets>} %Equal.sym(Maybe<&2, B.OctetsSplit>, B.Octets.split_at(B.Octets.len(iv), B.Octets.append(iv, c)), Some{B.OctetsSplit{iv, c}}, BL.octets_split_at_append(iv, c)) : {Ec.ad.ec.open.go(~KA, ~KC, ~open, Ec.AdEchainivKey{ka, kc, salt}, aad, B.Octets.len(B.Octets.append(iv, c)), _) == Done{p} : Result<&2, &2, Cr.CrError, B.Octets>} h Uses (16): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result.map https://jend.leeeet.dev/definition.txt?path=bend-osdev-aead@0.1.0.0/echainiv.bend&name=AdEchainiv.open https://jend.leeeet.dev/definition.txt?path=bend-osdev-aead@0.1.0.0/echainiv.bend&name=AdEchainivKey https://jend.leeeet.dev/definition.txt?path=bend-osdev-aead@0.1.0.0/echainiv.bend&name=ad.ec.open.go https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/LAWS.bend&name=octets_split_at_append 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.append https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.len https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.split_at https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=OctetsSplit https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/crypto.bend&name=CrError