Skip to content

Commit 9eb6617

Browse files
committed
Call the always-present MLDSA context API from the UEFI driver
1 parent a32df9f commit 9eb6617

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

uefi-library/src/driver.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,15 @@ WRAP_FUNC(int, wc_MlDsaKey_Init, (wc_MlDsaKey* key, void* heap, int devId),
420420
WRAP_VOID(wc_MlDsaKey_Free, (wc_MlDsaKey* key), (key))
421421
WRAP_FUNC(int, wc_MlDsaKey_SetParams, (wc_MlDsaKey* key, byte level), (key, level))
422422
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))
423+
/* no-ctx Sign/Verify need WOLFSSL_MLDSA_NO_CTX; the *Ctx path with empty context always exists */
424+
static int EFI_API_TAG wc_MlDsaKey_Sign_EfiAPI(wc_MlDsaKey* key, byte* sig,
425+
word32* sigLen, const byte* msg, word32 msgLen, WC_RNG* rng) {
426+
return wc_MlDsaKey_SignCtx(key, NULL, 0, sig, sigLen, msg, msgLen, rng);
427+
}
428+
static int EFI_API_TAG wc_MlDsaKey_Verify_EfiAPI(wc_MlDsaKey* key, const byte* sig,
429+
word32 sigLen, const byte* msg, word32 msgLen, int* res) {
430+
return wc_MlDsaKey_VerifyCtx(key, sig, sigLen, NULL, 0, msg, msgLen, res);
431+
}
429432
WRAP_FUNC(int, wc_MlDsaKey_ExportKey, (wc_MlDsaKey* key, byte* priv, word32* privSz,
430433
byte* pub, word32* pubSz), (key, priv, privSz, pub, pubSz))
431434
WRAP_FUNC(int, wc_MlDsaKey_ImportKey, (wc_MlDsaKey* key, const byte* priv, word32 privSz,

0 commit comments

Comments
 (0)