mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
Adapt programs / test suites
This commit is contained in:
parent
8f870b047c
commit
a317a98221
33 changed files with 76 additions and 12 deletions
|
|
@ -43,6 +43,11 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
/* Implementation that should never be optimized out by the compiler */
|
||||
static void polarssl_zeroize( void *v, size_t n ) {
|
||||
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------
|
||||
* On average, one iteration accesses two 8-word blocks in the havege WALK
|
||||
* table, and generates 16 words in the RES array.
|
||||
|
|
@ -200,6 +205,14 @@ void havege_init( havege_state *hs )
|
|||
havege_fill( hs );
|
||||
}
|
||||
|
||||
void havege_free( havege_state *hs )
|
||||
{
|
||||
if( hs == NULL )
|
||||
return;
|
||||
|
||||
polarssl_zeroize( hs, sizeof( havege_state ) );
|
||||
}
|
||||
|
||||
/*
|
||||
* HAVEGE rand function
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue