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.
This commit is contained in:
parent
d0d7bf614e
commit
e32df087fb
42 changed files with 46 additions and 212 deletions
library
|
@ -49,6 +49,7 @@
|
|||
#if defined(MBEDTLS_CMAC_C)
|
||||
|
||||
#include "mbedtls/cmac.h"
|
||||
#include "mbedtls/utils.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
@ -67,11 +68,6 @@
|
|||
|
||||
#if !defined(MBEDTLS_CMAC_ALT) || defined(MBEDTLS_SELF_TEST)
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/*
|
||||
* Multiplication by u in the Galois field of GF(2^n)
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue