mlkem_test: add mlkem-native
This commit is contained in:
28
sdk/software/examples/mlkem_test/sw_mlkem_config.h
Normal file
28
sdk/software/examples/mlkem_test/sw_mlkem_config.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Local mlkem-native configuration for the ML-KEM hardware comparison test.
|
||||
*
|
||||
* The target bare-metal toolchain does not expose one of mlkem-native's
|
||||
* built-in secure zeroization backends once assembly is disabled, so provide a
|
||||
* small volatile-byte zeroizer here.
|
||||
*/
|
||||
#ifndef SW_MLKEM_CONFIG_H
|
||||
#define SW_MLKEM_CONFIG_H
|
||||
|
||||
#include "mlkem_native_config.h"
|
||||
|
||||
#define MLK_CONFIG_CUSTOM_ZEROIZE
|
||||
|
||||
#if !defined(__ASSEMBLER__)
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "src/sys.h"
|
||||
|
||||
static MLK_INLINE void mlk_zeroize(void *ptr, size_t len)
|
||||
{
|
||||
volatile uint8_t *p = (volatile uint8_t *)ptr;
|
||||
while (len-- != 0u)
|
||||
*p++ = 0u;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user