OKlibrary  0.2.1.6
general.hpp
Go to the documentation of this file.
```00001 // Matthew Gwynne, 13.2.2012 (Swansea)
00002 /* Copyright 2012, 2013 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
00079 maxima> Round_anf : lappend(map(lambda([v,C], cons(adjoin(v,map("-",C)),create_list({-v,l},l,listify(C)))),[10,11,12,13,14,15,16,17,18,19,20],[{4,6},{4,8},{5,6},{5,8},{6,7},{7,8},{11,7},{11,6},{20,7},{20,6},{4,5}]))\$
00080 maxima> Round_par_anf : append(
00081               fullxoreqs_wv_fcl(4,1,[1,2,3,7,21])[2],
00082               fullxoreqs_wv_fcl(4,1,[8,10,11,12,22])[2],
00083               fullxoreqs_wv_fcl(4,1,[13,14,15,16,23])[2],
00084               fullxoreqs(3,1,[17,18,19,24])[2],
00085               fullxoreqs_wv_fcl(4,1,[21,22,23,24,9])[2]);
00086 XXX Apparently each fullxoreqs_wv_fcl(m,1,L) just expresses that the first
00087     variable in L is equal to all the others ???
00088 XXX
00089 maxima> Round_anf : append(Round_anf,Round_par_anf);
00090 maxima> statistics_cs(Round_anf);
00091  [24,105,429,5,2]
00092 /* Checking we compute the right function: */
00093 maxima> for C in Round_CNF[2] do assert(ucp_0_cs(apply_pa_cs(comp_sl(C),setify(Round_anf))) = {{}});
00094  done
00095 maxima> for C in Round_DNF[2] do assert(ucp_0_cs(apply_pa_cs(C,setify(Round_anf))) = {});
00096  done
00097  /* Computing a lower-bound on the hardness, the hardness w.r.t the prime
00098     implicates on the original variables: */
00099  maxima> hardness_wpi_cs(setify(NLF_nv), setify(Round_primes[2]));
00100  2
00101    \endverbatim
00102    So the ANF representation used has a higher hardness, and is also a larger
00103    representation. The minimum 1-base above should be a much better representation
00104    of the KeeLoq round function. </li>
00105    <li> KeeLoq should be implemented at the Maxima level, and then translated,
00106    so that we can compare these translations. </li>
00107   </ul>
00108
00109 */
```