|
25 | 25 | */ |
26 | 26 |
|
27 | 27 | /* |
28 | | - * Test configuration: mldsa-native configuration used for CBMC proofs |
| 28 | + * Test configuration: mldsa-native configuration used for CBMC proofs, using |
| 29 | + * instrumented alloc/free |
29 | 30 | * |
30 | 31 | * This configuration differs from the default mldsa/mldsa_native_config.h in |
31 | 32 | * the following places: |
32 | 33 | * - MLD_CONFIG_NAMESPACE_PREFIX |
| 34 | + * - MLD_CONFIG_KEYGEN_PCT |
| 35 | + * - MLD_CONFIG_CUSTOM_ALLOC_FREE |
33 | 36 | */ |
34 | 37 |
|
35 | 38 |
|
|
499 | 502 | * target pointer should simply be set to NULL. The calling |
500 | 503 | * code will handle this case and invoke MLD_CUSTOM_FREE. |
501 | 504 | */ |
502 | | -/* #define MLD_CONFIG_CUSTOM_ALLOC_FREE |
503 | | - #if !defined(__ASSEMBLER__) |
504 | | - #include <stdlib.h> |
505 | | - #define MLD_CUSTOM_ALLOC(v, T, N) \ |
506 | | - T* (v) = (T *)aligned_alloc(MLD_DEFAULT_ALIGN, \ |
507 | | - MLD_ALIGN_UP(sizeof(T) * (N))) |
508 | | - #define MLD_CUSTOM_FREE(v, T, N) free(v) |
509 | | - #endif |
510 | | -*/ |
| 505 | +#define MLD_CONFIG_CUSTOM_ALLOC_FREE |
| 506 | +#if !defined(__ASSEMBLER__) |
| 507 | +#include <stdlib.h> |
| 508 | +#define MLD_CUSTOM_ALLOC(v, T, N) T *v = (T *)malloc(sizeof(T) * (N)) |
| 509 | +#define MLD_CUSTOM_FREE(v, T, N) free(v) |
| 510 | +#endif |
| 511 | + |
511 | 512 |
|
512 | 513 | /** |
513 | 514 | * MLD_CONFIG_CUSTOM_MEMCPY |
|
629 | 630 | * and MLD_CONFIG_NO_VERIFY_API as the current PCT implementation |
630 | 631 | * requires signature() and verify(). |
631 | 632 | */ |
632 | | -/* #define MLD_CONFIG_KEYGEN_PCT */ |
| 633 | +#define MLD_CONFIG_KEYGEN_PCT |
633 | 634 |
|
634 | 635 | /** |
635 | 636 | * MLD_CONFIG_KEYGEN_PCT_BREAKAGE_TEST |
|
0 commit comments