Skip to content

Commit 81852e7

Browse files
Merge pull request #8865 from SparkiDev/dilithium_fixes_2
ML-DSA: fix tests for different configs
2 parents 106bcb2 + cb90b78 commit 81852e7

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

tests/api/test_mldsa.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16665,6 +16665,7 @@ int test_mldsa_pkcs8(void)
1666516665
defined(HAVE_DILITHIUM) && !defined(NO_TLS) && \
1666616666
(!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
1666716667
!defined(WOLFSSL_DILITHIUM_NO_MAKE_KEY) && \
16668+
!defined(WOLFSSL_DILITHIUM_NO_SIGN) && \
1666816669
!defined(WOLFSSL_DILITHIUM_NO_ASN1)
1666916670

1667016671
WOLFSSL_CTX* ctx = NULL;
@@ -16685,9 +16686,15 @@ int test_mldsa_pkcs8(void)
1668516686
int oidSum;
1668616687
int keySz;
1668716688
} test_variant[] = {
16689+
#ifndef WOLFSSL_NO_ML_DSA_44
1668816690
{WC_ML_DSA_44, ML_DSA_LEVEL2k, ML_DSA_LEVEL2_PRV_KEY_SIZE},
16691+
#endif
16692+
#ifndef WOLFSSL_NO_ML_DSA_65
1668916693
{WC_ML_DSA_65, ML_DSA_LEVEL3k, ML_DSA_LEVEL3_PRV_KEY_SIZE},
16694+
#endif
16695+
#ifndef WOLFSSL_NO_ML_DSA_87
1669016696
{WC_ML_DSA_87, ML_DSA_LEVEL5k, ML_DSA_LEVEL5_PRV_KEY_SIZE}
16697+
#endif
1669116698
};
1669216699

1669316700
(void) pemSz;

wolfcrypt/test/test.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46814,8 +46814,10 @@ static wc_test_ret_t dilithium_param_test(int param, WC_RNG* rng)
4681446814
byte* sig = NULL;
4681546815
#else
4681646816
dilithium_key key[1];
46817+
#ifndef WOLFSSL_DILITHIUM_NO_SIGN
4681746818
byte sig[DILITHIUM_MAX_SIG_SIZE];
4681846819
#endif
46820+
#endif
4681946821
#ifndef WOLFSSL_DILITHIUM_NO_SIGN
4682046822
word32 sigLen;
4682146823
byte msg[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };

0 commit comments

Comments
 (0)