Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- START=0
- END=9
- LOOP=10
- PASS=0
- for i in $(seq 0 $LOOP)
- do
- LEN=$(awk '/Len =/ { print $3; exit;}' ../../Tests/shabittestvectors/SHA1ShortMsg.rsp)
- MSG=$(awk '/Msg =/ { print $3; exit; }' ../../Tests/shabittestvectors/SHA1ShortMsg.rsp)
- MD=$(awk '/MD =/ { print $3; exit; }' ../../Tests/shabittestvectors/SHA1ShortMsg.rsp)
- echo $LEN
- echo $MSG
- MD=${MD:0:-1}
- CIPHER=$(./cyassl hash -sha -i $MSG -l $LEN)
- echo $MD
- echo $CIPHER
- if [ $MD == $CIPHER ]; then
- echo "PASSED"
- PASS=$[PASS + 1]
- echo $PASS
- fi
- done
- if [ $PASS == $[LOOP+1] ]; then
- echo "All Tests Successful"
- fi
- Len = 0
- Msg = 00
- MD = da39a3ee5e6b4b0d3255bfef95601890afd80709
- Len = 1
- Msg = 00
- MD = bb6b3e18f0115b57925241676f5b1ae88747b08a
- Len = 2
- Msg = 40
- MD = ec6b39952e1a3ec3ab3507185cf756181c84bbe2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement