X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=host%2Fshavs_test.rb;h=896377b2ea0924045e35699b934eb899ea082c13;hb=591e3dc094fe411026c17f3b5a2f5f1a0500192c;hp=cba4dd4617fc4c05917c4ea1f4d12c45047a67c1;hpb=83398013d7fefe3600b771be65317a330a140ffb;p=avr-crypto-lib.git diff --git a/host/shavs_test.rb b/host/shavs_test.rb index cba4dd4..896377b 100644 --- a/host/shavs_test.rb +++ b/host/shavs_test.rb @@ -24,19 +24,23 @@ require 'rubygems' require 'serialport' def init_system - sleep 1 - $sp.print("echo off \r") - print("DBG i: " + "echo off \r"+"\n") if $debug +# sleep 1 + $sp.print("exit\r") + sleep 0.5 + $sp.print("exit\r") + sleep 0.5 + $sp.print("echo off \r") + print("DBG i: " + "echo off \r"+"\n") if $debug # line = $sp.readlines() # print("DBG 0.0: ") # print(line) -# sleep 1 - $sp.print("shavs_set #{$algo_select} \r") - print("DBG i: " + "shavs_set #{$algo_select} \r"+"\n") if $debug + sleep 1 + $sp.print("shavs_set #{$algo_select}\r") + print("DBG i: " + "shavs_set #{$algo_select} \r"+"\n") # if $debug # line = $sp.readlines() # print("DBG 0.1: ") # print(line) -# sleep 1 + sleep 1 $sp.print("shavs_test1 \r") print("DBG i: " + "shavs_test1 \r"+"\n") if $debug # line = $sp.readlines() @@ -48,17 +52,18 @@ def get_md begin line = $sp.gets() line = "" if line==nil - puts("DBG g: "+line) if $debug + puts("DBG got: "+line) if $debug && line!="" end while not /[\s]*MD[\s]*=.*/.match(line) return line end def send_md(md_string) + sleep(0.15) for i in 0..md_string.length-1 $sp.print(md_string[i].chr) # print("DBG s: "+ md_string[i].chr) if $debug - if(i%20==19) - sleep(0.1) + if(i%5==4) + sleep(0.15) end end end @@ -96,12 +101,13 @@ def run_test(filename) b.upcase! printf("\n%4d (%4d): ", line, (line-1)*$linewidth) if (pos%$linewidth==0 and $linewidth!=0) line += 1 if (pos%$linewidth==0 and $linewidth!=0) + sleep(1) #putc((a==b)?'*':'!') if(a==b) putc('*') else putc('!') - printf("\nshould: %s\ngot: %s\n",lb,avr_md) +# printf("\nshould: %s\ngot: %s\n",lb,avr_md) nerrors += 1 end pos += 1