You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add devCtx, PRIVATE_KEY_ID, and label support to LMS and XMSS keys
Mirrors the convention used by RSA, ECC, and Dilithium so a CryptoCb
callback can locate a device-resident LMS / XMSS key by either an
opaque byte identifier or a textual label, and stash device-specific
state on the key without going through the public API.
LmsKey / XmssKey gain (under WOLF_CRYPTO_CB):
void* devCtx;
and (under WOLF_PRIVATE_KEY_ID):
byte id[LMS_MAX_ID_LEN]; int idLen;
char label[LMS_MAX_LABEL_LEN]; int labelLen;
(with XMSS_MAX_* equivalents on XmssKey). The MAX_* constants default
to 32 bytes and can be overridden by predefining the macro.
Public init helpers, gated on WOLF_PRIVATE_KEY_ID, follow the
wc_InitRsaKey_Id / wc_InitRsaKey_Label pattern:
wc_LmsKey_InitId(key, id, len, heap, devId)
wc_LmsKey_InitLabel(key, label, heap, devId)
wc_XmssKey_InitId(key, id, len, heap, devId)
wc_XmssKey_InitLabel(key, label, heap, devId)
Both validate length bounds, delegate the rest of init to
wc_LmsKey_Init / wc_XmssKey_Init, then copy id/label into the key.
Verified to build and pass testwolfcrypt under:
--enable-lms --enable-xmss --enable-cryptocb (default and with
CPPFLAGS=-DWOLF_PRIVATE_KEY_ID)
--enable-lms --enable-xmss
--enable-cryptocb
https://claude.ai/code/session_01MixzJP9kPWkS8bhfDDDBnX
0 commit comments