Commit 41a3ad0
Derive mldsa_native.h configuration from config file
Previously, mldsa_native.h required users to set MLD_CONFIG_API_* macros
before including it, separate from the MLD_CONFIG_* macros used for the
build configuration. This distinction between internal and external
configuration it confusing.
Now, mldsa_native.h derives all API settings from the same
build configuration file used internally.
- The legacy configuration via MLD_CONFIG_API_XXX still works for
backwards compatibility, but will be removed in v2.
- New Config Options:
* MLD_CONFIG_MULTILEVEL_BUILD: Explicit flag for multi-level builds
This makes it simpler to get headers for multi-level builds.
In the common case, the configs used in a multi-level build are
identical except for the setting of MLD_CONFIG_PARAMETER_SET and
MLD_CONFIG_MULTILEVEL_{NO,WITH}_SHARED. However, the latter only
affect the build, not the API.
With MLD_CONFIG_MULTILEVEL_BUILD exposed as a separate option,
mldsa_native.h can use it to determine whether to suffix the
namespace prefix with the parameter set (44/65/87) or not,
so no adaptation of MLD_CONFIG_MULTILEVEL_{NO,WITH}_SHARED is
needed. Instead, a multi-level header simply becomes:
```c
#define MLD_CONFIG_PARAMETER_SET 44
#include "mldsa_native.h"
#undef MLD_CONFIG_PARAMETER_SET
#define MLD_CONFIG_PARAMETER_SET 65
#include "mldsa_native.h"
#undef MLD_CONFIG_PARAMETER_SET
#define MLD_CONFIG_PARAMETER_SET 87
#include "mldsa_native.h"
#undef MLD_CONFIG_PARAMETER_SET
```
For backwards compatibility, MLD_CONFIG_MULTILEVEL_BUILD is not
used in the build, which continues to detect multilevel builds
via the existing options MLD_CONFIG_MULTILEVEL_{WITH,NO}_SHARED.
* MLD_CONFIG_NO_SUPERCOP: We had this before in mldsa_native.h as
MLD_CONFIG_API_NO_SUPERCOP; it's now in the config and documented.
* MLD_CONFIG_CONSTANTS_ONLY: We had this before in mldsa_native.h as
MLD_CONFIG_API_CONSTANTS_ONLY; it's now in the config and documented.
- Build-Internal vs API Config Separation: Config file now guards
build-only options with #if defined(MLD_BUILD_INTERNAL).
Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>1 parent 2b90b3e commit 41a3ad0
File tree
28 files changed
+2294
-896
lines changed- examples
- custom_backend/mldsa_native
- monolithic_build_multilevel_native/mldsa
- monolithic_build_multilevel/mldsa
- monolithic_build_native/mldsa
- monolithic_build/mldsa
- mldsa
- src
- scripts
- test
28 files changed
+2294
-896
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| |||
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
94 | 186 | | |
95 | 187 | | |
96 | 188 | | |
| |||
415 | 507 | | |
416 | 508 | | |
417 | 509 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | 510 | | |
434 | 511 | | |
435 | 512 | | |
| |||
479 | 556 | | |
480 | 557 | | |
481 | 558 | | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | 559 | | |
502 | 560 | | |
503 | 561 | | |
| |||
561 | 619 | | |
562 | 620 | | |
563 | 621 | | |
| 622 | + | |
| 623 | + | |
564 | 624 | | |
565 | 625 | | |
566 | 626 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| |||
76 | 81 | | |
77 | 82 | | |
78 | 83 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
90 | 182 | | |
91 | 183 | | |
92 | 184 | | |
| |||
417 | 509 | | |
418 | 510 | | |
419 | 511 | | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | 512 | | |
436 | 513 | | |
437 | 514 | | |
| |||
481 | 558 | | |
482 | 559 | | |
483 | 560 | | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | 561 | | |
504 | 562 | | |
505 | 563 | | |
| |||
563 | 621 | | |
564 | 622 | | |
565 | 623 | | |
| 624 | + | |
| 625 | + | |
566 | 626 | | |
567 | 627 | | |
568 | 628 | | |
| |||
0 commit comments