Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. #!/bin/sh
  2. START=0
  3. END=9
  4. LOOP=10
  5. PASS=0
  6. for i in $(seq 0 $LOOP)
  7. do
  8. LEN=$(awk '/Len =/ { print $3; exit;}' ../../Tests/shabittestvectors/SHA1ShortMsg.rsp)
  9. MSG=$(awk '/Msg =/ { print $3; exit; }' ../../Tests/shabittestvectors/SHA1ShortMsg.rsp)
  10. MD=$(awk '/MD =/ { print $3; exit; }' ../../Tests/shabittestvectors/SHA1ShortMsg.rsp)
  11.  
  12. echo $LEN
  13. echo $MSG
  14. MD=${MD:0:-1}
  15. CIPHER=$(./cyassl hash -sha -i $MSG -l $LEN)
  16. echo $MD
  17. echo $CIPHER
  18.  
  19. if [ $MD == $CIPHER ]; then
  20. echo "PASSED"
  21. PASS=$[PASS + 1]
  22. echo $PASS
  23. fi
  24. done
  25. if [ $PASS == $[LOOP+1] ]; then
  26. echo "All Tests Successful"
  27. fi
  28.  
  29. Len = 0
  30. Msg = 00
  31. MD = da39a3ee5e6b4b0d3255bfef95601890afd80709
  32.  
  33. Len = 1
  34. Msg = 00
  35. MD = bb6b3e18f0115b57925241676f5b1ae88747b08a
  36.  
  37. Len = 2
  38. Msg = 40
  39. MD = ec6b39952e1a3ec3ab3507185cf756181c84bbe2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement