5 This file is part of the AVR-Crypto-Lib.
6 Copyright (C) 2009 Daniel Otte (daniel.otte@rub.de)
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 === Twister-256 performance ===
29 nextBlock (cycles): 36535
30 lastBlock (cycles): 8071
31 ctx2hash (cycles): 19431
34 def process_hashfunction(fin, name)
36 m = lb.match(/hashsize \(bits\):[\s]*([\d]*)/)
38 printf("unexpected string %s\n", lb)
40 hashsize = m[1].to_i()
42 m = lb.match(/ctxsize \(bytes\):[\s]*([\d]*)/)
45 m = lb.match(/blocksize \(bits\):[\s]*([\d]*)/)
46 blocksize = m[1].to_i()
48 m = lb.match(/init \(cycles\):[\s]*([\d]*)/)
49 inittime = m[1].to_i()
51 m = lb.match(/nextBlock \(cycles\):[\s]*([\d]*)/)
52 nextblocktime = m[1].to_i()
54 m = lb.match(/lastBlock \(cycles\):[\s]*([\d]*)/)
55 lastblocktime = m[1].to_i()
57 m = lb.match(/ctx2hash \(cycles\):[\s]*([\d]*)/)
58 convtime = m[1].to_i()
60 printf("| %20s || %3s || %3s || || %4d || || %4d || %4d ||" +
61 " %6d || %6d || %7.2f || %6d || || || \n|-\n" ,
62 name, $lang, $lang ,ctxsize, hashsize, blocksize,
63 inittime, nextblocktime, nextblocktime.to_f/(blocksize/8),
64 lastblocktime+convtime)
70 $handlers["hashfunction"] = 1 #process_hashfunction
72 def process_file(fname)
73 fin = File.open(fname, "r")
75 $lang = "C" if fname.match(/_c.txt$/)
82 end while !m=lb.match(/=== (.*) performance ===/)
85 m = lb.match(/type:[\s]*([\w]*)/)
87 if $handlers[type] != 0
88 # handlers[type](fin, name)
89 process_hashfunction(fin, name)
91 printf("ERROR: unsupported type: %s !\n", type)
97 for i in (0..ARGV.size-1)