Uh oh!
There was an error while loading. Please reload this page.
LMS: add more examples - #498
Conversation
padelsbach
commented
Jul 16, 2026
@SparkiDev, I made some updates to the pre-existing lms/xmss examples to work with current wolfssl. Can you please rebase this PR? Alternatively, I can pick up this PR and take it from here. |
lms-kg: Generates key pair and stores to file. lms-sign: Signs multiple files using private key file. lms-verify: Verifies a file against the signature using public key file.
SparkiDev
commented
Jul 31, 2026
Rebased and fixed to work with latest wolfSSL. |
This comment was marked as low quality.
This comment was marked as low quality.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
philljj
left a comment
There was a problem hiding this comment.
Looks and tests good overall, just a few minor things.
| /* Get the public key length. */ | ||
| ret = wc_LmsKey_GetPubLen(key, &pubSz); | ||
| if (ret != 0) { | ||
| print_wolfssl_error("Failed to get public key size", ret); |
There was a problem hiding this comment.
pub will be uninitialized here when routing to cleanup code.
| /* Open file. */ | ||
| f = fopen(filename, "rb"); | ||
| if (f == NULL) { | ||
| printf(" unable to open public key\n"); |
There was a problem hiding this comment.
this will fclose() on null.
Also read_file is used for multiple different files, not just public key.
| /* Open file. */ | ||
| f = fopen(filename, "rb"); | ||
| if (f == NULL) { | ||
| printf(" unable to open public key\n"); |
There was a problem hiding this comment.
this will fclose() on null.
Also this read file is used for multiple files, not just public keys.
| /* Get public key length. */ | ||
| ret = wc_LmsKey_GetPubLen(key, &pubSz); | ||
| if (ret != 0) { | ||
| print_wolfssl_error("Failed to import publc key", ret); |
| /* Import public key into LMS key. */ | ||
| ret = wc_LmsKey_ImportPubRaw(key, pub, pubSz); | ||
| if (ret != 0) { | ||
| print_wolfssl_error("Failed to import publc key", ret); |
| */ | ||
| /* Example to demonstrate LMS Key Generation */ | ||
| /* |
lms-kg: Generates key pair and stores to file.
lms-sign: Signs multiple files using private key file.
lms-verify: Verifies a file against the signature using public key file.