OKlibrary  0.2.1.6
RoundFunction.mac
Go to the documentation of this file.
00001 /* Matthew Gwynne, 25.3.2011 (Swansea) */
00002 /* Copyright 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 
00022 oklib_include("OKlib/ComputerAlgebra/TestSystem/Lisp/Asserts.mac")$
00023 oklib_include("OKlib/ComputerAlgebra/Cryptology/Lisp/CryptoSystems/DataEncryptionStandard/Cipher.mac")$
00024 
00025 kill(f)$
00026 
00027 okltest_des_round(f) := block([plaintext],
00028   /* Trivial inputs (computed directly using des_round): */
00029   assert(
00030     binv2hexstr(
00031       f(hexstr2binv("00000000"),hexstr2binv("00000000"),
00032         hexstr2binv("000000000000"))) = "D8D8DBBC"),
00033   assert(
00034     binv2hexstr(
00035       f(
00036         take_l(32,des_validation_plain),
00037         take_l(32,des_validation_cipher),
00038         take_l(48,des_validation_key))) = "C19D2FDF"),
00039   true)$
00040