LAWS.essiv_round_trip_if: law of bend-osdev-aead@0.1.0.0 Import: import bend-osdev-aead@0.1.0.0/LAWS.bend as LAWS Lines 97-111 of bend-osdev-aead@0.1.0.0/LAWS.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-aead@0.1.0.0/LAWS.bend&start_line=97&end_line=111 import Base import bend-osdev-bytes@0.1.0.0/bytes.bend as B import bend-osdev-crypto@0.1.0.0/crypto.bend as Cr import bend-osdev-aead@0.1.0.0/essiv.bend as Es law essiv_round_trip_if: for ~KD: Data for ~KS: Data for ~Blk: Data for ~enc: KS -> Blk -> Blk for ~blk_of: B.Octets -> Maybe<&2, Blk> for ~blk_to: Blk -> B.Octets for ~cenc: KD -> B.Octets -> B.Octets -> Result<&2, &2, Cr.CrError, B.Octets> for ~cdec: KD -> B.Octets -> B.Octets -> Result<&2, &2, Cr.CrError, B.Octets> for +kd: KD for +ks: KS for +iv: B.Octets for +m: B.Octets for h: {Result.bind(&2, &2, Cr.CrError, B.Octets, B.Octets, cenc(kd, Es.AdEssiv.iv(~KD, ~KS, ~Blk, ~enc, ~blk_of, ~blk_to, Es.AdEssivKey{kd, ks}, iv), m), c => cdec(kd, Es.AdEssiv.iv(~KD, ~KS, ~Blk, ~enc, ~blk_of, ~blk_to, Es.AdEssivKey{kd, ks}, iv), c)) == Result.map(&2, &2, Cr.CrError, B.Octets, B.Octets, c => m, cenc(kd, Es.AdEssiv.iv(~KD, ~KS, ~Blk, ~enc, ~blk_of, ~blk_to, Es.AdEssivKey{kd, ks}, iv), m)) : Result<&2, &2, Cr.CrError, B.Octets>} {Result.bind(&2, &2, Cr.CrError, B.Octets, B.Octets, Es.AdEssiv.encrypt(~KD, ~KS, ~Blk, ~enc, ~blk_of, ~blk_to, ~cenc, Es.AdEssivKey{kd, ks}, iv, m), c => Es.AdEssiv.decrypt(~KD, ~KS, ~Blk, ~enc, ~blk_of, ~blk_to, ~cdec, Es.AdEssivKey{kd, ks}, iv, c)) == Result.map(&2, &2, Cr.CrError, B.Octets, B.Octets, c => m, Es.AdEssiv.encrypt(~KD, ~KS, ~Blk, ~enc, ~blk_of, ~blk_to, ~cenc, Es.AdEssivKey{kd, ks}, iv, m)) : Result<&2, &2, Cr.CrError, B.Octets>} Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe 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/essiv.bend&name=AdEssiv.decrypt https://jend.leeeet.dev/definition.txt?path=bend-osdev-aead@0.1.0.0/essiv.bend&name=AdEssiv.encrypt https://jend.leeeet.dev/definition.txt?path=bend-osdev-aead@0.1.0.0/essiv.bend&name=AdEssiv.iv https://jend.leeeet.dev/definition.txt?path=bend-osdev-aead@0.1.0.0/essiv.bend&name=AdEssivKey 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-crypto@0.1.0.0/crypto.bend&name=CrError