3
##before this script, you should make sure all kinds of context already loaded
8
ctx_count=`ls |grep -c context_load`
9
if [ $ctx_count -le 1 ];then
10
echo "we should execute test_algs.sh first!"
15
rm test_algs_encryptdecrypt_*.log
17
#for halg_p in 0x0004 0x000B 0x000C 0x000D 0x0012
18
for context_p in `ls context_load*`
21
./tpm2_encryptdecrypt -c $context_p -D NO -I secret.data -o endecrypt_"$context_p".f
25
echo "encryptdecrypt for endecrypt_"$context_p".f fail, please check the environment or parameters!"
26
echo "encryptdecrypt for endecrypt_"$context_p".f fail" >>test_encryptdecrypt_error.log
28
echo "encryptdecrypt for endecrypt_"$context_p".f pass" >>test_encryptdecrypt_pass.log
29
./tpm2_encryptdecrypt -c $context_p -D YES -I endecrypt_"$context_p".f -o decrypt_"$context_p".f
32
echo "encryptdecrypt for decrypt_"$context_p".f fail, please check the environment or parameters!"
33
echo "encryptdecrypt for decrypt_"$context_p".f fail" >>test_encryptdecrypt_error.log
35
echo "encryptdecrypt for decrypt_"$context_p".f pass" >>test_encryptdecrypt_pass.log