all repos — circe-vpn @ 12ec1e49175f80aa014a42d2a7a020d62ba42af0

Circe VPN

contrib/config/circe_mlkem_config.h (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
#ifndef MLK_CONFIG_H
#define MLK_CONFIG_H

#define MLK_CONFIG_PARAMETER_SET 768

#define MLK_CONFIG_NAMESPACE_PREFIX PQCP_MLKEM_NATIVE_MLKEM768

#if defined(MLK_BUILD_INTERNAL)

#define MLK_CONFIG_CUSTOM_RANDOMBYTES
#ifndef __ASSEMBLER__
#include "core/platform.h"
#include "src/sys.h"
#include <stddef.h>
#include <stdint.h>

static MLK_INLINE int
mlk_randombytes (uint8_t *ptr, size_t len)
{
  return circe_platform_random_bytes_callback (ptr, len);
}
#endif

#if defined(__aarch64__) || defined(__x86_64__)
#define MLK_CONFIG_USE_NATIVE_BACKEND_ARITH
#define MLK_CONFIG_ARITH_BACKEND_FILE "native/meta.h"
#define MLK_CONFIG_USE_NATIVE_BACKEND_FIPS202
#define MLK_CONFIG_FIPS202_BACKEND_FILE "fips202/native/auto.h"
#endif

#define MLK_CONFIG_CUSTOM_MEMCPY
#define MLK_CONFIG_CUSTOM_MEMSET
#define MLK_CONFIG_CUSTOM_ZEROIZE
#if !defined(__ASSEMBLER__)
#include "src/sys.h" /* for MLK_INLINE */
#include <stddef.h>
#include <stdint.h>

/* Defined in common/memory.c */
void *circe_memcpy (void *restrict dest, const void *restrict src, size_t n);
void *circe_memset (void *dest, int value, size_t count);

static MLK_INLINE void *
mlk_memcpy (void *dest, const void *src, size_t n)
{
  return circe_memcpy (dest, src, n);
}
static MLK_INLINE void *
mlk_memset (void *s, int c, size_t n)
{
  return circe_memset (s, c, n);
}
static MLK_INLINE void
mlk_zeroize (void *ptr, size_t len)
{
  circe_memset (ptr, 0, len);
}
#endif /* !__ASSEMBLER__ */

#endif /* MLK_BUILD_INTERNAL */

#endif /* MLK_CONFIG_H */