# @name Crypto AES Tests
# @desc Run tcrypt module to exercise AES HW crypto operations
# @requires (crypto/crypto-omap && crypto/crypto-omap/aes) || crypto/sa2ul/aes || crypto/dthev2/aes
# @setup_requires 

CRYPTO_S_PERF_AES source 'common.sh'; config_options=`get_modular_config_names.sh crypto`; check_config_options "ym" CONFIG_CRYPTO_HW $config_options; check_config_options "m" CONFIG_CRYPTO_TEST; echo /dev/null>/var/log/messages; crypto_ip=`get_crypto_ip.sh`; PRE=`get_crypto_int_count.sh $crypto_ip`; echo "PRE is $PRE"; modprobe tcrypt mode=500 sec=1; POST=`get_crypto_int_count.sh $crypto_ip`; echo "POST is $POST"; [[ $POST -gt  $(( $PRE+17000 )) ]]|| die "IRQ count did not increase, no hardware crypto, looking for irq number $IRQ_NUM, initial count $PRE, final count $POST";crypto_test.sh

CRYPTO_L_PERF_AES source 'common.sh'; config_options=`get_modular_config_names.sh crypto`; check_config_options "ym" CONFIG_CRYPTO_HW $config_options; check_config_options "m" CONFIG_CRYPTO_TEST; echo /dev/null>/var/log/messages; crypto_ip=`get_crypto_ip.sh`; PRE=`get_crypto_int_count.sh $crypto_ip`; modprobe tcrypt mode=500 sec=30; POST=`get_crypto_int_count.sh $crypto_ip`; [[ $POST -gt $(( $PRE+17000 )) ]]|| die "IRQ count did not increase, no hardware crypto, looking for irq number $IRQ_NUM, initial count $PRE, final count $POST";crypto_test.sh

CRYPTO_S_PERF_AES-GCM source 'common.sh'; config_options=`get_modular_config_names.sh crypto`; check_config_options "ym" CONFIG_CRYPTO_HW $config_options; check_config_options "m" CONFIG_CRYPTO_TEST; echo /dev/null>/var/log/messages; crypto_ip=`get_crypto_ip.sh`; PRE=`get_crypto_int_count.sh $crypto_ip`; modprobe tcrypt mode=211 sec=1; POST=`get_crypto_int_count.sh $crypto_ip`; [[ $POST -gt  $(( $PRE+17000 )) ]]|| die "IRQ count did not increase, no hardware crypto, looking for irq number $IRQ_NUM, initial count $PRE, final count $POST";crypto_test.sh

CRYPTO_L_PERF_AES-GCM source 'common.sh'; config_options=`get_modular_config_names.sh crypto`; check_config_options "ym" CONFIG_CRYPTO_HW $config_options; check_config_options "m" CONFIG_CRYPTO_TEST; echo /dev/null>/var/log/messages; crypto_ip=`get_crypto_ip.sh`; PRE=`get_crypto_int_count.sh $crypto_ip`; modprobe tcrypt mode=211 sec=30; POST=`get_crypto_int_count.sh $crypto_ip`; [[ $POST -gt $(( $PRE+17000 )) ]]|| die "IRQ count did not increase, no hardware crypto, looking for irq number $IRQ_NUM, initial count $PRE, final count $POST";crypto_test.sh

