|
42 | 42 | #define MLKEM_NAMESPACE_PREFIX CUSTOM_TINY_SHA3
|
43 | 43 |
|
44 | 44 | /******************************************************************************
|
45 |
| - * Name: MLKEM_USE_NATIVE |
| 45 | + * Name: MLKEM_USE_NATIVE_BACKEND_ARITH |
46 | 46 | *
|
47 |
| - * Description: Determines whether a native backend should |
48 |
| - * be used, if available. |
| 47 | + * Description: Determines whether an native arithmetic backend should be used. |
| 48 | + * |
| 49 | + * The arithmetic backend covers performance critical functions |
| 50 | + * such as the number-theoretic transform (NTT). |
| 51 | + * |
| 52 | + * If this option is unset, the C backend will be used. |
| 53 | + * |
| 54 | + * If this option is set, the arithmetic backend to be use is |
| 55 | + * determined by MLKEM_NATIVE_ARITH_BACKEND: If the latter is |
| 56 | + * unset, the default backend for your the target architecture |
| 57 | + * will be used. If set, it must be the name of a backend metadata |
| 58 | + * file. |
49 | 59 | *
|
50 | 60 | * This can also be set using CFLAGS.
|
51 | 61 | *
|
52 | 62 | *****************************************************************************/
|
53 |
| -#define MLKEM_USE_NATIVE |
| 63 | +/* No native arithmetic backend */ |
| 64 | +/* #define MLKEM_USE_NATIVE_BACKEND_ARITH */ |
54 | 65 |
|
55 | 66 | /******************************************************************************
|
56 |
| - * Name: MLKEM_NATIVE_ARITH_BACKEND |
| 67 | + * Name: MLKEM_NATIVE_ARITH_BACKEND_FILE |
57 | 68 | *
|
58 | 69 | * Description: The arithmetic backend to use.
|
59 | 70 | *
|
60 |
| - * This must be the filename of an arithmetic |
61 |
| - * backend. The backend is expected to define |
62 |
| - * |
63 |
| - * - MLKEM_NATIVE_ARITH_BACKEND_NAME |
| 71 | + * If MLKEM_USE_NATIVE_BACKEND_ARITH is unset, this option |
| 72 | + * is ignored. |
64 | 73 | *
|
65 |
| - * The name of the backend as used in the default namespace. |
| 74 | + * If MLKEM_USE_NATIVE_BACKEND_ARITH is set, this option must |
| 75 | + * either be undefined or the filename of an arithmetic backend. |
| 76 | + * If unset, the default backend will be used. |
66 | 77 | *
|
67 |
| - * - MLKEM_NATIVE_ARITH_BACKEND_IMPL |
68 |
| - * |
69 |
| - * The filename of the implementation of the arithmetic backend. |
70 |
| - * |
71 |
| - * See the existing backends for more information. |
| 78 | + * This can be set using CFLAGS. |
72 | 79 | *
|
73 | 80 | *****************************************************************************/
|
74 |
| -/* Let's pretend we don't want an arithmetic backend */ |
75 |
| -/* #define MLKEM_NATIVE_ARITH_BACKEND "native/default.h" */ |
| 81 | +/* #define MLKEM_NATIVE_ARITH_BACKEND_FILE "native/default.h" */ |
76 | 82 |
|
77 | 83 | /******************************************************************************
|
78 |
| - * Name: MLKEM_NATIVE_FIPS202_BACKEND |
| 84 | + * Name: MLKEM_USE_NATIVE_BACKEND_FIPS202 |
79 | 85 | *
|
80 |
| - * Description: The FIPS-202 backend to use. |
| 86 | + * Description: Determines whether an native FIPS202 backend should be used. |
81 | 87 | *
|
82 |
| - * This must be the filename of an FIPS-202 |
83 |
| - * backend. The backend is expected to define |
| 88 | + * The FIPS202 backend covers 1x/2x/4x-fold Keccak-f1600, which is |
| 89 | + * the performance bottleneck of SHA3 and SHAKE. |
84 | 90 | *
|
85 |
| - * - MLKEM_NATIVE_FIPS202_BACKEND_NAME |
| 91 | + * If this option is unset, the C backend will be used. |
86 | 92 | *
|
87 |
| - * The name of the backend as used in the default namespace. |
| 93 | + * If this option is set, the FIPS202 backend to be use is |
| 94 | + * determined by MLKEM_NATIVE_FIPS202_BACKEND: If the latter is |
| 95 | + * unset, the default backend for your the target architecture |
| 96 | + * will be used. If set, it must be the name of a backend metadata |
| 97 | + * file. |
88 | 98 | *
|
89 |
| - * - MLKEM_NATIVE_FIPS202_BACKEND_IMPL |
| 99 | + * This can also be set using CFLAGS. |
| 100 | + * |
| 101 | + *****************************************************************************/ |
| 102 | +#define MLKEM_USE_NATIVE_BACKEND_FIPS202 |
| 103 | + |
| 104 | +/****************************************************************************** |
| 105 | + * Name: MLKEM_NATIVE_FIPS202_BACKEND_FILE |
| 106 | + * |
| 107 | + * Description: The FIPS-202 backend to use. |
90 | 108 | *
|
91 |
| - * The filename of the implementation of the FIPS-202 backend. |
| 109 | + * If MLKEM_USE_NATIVE_BACKEND_FIPS202 is set, this option must |
| 110 | + * either be undefined or the filename of a FIPS202 backend. |
| 111 | + * If unset, the default backend will be used. |
92 | 112 | *
|
93 |
| - * See the existing backends for more information. |
| 113 | + * This can be set using CFLAGS. |
94 | 114 | *
|
95 | 115 | *****************************************************************************/
|
96 |
| -#define MLKEM_NATIVE_FIPS202_BACKEND "fips202/native/custom/custom.h" |
| 116 | +#define MLKEM_NATIVE_FIPS202_BACKEND_FILE "fips202/native/custom/custom.h" |
97 | 117 |
|
98 | 118 | /******************************************************************************
|
99 | 119 | * Name: MLKEM_NATIVE_API_STANDARD
|
|
0 commit comments