Skip to content

Commit

Permalink
Use the zeroize function from Mbed TLS
Browse files Browse the repository at this point in the history
Keep using the upstream name, to minimize the differences with the upstream code.

Signed-off-by: Gilles Peskine <[email protected]>
  • Loading branch information
gilles-peskine-arm committed Sep 6, 2023
1 parent 6147511 commit 8cae2c2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions 3rdparty/p256-m/p256-m/p256-m.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

#include "p256-m.h"
#include "mbedtls/platform_util.h"
#include "psa/crypto.h"
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -17,12 +18,7 @@
/*
* Zeroize memory - this should not be optimized away
*/
static void zeroize(void *d, size_t n)
{
volatile char *p = d;
while( n-- )
*p++ = 0;
}
#define zeroize mbedtls_platform_zeroize

/*
* Helpers to test constant-time behaviour with valgrind or MemSan.
Expand Down

0 comments on commit 8cae2c2

Please sign in to comment.