LAWS.bend open laws/TODOs
raw source on the hub · import bend-osdev-aria@0.1.0.0/LAWS.bend as LAWS
Laws about ARIA (aria.bend): for every key (every key size) and block, decryption undoes encryption and encryption undoes decryption; and RFC 5794 A.1 and a refused key, proved by computation.
5 imports
import Base import bend-osdev-bytes@0.1.1.0/bytes.bend as B import bend-osdev-mode-core@0.1.0.0/mode_core.bend as M import bend-osdev-cipher-core@0.1.0.0/cipher_core.bend as L import ./aria.bend as A
Laws
law aria_round_trip provedin PROOF.bendsource · line 12 · raw
@k:0x95803fe526050e79fb3df1e14165eb7c/aria.LcAriaKey -> @+b:0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock -> {0x95803fe526050e79fb3df1e14165eb7c/aria.LcAria.decrypt(k, 0x95803fe526050e79fb3df1e14165eb7c/aria.LcAria.encrypt(k, b)) == b : 0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock}
law aria_round_trip_dual provedin PROOF.bendsource · line 17 · raw
@k:0x95803fe526050e79fb3df1e14165eb7c/aria.LcAriaKey -> @+b:0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock -> {0x95803fe526050e79fb3df1e14165eb7c/aria.LcAria.encrypt(k, 0x95803fe526050e79fb3df1e14165eb7c/aria.LcAria.decrypt(k, b)) == b : 0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock}
law aria_rfc5794 provedin PROOF.bendsource · line 29 · raw
{Result.map(&2, &2, 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcError, 0x95803fe526050e79fb3df1e14165eb7c/aria.LcAriaKey, 0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock, k => 0x95803fe526050e79fb3df1e14165eb7c/aria.LcAria.encrypt(k, 0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock{1122867, 1146447479, 2291772091, 3437096703}), 0x95803fe526050e79fb3df1e14165eb7c/aria.LcAria.key(0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets.of_list([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]))) == Done{0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock{3608738774, 2875477107, 2645122875, 3863287672}} : Result<&2, &2, 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcError, 0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock>}BEGIN GENERATED by gen/vectors.py: vectors RFC 5794, Appendix A.1: ARIA-128, key 000102030405060708090A0B0C0D0E0F, plaintext 00112233445566778899AABBCCDDEEFF, ciphertext D718FBD6AB644C739DA95F3BE6451778
law aria_bad_key_length provedin PROOF.bendsource · line 33 · raw
{Result.map(&2, &2, 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcError, 0x95803fe526050e79fb3df1e14165eb7c/aria.LcAriaKey, Unit, k => Unit{}, 0x95803fe526050e79fb3df1e14165eb7c/aria.LcAria.key(0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets.of_list([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]))) == Fail{0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcBadKeyLength{20n}} : Result<&2, &2, 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcError, Unit>}an ARIA key of 20 bytes is refused