Skip to content

Commit e766b8f

Browse files
committed
Update the wolfCrypt test so that Dilithium init so that devID will get passed to hit callback paths when configured and that Dilithium will be retested in the callback section of the wolfCrypt test.
1 parent 9d65982 commit e766b8f

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

wolfcrypt/test/test.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46997,7 +46997,7 @@ static wc_test_ret_t dilithium_param_vfy_test(int param, const byte* pubKey,
4699746997
msg[i] = (byte)i;
4699846998
}
4699946999

47000-
ret = wc_dilithium_init(key);
47000+
ret = wc_dilithium_init_ex(key, NULL, devId);
4700147001
if (ret != 0) {
4700247002
ret = WC_TEST_RET_ENC_EC(ret);
4700347003
return ret;
@@ -50158,7 +50158,7 @@ static wc_test_ret_t dilithium_param_test(int param, WC_RNG* rng)
5015850158
}
5015950159
#endif
5016050160

50161-
ret = wc_dilithium_init(key);
50161+
ret = wc_dilithium_init_ex(key, NULL, devId);
5016250162
if (ret != 0) {
5016350163
ERROR_OUT(WC_TEST_RET_ENC_EC(ret), out);
5016450164
}
@@ -50250,7 +50250,7 @@ static wc_test_ret_t test_dilithium_decode_level(const byte* rawKey,
5025050250

5025150251
/* Initialize key */
5025250252
if (ret == 0) {
50253-
ret = wc_dilithium_init(key);
50253+
ret = wc_dilithium_init_ex(key, NULL, devId);
5025450254
}
5025550255

5025650256
/* Import raw key, setting the security level */
@@ -50293,7 +50293,7 @@ static wc_test_ret_t test_dilithium_decode_level(const byte* rawKey,
5029350293
/* Free and reinit key to test fresh decode */
5029450294
if (ret == 0) {
5029550295
wc_dilithium_free(key);
50296-
ret = wc_dilithium_init(key);
50296+
ret = wc_dilithium_init_ex(key, NULL, devId);
5029750297
}
5029850298

5029950299
/* First test decoding when security level is set externally */
@@ -50318,7 +50318,7 @@ static wc_test_ret_t test_dilithium_decode_level(const byte* rawKey,
5031850318
/* Free and reinit key to test fresh decode */
5031950319
if (ret == 0) {
5032050320
wc_dilithium_free(key);
50321-
ret = wc_dilithium_init(key);
50321+
ret = wc_dilithium_init_ex(key, NULL, devId);
5032250322
}
5032350323

5032450324
#ifndef WOLFSSL_DILITHIUM_FIPS204_DRAFT
@@ -65631,6 +65631,10 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cryptocb_test(void)
6563165631
ret = ecc_onlycb_test(&myCtx);
6563265632
PRIVATE_KEY_LOCK();
6563365633
#endif
65634+
#ifdef HAVE_DILITHIUM
65635+
if (ret == 0)
65636+
ret = dilithium_test();
65637+
#endif
6563465638
#ifdef HAVE_ED25519
6563565639
PRIVATE_KEY_UNLOCK();
6563665640
if (ret == 0)

0 commit comments

Comments
 (0)