AES-VariableTextTest.mws

AES - Variable Text test

İMike May, S.J., 2002, maymk@slu.edu

>    restart;

When Daeman and Rijmen submitted Rijndael to be AES, there were a number of known answer files submitted so that implementers could test if the implementation was correct.  In this worksheet we look at the Variable Text test.

>    read `AES.m`;

The AES.m file was created by the AES-Expansion worksheet and placed in the current directory.  If it has been misplaced, it will need to be recreated.

From the file AES.m we have loaded the following sets of commands:

Data Type Conversion commands - intToBits, bitToList, listToPoly, polyToInt, hexTo8Bits, listToBits, bitToInt, listToInt, listToInt, polyToList, intToHex, polyToBits, bitToPoly, intToPoly, listToMatrix, listToMatrix2, matrixToList, matrixToList2, matrixToHex,

Constants - genPoly, MixMat, InvMixMat,

Commands to XOR pairs of strings - XOR, xorNbits, xor8,

Commands and constants for generating SBoxes or expanding keys - SBoxTable, InvSBoxTable, roundFudge, polyToInt, roundFudgeWord, randKeyGenerator, keyExpander,

Commands for the 4 operations that compose a round - BS, InvBS, SR, InvSR, MC, InvMC, ARK,

Single line encryption and decryption commands - encryptAESascii, decryptAESascii, encryptAEShex, decryptAEShex, intTo128Bits, testline, testline2, hexKeyExpander, messExpander, encryptAESExpanded, decryptAESExpanded..

>    testline(0);

>   

For the variable text test we use the same key, the zero word, to encrypt a series of words, each of which is all zeroes except for a single bit.  We then look at the encrypted words.  The results below are from the official entry by Daeman.

KEY=00000000000000000000000000000000

PT=80000000000000000000000000000000 CT=3AD78E726C1EC02B7EBFE92B23D9EC34
PT=40000000000000000000000000000000 CT=45BC707D29E8204D88DFBA2F0B0CAD9B
PT=20000000000000000000000000000000 CT=161556838018F52805CDBD6202002E3F
PT=10000000000000000000000000000000 CT=F5569B3AB6A6D11EFDE1BF0A64C6854A
PT=08000000000000000000000000000000 CT=64E82B50E501FBD7DD4116921159B83E
PT=04000000000000000000000000000000 CT=BAAC12FB613A7DE11450375C74034041
PT=02000000000000000000000000000000 CT=BCF176A7EAAD8085EBACEA362462A281
PT=01000000000000000000000000000000 CT=47711816E91D6FF059BBBF2BF58E0FD3
PT=00800000000000000000000000000000 CT=B970DFBE40698AF1638FE38BD3DF3B2F
PT=00400000000000000000000000000000 CT=F95B59A44F391E14CF20B74BDC32FCFF
PT=00200000000000000000000000000000 CT=720F74AE04A2A435B9A7256E49378F5B
PT=00100000000000000000000000000000 CT=2A0445F61D36BFA7E277070730CF76DA
PT=00080000000000000000000000000000 CT=8D0536B997AEFEC1D94011BAB6699A03
PT=00040000000000000000000000000000 CT=674F002E19F6ED47EFF319E51FAD4498
PT=00020000000000000000000000000000 CT=292C02C5CB9163C80AC0F6CF1DD8E92D
PT=00010000000000000000000000000000 CT=FA321CF18EF5FE727DD82A5C1E945141
PT=00008000000000000000000000000000 CT=A5A7AFE1034C39CCCEBE3C584BC0BE05
PT=00004000000000000000000000000000 CT=4FF5A52E697E77D081205DBDB21CEA39
PT=00002000000000000000000000000000 CT=209E88DC94C9003000CE0769AF7B7166
PT=00001000000000000000000000000000 CT=5DEE41AF864CB4B650E5F51551824D38
PT=00000800000000000000000000000000 CT=A79A63FA7E4503AE6D6E09F5F9053030
PT=00000400000000000000000000000000 CT=A48316749FAE7FAC7002031A6AFD8BA7
PT=00000200000000000000000000000000 CT=D6EEE8A7357A0E1D64262CA9C337AC42
PT=00000100000000000000000000000000 CT=B013CA8A62A858053E9FB667ED39829E
PT=00000080000000000000000000000000 CT=DF6EA9E4538A45A52D5C1A43C88F4B55
PT=00000040000000000000000000000000 CT=7D03BA451371591D3FD5547D9165C73B
PT=00000020000000000000000000000000 CT=0E0426281A6277E186499D365D5F49FF
PT=00000010000000000000000000000000 CT=DBC02169DD2059E6CC4C57C1FEDF5AB4
PT=00000008000000000000000000000000 CT=826590E05D167DA6F00DCC75E22788EB
PT=00000004000000000000000000000000 CT=34A73F21A04421D9786335FAAB49423A
PT=00000002000000000000000000000000 CT=ED347D0E0128EE1A7392A1D36AB78AA9
PT=00000001000000000000000000000000 CT=EE944B2FE6E9FC888042608DA9615F75

>    for intVal from 1 to 32 do testline(128-intVal) end do:

Clearly, it is working correctly.

>