8 #include "sw/device/lib/crypto/drivers/entropy.h"
11 #include "sw/device/tests/crypto/aes_gcm_testutils.h"
12 #include "sw/device/tests/crypto/aes_gcm_testvectors.h"
19 TRY(aes_gcm_testutils_encrypt(current_test,
false, &cycles));
20 LOG_INFO(
"Encrypt cycles: %d", cycles);
27 TRY(aes_gcm_testutils_decrypt(current_test, &tag_valid,
false,
29 LOG_INFO(
"Decrypt cycles: %d", cycles);
34 static status_t encrypt_streaming_test(
void) {
36 TRY(aes_gcm_testutils_encrypt(current_test,
true, &cycles));
37 LOG_INFO(
"Encrypt streaming cycles: %d", cycles);
41 static status_t decrypt_streaming_test(
void) {
44 TRY(aes_gcm_testutils_decrypt(current_test, &tag_valid,
true,
46 LOG_INFO(
"Decrypt streaming cycles: %d", cycles);
51 OTTF_DEFINE_TEST_CONFIG();
56 CHECK_STATUS_OK(entropy_complex_init());
58 for (
size_t i = 0; i <
ARRAYSIZE(kAesGcmTestvectors); i++) {
59 LOG_INFO(
"Starting AES-GCM test %d of %d...", i + 1,
61 current_test = &kAesGcmTestvectors[i];
72 return status_ok(result);