Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double count stack for LMS #22

Open
derstrand opened this issue Dec 4, 2023 · 2 comments
Open

Double count stack for LMS #22

derstrand opened this issue Dec 4, 2023 · 2 comments

Comments

@derstrand
Copy link

In https://github.com/cisco/hash-sigs/blob/master/hss_alloc.c

Are lines 307 and 407 a double counting the stack_usage for the case of LMS? In the case line 343 falls through (not continue statement) ? Line 422 should only be += in the case of HSS, at least 2 levels and overwritten in the case of LMS.

Some applications may have restrictions on storage and so exact stack count and minimal working key size are very important.

@sfluhrer
Copy link
Collaborator

sfluhrer commented Dec 4, 2023 via email

@sfluhrer
Copy link
Collaborator

sfluhrer commented Dec 4, 2023

The reason we have the two separate logics (one for the bottom-most tree, another for all the others) is that we use different strategies for selecting the sizes of the subtrees. For the non-bottom-most, selecting small subtrees doesn't have any disadvantages (and does reduce memory (stack) usage, and so we do that. For the bottom-most, larger subtrees will speed up signature generation (if we generate several signatures after a reload), and so we consider that as an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants