Skip to content

Commit b2918d4

Browse files
hanno-beckermkannwischer
authored andcommitted
Armv81M: Remove redundant backend declarations
Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
1 parent fd51554 commit b2918d4

4 files changed

Lines changed: 10 additions & 42 deletions

File tree

dev/fips202/armv81m/mve.h

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#if !defined(__ASSEMBLER__)
1919
#include "../api.h"
20+
#include "src/fips202_native_armv81m.h"
2021

2122
/*
2223
* Native x4 permutation
@@ -35,42 +36,27 @@ static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state)
3536
/*
3637
* Native x4 XOR bytes (with on-the-fly bit interleaving)
3738
*/
38-
#define mlk_keccak_f1600_x4_state_xor_bytes \
39-
MLK_NAMESPACE(keccak_f1600_x4_state_xor_bytes_asm)
40-
void mlk_keccak_f1600_x4_state_xor_bytes(void *state, const uint8_t *data0,
41-
const uint8_t *data1,
42-
const uint8_t *data2,
43-
const uint8_t *data3, unsigned offset,
44-
unsigned length);
45-
4639
MLK_MUST_CHECK_RETURN_VALUE
4740
static MLK_INLINE int mlk_keccakf1600_xor_bytes_x4_native(
4841
uint64_t *state, const uint8_t *data0, const uint8_t *data1,
4942
const uint8_t *data2, const uint8_t *data3, unsigned offset,
5043
unsigned length)
5144
{
52-
mlk_keccak_f1600_x4_state_xor_bytes(state, data0, data1, data2, data3, offset,
53-
length);
45+
mlk_keccak_f1600_x4_state_xor_bytes_asm(state, data0, data1, data2, data3,
46+
offset, length);
5447
return MLK_NATIVE_FUNC_SUCCESS;
5548
}
5649

5750
/*
5851
* Native x4 extract bytes (with on-the-fly bit de-interleaving)
5952
*/
60-
#define mlk_keccak_f1600_x4_state_extract_bytes \
61-
MLK_NAMESPACE(keccak_f1600_x4_state_extract_bytes_asm)
62-
void mlk_keccak_f1600_x4_state_extract_bytes(void *state, uint8_t *data0,
63-
uint8_t *data1, uint8_t *data2,
64-
uint8_t *data3, unsigned offset,
65-
unsigned length);
66-
6753
MLK_MUST_CHECK_RETURN_VALUE
6854
static MLK_INLINE int mlk_keccakf1600_extract_bytes_x4_native(
6955
uint64_t *state, uint8_t *data0, uint8_t *data1, uint8_t *data2,
7056
uint8_t *data3, unsigned offset, unsigned length)
7157
{
72-
mlk_keccak_f1600_x4_state_extract_bytes(state, data0, data1, data2, data3,
73-
offset, length);
58+
mlk_keccak_f1600_x4_state_extract_bytes_asm(state, data0, data1, data2, data3,
59+
offset, length);
7460
return MLK_NATIVE_FUNC_SUCCESS;
7561
}
7662

mlkem/mlkem_native.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,6 @@
508508
#undef MLK_USE_FIPS202_X4_NATIVE
509509
#undef MLK_USE_FIPS202_X4_XOR_BYTES_NATIVE
510510
#undef mlk_keccak_f1600_x4_native_impl
511-
#undef mlk_keccak_f1600_x4_state_extract_bytes
512-
#undef mlk_keccak_f1600_x4_state_xor_bytes
513511
/* mlkem/src/fips202/native/armv81m/src/fips202_native_armv81m.h */
514512
#undef MLK_FIPS202_NATIVE_ARMV81M_SRC_FIPS202_NATIVE_ARMV81M_H
515513
#undef mlk_keccak_f1600_x4_mve_asm

mlkem/mlkem_native_asm.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,6 @@
532532
#undef MLK_USE_FIPS202_X4_NATIVE
533533
#undef MLK_USE_FIPS202_X4_XOR_BYTES_NATIVE
534534
#undef mlk_keccak_f1600_x4_native_impl
535-
#undef mlk_keccak_f1600_x4_state_extract_bytes
536-
#undef mlk_keccak_f1600_x4_state_xor_bytes
537535
/* mlkem/src/fips202/native/armv81m/src/fips202_native_armv81m.h */
538536
#undef MLK_FIPS202_NATIVE_ARMV81M_SRC_FIPS202_NATIVE_ARMV81M_H
539537
#undef mlk_keccak_f1600_x4_mve_asm

mlkem/src/fips202/native/armv81m/mve.h

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#if !defined(__ASSEMBLER__)
1919
#include "../api.h"
20+
#include "src/fips202_native_armv81m.h"
2021

2122
/*
2223
* Native x4 permutation
@@ -35,42 +36,27 @@ static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state)
3536
/*
3637
* Native x4 XOR bytes (with on-the-fly bit interleaving)
3738
*/
38-
#define mlk_keccak_f1600_x4_state_xor_bytes \
39-
MLK_NAMESPACE(keccak_f1600_x4_state_xor_bytes_asm)
40-
void mlk_keccak_f1600_x4_state_xor_bytes(void *state, const uint8_t *data0,
41-
const uint8_t *data1,
42-
const uint8_t *data2,
43-
const uint8_t *data3, unsigned offset,
44-
unsigned length);
45-
4639
MLK_MUST_CHECK_RETURN_VALUE
4740
static MLK_INLINE int mlk_keccakf1600_xor_bytes_x4_native(
4841
uint64_t *state, const uint8_t *data0, const uint8_t *data1,
4942
const uint8_t *data2, const uint8_t *data3, unsigned offset,
5043
unsigned length)
5144
{
52-
mlk_keccak_f1600_x4_state_xor_bytes(state, data0, data1, data2, data3, offset,
53-
length);
45+
mlk_keccak_f1600_x4_state_xor_bytes_asm(state, data0, data1, data2, data3,
46+
offset, length);
5447
return MLK_NATIVE_FUNC_SUCCESS;
5548
}
5649

5750
/*
5851
* Native x4 extract bytes (with on-the-fly bit de-interleaving)
5952
*/
60-
#define mlk_keccak_f1600_x4_state_extract_bytes \
61-
MLK_NAMESPACE(keccak_f1600_x4_state_extract_bytes_asm)
62-
void mlk_keccak_f1600_x4_state_extract_bytes(void *state, uint8_t *data0,
63-
uint8_t *data1, uint8_t *data2,
64-
uint8_t *data3, unsigned offset,
65-
unsigned length);
66-
6753
MLK_MUST_CHECK_RETURN_VALUE
6854
static MLK_INLINE int mlk_keccakf1600_extract_bytes_x4_native(
6955
uint64_t *state, uint8_t *data0, uint8_t *data1, uint8_t *data2,
7056
uint8_t *data3, unsigned offset, unsigned length)
7157
{
72-
mlk_keccak_f1600_x4_state_extract_bytes(state, data0, data1, data2, data3,
73-
offset, length);
58+
mlk_keccak_f1600_x4_state_extract_bytes_asm(state, data0, data1, data2, data3,
59+
offset, length);
7460
return MLK_NATIVE_FUNC_SUCCESS;
7561
}
7662

0 commit comments

Comments
 (0)