Skip to content

Commit

Permalink
Merge pull request #8166 from gilles-peskine-arm/p256-m-zeroize
Browse files Browse the repository at this point in the history
p256-m: Use the zeroize function from Mbed TLS
  • Loading branch information
daverodgman authored Sep 12, 2023
2 parents 4923640 + 8cae2c2 commit 31beb2d
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 31beb2d

Please sign in to comment.