/*
 * Copyright (c) The mlkem-native project authors
 * Copyright (c) The mldsa-native project authors
 * SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
 */

#include "../../../../common.h"
#include "../../../../ct.h"

#if defined(MLD_FIPS202_ARMV81M_NEED_X4) && \
    !defined(MLD_CONFIG_MULTILEVEL_NO_SHARED)

#include "fips202_native_armv81m.h"


/*
 * Keccak-f1600 x4 permutation (on bit-interleaved state)
 * State is expected to already be in bit-interleaved format.
 */
#define mld_keccak_f1600_x4_native_impl \
  MLD_NAMESPACE(keccak_f1600_x4_native_impl)
int mld_keccak_f1600_x4_native_impl(uint64_t *state)
{
  MLD_ALIGN uint64_t state_tmp[100];
  mld_keccak_f1600_x4_mve_asm(state, state_tmp,
                              mld_keccakf1600_round_constants);
  mld_zeroize(state_tmp, sizeof(state_tmp));
  return MLD_NATIVE_FUNC_SUCCESS;
}

#else /* MLD_FIPS202_ARMV81M_NEED_X4 && !MLD_CONFIG_MULTILEVEL_NO_SHARED */

MLD_EMPTY_CU(keccak_f1600_x4_mve)

#endif /* !(MLD_FIPS202_ARMV81M_NEED_X4 && !MLD_CONFIG_MULTILEVEL_NO_SHARED) \
        */

/* To facilitate single-compilation-unit (SCU) builds, undefine all macros.
 * Don't modify by hand -- this is auto-generated by scripts/autogen. */
/* Some macros are kept because they are also defined in a header. */
/* Keep: mld_keccak_f1600_x4_native_impl (mve.h) */
