diff options
author | Jack Lloyd <[email protected]> | 2016-01-01 10:23:03 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-01-01 10:23:03 -0500 |
commit | af765b82f8def8045e93db09ae6babec65bfb8e6 (patch) | |
tree | 0e947c4bc74ce500da370fc6c081a1d38e8d363b /src/scripts/comba.py | |
parent | 48373ed56c5553a5b0be95cd945a12a6684c4afe (diff) |
Prettify mp_comba a bit
Aligning the calls makes it easier to read the index travel
Add a date to the generated output file
Diffstat (limited to 'src/scripts/comba.py')
-rwxr-xr-x | src/scripts/comba.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/scripts/comba.py b/src/scripts/comba.py index f0165a3ce..2fa95fb24 100755 --- a/src/scripts/comba.py +++ b/src/scripts/comba.py @@ -1,8 +1,9 @@ #!/usr/bin/python2 import sys +import datetime -# (C) 2011,2014,2015 Jack Lloyd +# (C) 2011,2014,2015,2016 Jack Lloyd # Botan is released under the Simplified BSD License (see license.txt) # Used to generate src/lib/math/mp/mp_comba.cpp @@ -64,7 +65,7 @@ def comba_square_code(N): for (rnd,idx) in zip(range(0, len(indexes)), indexes): for (i,pair) in zip(range(0, len(idx)), idx): if pair[0] == pair[1]: - print " word3_muladd(&%s, &%s, &%s, x[%2d], x[%2d]);" % (w2, w1, w0, pair[0], pair[1]) + print " word3_muladd (&%s, &%s, &%s, x[%2d], x[%2d]);" % (w2, w1, w0, pair[0], pair[1]) elif i % 2 == 0: print " word3_muladd_2(&%s, &%s, &%s, x[%2d], x[%2d]);" % (w2, w1, w0, pair[0], pair[1]) @@ -82,7 +83,7 @@ def main(args = None): print """/* * Comba Multiplication and Squaring * -* This file was automatically generated by comba.py +* This file was automatically generated by %s on %s * * Botan is released under the Simplified BSD License (see license.txt) */ @@ -91,7 +92,7 @@ def main(args = None): #include <botan/internal/mp_asmi.h> namespace Botan { -""" +""" % (sys.argv[0], datetime.date.today().strftime("%Y-%m-%d")) for n in [4,6,8,9,16]: print "/*\n* Comba %dx%d Squaring\n*/" % (n, n) |