|
42 | 42 | #include <wolfssl/wolfcrypt/ed25519.h> |
43 | 43 | #include <wolfssl/wolfcrypt/cmac.h> |
44 | 44 | #include <wolfssl/wolfcrypt/kdf.h> |
45 | | -#ifdef HAVE_DILITHIUM |
46 | | -#include <wolfssl/wolfcrypt/dilithium.h> |
| 45 | +#ifdef WOLFSSL_HAVE_MLDSA |
| 46 | +#include <wolfssl/wolfcrypt/wc_mldsa.h> |
47 | 47 | #endif |
48 | 48 | #ifdef HAVE_FALCON |
49 | 49 | #include <wolfssl/wolfcrypt/falcon.h> |
@@ -412,23 +412,25 @@ WRAP_FUNC(int, wc_MlKemKey_EncodePublicKey, |
412 | 412 | #endif /* WOLFSSL_HAVE_MLKEM */ |
413 | 413 |
|
414 | 414 | /* ------------------------------------------------------------------ */ |
415 | | -/* Dilithium wrappers */ |
416 | | -/* ------------------------------------------------------------------ */ |
417 | | -#ifdef HAVE_DILITHIUM |
418 | | -WRAP_FUNC(int, wc_dilithium_init, (dilithium_key* key), (key)) |
419 | | -WRAP_VOID(wc_dilithium_free, (dilithium_key* key), (key)) |
420 | | -WRAP_FUNC(int, wc_dilithium_set_level, (dilithium_key* key, byte level), (key, level)) |
421 | | -WRAP_FUNC(int, wc_dilithium_make_key, (dilithium_key* key, WC_RNG* rng), (key, rng)) |
422 | | -WRAP_FUNC(int, wc_dilithium_sign_msg, (const byte* in, word32 inLen, byte* out, word32* outLen, |
423 | | - dilithium_key* key, WC_RNG* rng), (in, inLen, out, outLen, key, rng)) |
424 | | -WRAP_FUNC(int, wc_dilithium_verify_msg, (const byte* sig, word32 sigLen, const byte* msg, |
425 | | - word32 msgLen, int* res, dilithium_key* key), (sig, sigLen, msg, msgLen, res, key)) |
426 | | -WRAP_FUNC(int, wc_dilithium_export_key, (dilithium_key* key, byte* priv, word32* privSz, |
| 415 | +/* ML-DSA wrappers */ |
| 416 | +/* ------------------------------------------------------------------ */ |
| 417 | +#ifdef WOLFSSL_HAVE_MLDSA |
| 418 | +WRAP_FUNC(int, wc_MlDsaKey_Init, (wc_MlDsaKey* key, void* heap, int devId), |
| 419 | + (key, heap, devId)) |
| 420 | +WRAP_VOID(wc_MlDsaKey_Free, (wc_MlDsaKey* key), (key)) |
| 421 | +WRAP_FUNC(int, wc_MlDsaKey_SetParams, (wc_MlDsaKey* key, byte level), (key, level)) |
| 422 | +WRAP_FUNC(int, wc_MlDsaKey_MakeKey, (wc_MlDsaKey* key, WC_RNG* rng), (key, rng)) |
| 423 | +WRAP_FUNC(int, wc_MlDsaKey_Sign, (wc_MlDsaKey* key, byte* sig, word32* sigLen, |
| 424 | + const byte* msg, word32 msgLen, WC_RNG* rng), |
| 425 | + (key, sig, sigLen, msg, msgLen, rng)) |
| 426 | +WRAP_FUNC(int, wc_MlDsaKey_Verify, (wc_MlDsaKey* key, const byte* sig, word32 sigLen, |
| 427 | + const byte* msg, word32 msgLen, int* res), |
| 428 | + (key, sig, sigLen, msg, msgLen, res)) |
| 429 | +WRAP_FUNC(int, wc_MlDsaKey_ExportKey, (wc_MlDsaKey* key, byte* priv, word32* privSz, |
427 | 430 | byte* pub, word32* pubSz), (key, priv, privSz, pub, pubSz)) |
428 | | -WRAP_FUNC(int, wc_dilithium_import_key, (const byte* priv, word32 privSz, |
429 | | - const byte* pub, word32 pubSz, dilithium_key* key), |
430 | | - (priv, privSz, pub, pubSz, key)) |
431 | | -#endif /* HAVE_DILITHIUM */ |
| 431 | +WRAP_FUNC(int, wc_MlDsaKey_ImportKey, (wc_MlDsaKey* key, const byte* priv, word32 privSz, |
| 432 | + const byte* pub, word32 pubSz), (key, priv, privSz, pub, pubSz)) |
| 433 | +#endif /* WOLFSSL_HAVE_MLDSA */ |
432 | 434 |
|
433 | 435 | /* ------------------------------------------------------------------ */ |
434 | 436 | /* Falcon wrappers */ |
@@ -670,16 +672,16 @@ static WOLFCRYPT_PROTOCOL g_wolfcrypt_api = { |
670 | 672 | .wc_MlKemKey_EncodePublicKey = wc_MlKemKey_EncodePublicKey_EfiAPI, |
671 | 673 | #endif |
672 | 674 |
|
673 | | - /* Dilithium */ |
674 | | -#ifdef HAVE_DILITHIUM |
675 | | - .wc_dilithium_init = wc_dilithium_init_EfiAPI, |
676 | | - .wc_dilithium_free = wc_dilithium_free_EfiAPI, |
677 | | - .wc_dilithium_set_level = wc_dilithium_set_level_EfiAPI, |
678 | | - .wc_dilithium_make_key = wc_dilithium_make_key_EfiAPI, |
679 | | - .wc_dilithium_sign_msg = wc_dilithium_sign_msg_EfiAPI, |
680 | | - .wc_dilithium_verify_msg = wc_dilithium_verify_msg_EfiAPI, |
681 | | - .wc_dilithium_export_key = wc_dilithium_export_key_EfiAPI, |
682 | | - .wc_dilithium_import_key = wc_dilithium_import_key_EfiAPI, |
| 675 | + /* ML-DSA */ |
| 676 | +#ifdef WOLFSSL_HAVE_MLDSA |
| 677 | + .wc_MlDsaKey_Init = wc_MlDsaKey_Init_EfiAPI, |
| 678 | + .wc_MlDsaKey_Free = wc_MlDsaKey_Free_EfiAPI, |
| 679 | + .wc_MlDsaKey_SetParams = wc_MlDsaKey_SetParams_EfiAPI, |
| 680 | + .wc_MlDsaKey_MakeKey = wc_MlDsaKey_MakeKey_EfiAPI, |
| 681 | + .wc_MlDsaKey_Sign = wc_MlDsaKey_Sign_EfiAPI, |
| 682 | + .wc_MlDsaKey_Verify = wc_MlDsaKey_Verify_EfiAPI, |
| 683 | + .wc_MlDsaKey_ExportKey = wc_MlDsaKey_ExportKey_EfiAPI, |
| 684 | + .wc_MlDsaKey_ImportKey = wc_MlDsaKey_ImportKey_EfiAPI, |
683 | 685 | #endif |
684 | 686 |
|
685 | 687 | /* Falcon */ |
|
0 commit comments