summaryrefslogtreecommitdiff
path: root/library/ccm.c
diff options
context:
space:
mode:
authorAndres Amaya Garcia <andres.amayagarcia@arm.com>2017-10-25 09:37:04 +0100
committerAndres Amaya Garcia <Andres.AmayaGarcia@arm.com>2018-04-17 09:19:05 -0500
commite32df087fb3193dbb2689354492a11464db3adb0 (patch)
treeb1ff377ff0cc5092b19949eaa038b064f44062ed /library/ccm.c
parentd0d7bf614eb82db6cdbc7551dd05cb3cd9cfbb54 (diff)
Remove individual copies of mbedtls_zeroize()
This commit removes all the static occurrencies of the function mbedtls_zeroize() in each of the individual .c modules. Instead the function has been moved to utils.h that is included in each of the modules.
Diffstat (limited to 'library/ccm.c')
-rw-r--r--library/ccm.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/library/ccm.c b/library/ccm.c
index 9101e5f7..a7a2cc44 100644
--- a/library/ccm.c
+++ b/library/ccm.c
@@ -37,6 +37,7 @@
#if defined(MBEDTLS_CCM_C)
#include "mbedtls/ccm.h"
+#include "mbedtls/utils.h"
#include <string.h>
@@ -51,11 +52,6 @@
#if !defined(MBEDTLS_CCM_ALT)
-/* Implementation that should never be optimized out by the compiler */
-static void mbedtls_zeroize( void *v, size_t n ) {
- volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
-}
-
#define CCM_ENCRYPT 0
#define CCM_DECRYPT 1