X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=host%2Fshavs_test.rb;h=767054339d3605b5acf27da3645d75e9794fbafa;hb=92725df162cf1ce83c4bd002fdaff69707e5f310;hp=3983b502164983a8731de00bd45ab13354dd91fb;hpb=b5a057d2dfa6b43f3850b3858c11a079eb9086f0;p=avr-crypto-lib.git
diff --git a/host/shavs_test.rb b/host/shavs_test.rb
index 3983b50..7670543 100644
--- a/host/shavs_test.rb
+++ b/host/shavs_test.rb
@@ -18,7 +18,7 @@
along with this program. If not, see .
=end
-
+$debug = false
require 'serialport'
@@ -29,7 +29,7 @@ def init_system
# print("DBG 0.0: ")
# print(line)
# sleep 1
- $sp.print("shavs_set a \r")
+ $sp.print("shavs_set #{$algo_select} \r")
# line = $sp.readlines()
# print("DBG 0.1: ")
# print(line)
@@ -44,7 +44,7 @@ def get_md
begin
line = $sp.gets()
line = "" if line==nil
-# puts("DBG g: "+line)
+ puts("DBG g: "+line) if $debug
end while not /[\s]*MD[\s]*=.*/.match(line)
return line
end
@@ -59,7 +59,7 @@ def run_test(filename)
begin
lb=file.gets()
end while not (file.eof or (/[\s]*Len[\s]*=.*/.match(lb)))
-# puts("DBG sending: "+lb);
+ puts("DBG sending: "+lb) if $debug
return if file.eof
$sp.print(lb.strip)
$sp.print("\r")
@@ -67,7 +67,7 @@ def run_test(filename)
lb=file.gets()
end while not (file.eof or (/[\s]*Msg[\s]*=.*/.match(lb)))
return if file.eof
-# puts("DBG sending: "+lb);
+ puts("DBG sending: "+lb) if $debug
$sp.print(lb.strip)
avr_md = get_md()
begin
@@ -84,9 +84,9 @@ def run_test(filename)
end
-if ARGV.size < 5
+if ARGV.size < 6
STDERR.print <