AESEncryptProof.successful_encrypt_preserves_length: def of qasim-bend-kit@0.1.0.2 Import: import qasim-bend-kit@0.1.0.2/proof/AES_EncryptProof.bend as AESEncryptProof Lines 197-227 of qasim-bend-kit@0.1.0.2/proof/AES_EncryptProof.bend: https://jend.leeeet.dev/read.txt?path=qasim-bend-kit@0.1.0.2/proof/AES_EncryptProof.bend&start_line=197&end_line=227 import Base import qasim-bend-kit@0.1.0.2/libs/AES256GCM.bend as AES def successful_encrypt_preserves_length(+key: AES.SecretKey, +nonce: AES.Nonce, +aad: List<&2, U32>, +plaintext: List<&2, U32>, +envelope: AES.Envelope, +encrypted: {AES.encrypt(key, nonce, aad, plaintext) == Done{envelope} : Result<&2, &2, AES.Error, AES.Envelope>}) -> {List.length(&2, U32, AES.ciphertext(envelope)) == List.length(&2, U32, plaintext) : Nat}: +aad_flag = AES.aad_valid(aad) +plaintext_flag = AES.plaintext_valid(plaintext) aad_is_true = successful_encrypt_aad_valid(key, nonce, aad, plaintext, aad_flag, plaintext_flag, {==}, {==}, envelope, encrypted) plaintext_is_true = successful_encrypt_plaintext_valid(key, nonce, aad, plaintext, aad_flag, plaintext_flag, {==}, {==}, envelope, encrypted) checked = encrypt_checked_with_flags(key, nonce, aad, plaintext, True{}, True{}, aad_is_true, plaintext_is_true, envelope, encrypted) output_length = valid_output_ciphertext_length(key, nonce, aad, plaintext) Equal.trans(Nat, List.length(&2, U32, AES.ciphertext(envelope)), result_ciphertext_length( AES.encrypt_checked(key, nonce, aad, plaintext, True{}, True{})), List.length(&2, U32, plaintext), Equal.sym(Nat, result_ciphertext_length( AES.encrypt_checked(key, nonce, aad, plaintext, True{}, True{})), result_ciphertext_length(Done{envelope}), Equal.cong(Result<&2, &2, AES.Error, AES.Envelope>, Nat, result => result_ciphertext_length(result), AES.encrypt_checked(key, nonce, aad, plaintext, True{}, True{}), Done{envelope}, checked)), output_length) Uses (23): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.cong https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.trans https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.length 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=U32 https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/AES256GCM.bend&name=Envelope https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/AES256GCM.bend&name=Error https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/AES256GCM.bend&name=Nonce https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/AES256GCM.bend&name=SecretKey https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/AES256GCM.bend&name=aad_valid https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/AES256GCM.bend&name=ciphertext https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/AES256GCM.bend&name=encrypt https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/AES256GCM.bend&name=encrypt_checked https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/AES256GCM.bend&name=plaintext_valid https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/proof/AES_EncryptProof.bend&name=encrypt_checked_with_flags https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/proof/AES_EncryptProof.bend&name=result_ciphertext_length https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/proof/AES_EncryptProof.bend&name=successful_encrypt_aad_valid https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/proof/AES_EncryptProof.bend&name=successful_encrypt_plaintext_valid https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/proof/AES_EncryptProof.bend&name=valid_output_ciphertext_length