diff --git a/wolfcrypt/src/port/arm/armv8-aes.c b/wolfcrypt/src/port/arm/armv8-aes.c index c189b3eda..250411924 100644 --- a/wolfcrypt/src/port/arm/armv8-aes.c +++ b/wolfcrypt/src/port/arm/armv8-aes.c @@ -4658,5 +4658,31 @@ int wc_AesGcmSetKey(Aes* aes, const byte* key, word32 len) #endif /* HAVE_AES_DECRYPT */ #endif /* WOLFSSL_AES_DIRECT */ +int wc_AesGetKeySize(Aes* aes, word32* keySize) +{ + int ret = 0; + + if (aes == NULL || keySize == NULL) { + return BAD_FUNC_ARG; + } + + switch (aes->rounds) { + case 10: + *keySize = 16; + break; + case 12: + *keySize = 24; + break; + case 14: + *keySize = 32; + break; + default: + *keySize = 0; + ret = BAD_FUNC_ARG; + } + + return ret; +} + #endif /* NO_AES */ diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index bc9db1198..501e0c7dd 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -381,7 +381,7 @@ int wolfcrypt_test(void* args) else printf( "error test passed!\n"); -#ifndef NO_CODING +#if !defined(NO_CODING) && defined(WOLFSSL_BASE64_ENCODE) if ( (ret = base64_test()) != 0) return err_sys("base64 test failed!\n", ret); else @@ -914,7 +914,7 @@ int error_test() return 0; } -#ifndef NO_CODING +#if !defined(NO_CODING) && defined(WOLFSSL_BASE64_ENCODE) int base64_test() { int ret;