#include "brg_endian.h"
#include "KeccakP-1600-SnP.h"
#include "SnP-Relaned.h"
+#ifdef __has_feature
+# if __has_feature(undefined_behavior_sanitizer)
+# define ALLOW_MISALIGNED_ACCESS __attribute__((no_sanitize("alignment")))
+# endif
+#endif
+#ifndef ALLOW_MISALIGNED_ACCESS
+# define ALLOW_MISALIGNED_ACCESS
+#endif
typedef unsigned char UINT8;
typedef unsigned int UINT32;
/* ---------------------------------------------------------------- */
+ALLOW_MISALIGNED_ACCESS
void KeccakP1600_AddLanes(void *state, const unsigned char *data, unsigned int laneCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
/* ---------------------------------------------------------------- */
+ALLOW_MISALIGNED_ACCESS
void KeccakP1600_OverwriteLanes(void *state, const unsigned char *data, unsigned int laneCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
/* ---------------------------------------------------------------- */
+ALLOW_MISALIGNED_ACCESS
void KeccakP1600_ExtractLanes(const void *state, unsigned char *data, unsigned int laneCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
/* ---------------------------------------------------------------- */
+ALLOW_MISALIGNED_ACCESS
void KeccakP1600_ExtractAndAddLanes(const void *state, const unsigned char *input, unsigned char *output, unsigned int laneCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
#include <stdlib.h>
#include "brg_endian.h"
#include "KeccakP-1600-opt64-config.h"
+#ifdef __has_feature
+# if __has_feature(undefined_behavior_sanitizer)
+# define ALLOW_MISALIGNED_ACCESS __attribute__((no_sanitize("alignment")))
+# endif
+#endif
+#ifndef ALLOW_MISALIGNED_ACCESS
+# define ALLOW_MISALIGNED_ACCESS
+#endif
typedef unsigned char UINT8;
typedef unsigned long long int UINT64;
/* ---------------------------------------------------------------- */
+ALLOW_MISALIGNED_ACCESS
void KeccakP1600_AddLanes(void *state, const unsigned char *data, unsigned int laneCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
/* ---------------------------------------------------------------- */
+ALLOW_MISALIGNED_ACCESS
size_t KeccakF1600_FastLoop_Absorb(void *state, unsigned int laneCount, const unsigned char *data, size_t dataByteLen)
{
size_t originalDataByteLen = dataByteLen;