-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Introduce global config and reorganize backends
Signed-off-by: Hanno Becker <[email protected]>
- Loading branch information
1 parent
15aed95
commit a462f02
Showing
83 changed files
with
526 additions
and
521 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,12 +28,12 @@ | |
// Author: Hanno Becker <[email protected]> | ||
// Author: Matthias Kannwischer <[email protected]> | ||
|
||
#include "config.h" | ||
#if defined(MLKEM_USE_NATIVE_AARCH64) | ||
#include "common.h" | ||
#if defined(MLKEM_NATIVE_FIPS202_BACKEND_AARCH64_DEFAULT) || \ | ||
defined(MLKEM_NATIVE_FIPS202_BACKEND_AARCH64_A55) | ||
|
||
// Needed to provide ASM_LOAD directive | ||
#include "common.i" | ||
#include "namespace.h" | ||
|
||
/********************** CONSTANTS *************************/ | ||
.data | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (c) 2024 The mlkem-native project authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* FIPS202 assembly profile targeting Cortex-A55 */ | ||
|
||
#ifdef FIPS202_NATIVE_PROFILE_H | ||
#error Only one FIPS202 assembly profile can be defined -- did you include multiple profiles? | ||
#else | ||
#define FIPS202_NATIVE_PROFILE_H | ||
|
||
/* Identifier for this backend so that source and assembly files | ||
* in the build can be appropriately guarded. */ | ||
#define MLKEM_NATIVE_FIPS202_BACKEND_AARCH64_A55 | ||
|
||
#define MLKEM_NATIVE_FIPS202_BACKEND_NAME AARCH64_A55 | ||
|
||
/* Filename of the C backend implementation. | ||
* This is not inlined here because this header is included in assembly | ||
* files as well. */ | ||
#define MLKEM_NATIVE_FIPS202_BACKEND_IMPL "aarch64/profiles/cortex_a55_impl.h" | ||
|
||
#endif /* FIPS202_NATIVE_PROFILE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (c) 2024 The mlkem-native project authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* Default FIPS202 assembly profile for AArch64 systems */ | ||
|
||
#ifdef FIPS202_NATIVE_PROFILE_H | ||
#error Only one FIPS202 assembly profile can be defined -- did you include multiple profiles? | ||
#else | ||
#define FIPS202_NATIVE_PROFILE_H | ||
|
||
/* Identifier for this backend so that source and assembly files | ||
* in the build can be appropriately guarded. */ | ||
#define MLKEM_NATIVE_FIPS202_BACKEND_AARCH64_DEFAULT | ||
|
||
#define MLKEM_NATIVE_FIPS202_BACKEND_NAME AARCH64_DEFAULT | ||
|
||
/* Filename of the C backend implementation. | ||
* This is not inlined here because this header is included in assembly | ||
* files as well. */ | ||
#define MLKEM_NATIVE_FIPS202_BACKEND_IMPL "aarch64/profiles/default_impl.h" | ||
|
||
#endif /* FIPS202_NATIVE_PROFILE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) 2024 The mlkem-native project authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef MLKEM_NATIVE_FIPS202_BACKEND_DEFAULT_H | ||
#define MLKEM_NATIVE_FIPS202_BACKEND_DEFAULT_H | ||
|
||
/* | ||
* Default FIPS202 backend | ||
*/ | ||
#include "common.h" | ||
|
||
#if defined(SYS_AARCH64) | ||
#include "aarch64/profiles/default_metadata.h" | ||
#endif | ||
|
||
#if defined(SYS_X86_64) && defined(SYS_X86_64_AVX2) | ||
#include "x86_64/profiles/xkcp_metadata.h" | ||
#endif | ||
|
||
#endif /* MLKEM_NATIVE_FIPS202_BACKEND_DEFAULT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) 2024 The mlkem-native project authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifdef MLKEM_NATIVE_FIPS202_IMPL_H | ||
#error Only one FIPS202 assembly profile can be defined -- did you include multiple profiles? | ||
#else | ||
#define MLKEM_NATIVE_FIPS202_IMPL_H | ||
|
||
#if defined(MLKEM_NATIVE_FIPS202_BACKEND_IMPL) | ||
#include MLKEM_NATIVE_FIPS202_BACKEND_IMPL | ||
#endif | ||
|
||
#endif /* MLKEM_NATIVE_FIPS202_IMPL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.