Add option to disable built-in aes implementation.
For time being, there are only two aes implementations for known
architectures. I define runtime detection function as const when
built-in was disabled. In this case, compiler will remove dead
built-in code.
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
diff --git a/library/padlock.c b/library/padlock.c
index f42c40f..111b28c 100644
--- a/library/padlock.c
+++ b/library/padlock.c
@@ -33,6 +33,7 @@
#if defined(MBEDTLS_HAVE_X86)
+#if !defined(MBEDTLS_AES_HAS_NO_BUILTIN)
/*
* PadLock detection routine
*/
@@ -62,6 +63,7 @@
return flags & feature;
}
+#endif
/*
* PadLock AES-ECB block en(de)cryption