LMS: add more examples - #498
Open
SparkiDev wants to merge 1 commit into
Open
Conversation
Contributor
|
@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.
Contributor
Author
|
Rebased and fixed to work with latest wolfSSL. |
philljj
requested changes
Aug 1, 2026
philljj
left a comment
Contributor
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); |
Contributor
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"); |
Contributor
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"); |
Contributor
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 */ | ||
| /* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.