OKlibrary  0.2.1.6
SmallScaleAdvancedEncryptionStandard.mac
Go to the documentation of this file.
00001 /* Matthew Gwynne, 28.1.2010 (Swansea) */
00002 /* Copyright 2010, 2011 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007 
00021 oklib_include("OKlib/ComputerAlgebra/Cryptology/Lisp/CryptoSystems/Rijndael/SmallScaleAdvancedEncryptionStandard.mac")$
00022 oklib_include("OKlib/ComputerAlgebra/Cryptology/Lisp/CryptoSystems/Rijndael/tests/SmallScaleAdvancedEncryptionStandard.mac")$
00023 
00024 
00025 /* **************************************
00026    * Special bit-linear byte operations *
00027    **************************************
00028 */
00029 
00030 okltest_ss_sbox_linmap_gen(ss_sbox_linmap_gen);
00031 okltest_ss_mul_w_sbox_linmap_gen(ss_mul_w_sbox_linmap_gen);
00032 
00033 /* *********
00034    * S box *
00035    *********
00036 */
00037 
00038 okltest_ss_sbox_gen(ss_sbox_gen);
00039 okltest_ss_inv_sbox_gen(ss_inv_sbox_gen);
00040 
00041 okltest_ss_sbox_bf(ss_sbox_bf);
00042 okltest_ss_sbox_w_add_bf(ss_sbox_w_add_bf);
00043 okltest_ss_sbox_w_mul_bf(ss_sbox_w_mul_bf);
00044 
00045 /* *************
00046    * Sub-bytes *
00047    *************
00048 */
00049 
00050 okltest_ss_subbytes(ss_subbytes);
00051 okltest_ss_inv_subbytes(ss_inv_subbytes);
00052 
00053 /* **************
00054    * Shift rows *
00055    **************
00056 */
00057 
00058 okltest_ss_shiftrows(ss_shiftrows);
00059 okltest_ss_inv_shiftrows(ss_inv_shiftrows);
00060 
00061 
00062 /* ***************
00063    * Mix columns *
00064    ***************
00065 */
00066 
00067 okltest_ss_mixcolumn_gen(ss_mixcolumn_gen);
00068 okltest_ss_mixcolumn_gen_bf(ss_mixcolumn_gen_bf);
00069 okltest_ss_mixcolumn_gen_boolm(ss_mixcolumn_gen_boolm);
00070 okltest_ss_round_column_gen_bf(ss_round_column_gen_bf);
00071 okltest_ss_inv_mixcolumn_gen(ss_inv_mixcolumn_gen);
00072 
00073 
00074 okltest_ss_mixcolumns_gen(ss_mixcolumns_gen);
00075 okltest_ss_inv_mixcolumns_gen(ss_inv_mixcolumns_gen);
00076 
00077 
00078 /* *****************
00079    * Key expansion *
00080    *****************
00081 */
00082 
00083 okltest_ss_key_expansion_gen(ss_key_expansion_gen); 
00084 
00085 /* *********************************
00086    * AES encryption and decryption *
00087    *********************************
00088 */
00089 
00090 okltest_ss_round_gen(ss_round_gen);
00091 okltest_ss_inv_round_gen(ss_inv_round_gen);
00092 okltest_ss_encrypt_wf_gen(ss_encrypt_wf_gen);
00093 okltest_ss_decrypt_wf_gen(ss_decrypt_wf_gen);
00094 okltest_ss_encrypt_gen(ss_encrypt_gen);
00095 okltest_ss_decrypt_gen(ss_decrypt_gen);
00096 
00097 /* **********************************************************
00098    * Small scale AES encryption as an iterated block cipher *
00099    **********************************************************
00100 */
00101 
00102 okltest_ss_encrypt_gen(ss_encrypt_ibc_gen);
00103 
00104 /* **********************************************************
00105    * Small scale AES instantiations                         *
00106    **********************************************************
00107 */
00108 
00109 okltest_ss_encrypt(ss_encrypt);
00110 okltest_ss_encrypt(ss_encrypt_ibc);
00111 okltest_ss_encrypt_wf(ss_encrypt_wf);
00112 okltest_ss_decrypt(ss_decrypt);
00113 okltest_ss_decrypt_wf(ss_decrypt_wf);
00114 
00115 okltest_ss_encrypt_natl(ss_encrypt_natl);
00116 okltest_ss_decrypt_natl(ss_decrypt_natl);
00117 okltest_ss_encrypt_bin(ss_encrypt_bin);
00118 okltest_ss_decrypt_bin(ss_decrypt_bin);
00119 okltest_ss_encrypt_hex(ss_encrypt_hex);
00120 okltest_ss_decrypt_hex(ss_decrypt_hex);
00121