Repository navigation
Winternitz Improvements in Generic Format - #127
Conversation
…edits for clarity
Out of curiosity, could you expand on the improvements made compared to Anyway, with this PR, would the two older files be completely redundant? If so, I'd be in favor of removing the old files |
For log_d=4, Listpickverifier has the exact script size as the previous winternitz.rs. For larger log_d values, it can only save 1 or 2 opcodes per digit because it duplicates the number instead of pushing it twice. Other algorithms are useful when the message size is large where we would want to choose larger log_d values considering maximum stack depth. Actually the binary search algorithm was sitting in our repository for some time now and I was considering merging the two algorithms for a more optimized one (making HybridVerifier, it uses binary search and listing-OP_PICK algorithms consequently) , but the real inspiration came when I saw your PR (it is now an optimized special case of the current Hybrid algorithm, where it uses only one step of binary search), so thank you very much for that.
I believe so. |
Me too. Could you do that before we merge? |
I think, in that case, the old winternitz_hash.rs file stops working due to its dependencies on the winternitz.rs file. Should I edit winternitz_hash.rs to make it compatible with the generic version? Also doing these edits doesn't seem to cause any issues with the current chunker projects. Alpen's chunker uses a version of their own, and I believe this one doesn't have a winternitz implementation yet. What should I name the new code file if I delete the two previous ones? Should it be just winternitz.rs or winternitz_generic.rs?" |
That would be great.
Just winternitz.rs seems good to me. |
… fix, refactor and some changes for the ease of usage
|
Thanks @just-erray! Great work! |
This PR optimizes the previous winternitz algorithms from winternitz.rs (ListpickVerifier) and winternitz_compact.rs (BruteforceVerifier), adds small improvements and fixes. Furthermore it adds two new algorithms (BinarysearchVerifier and HybridVerifier) for signature verification, as well as two new conversion algorithms (TabledConverter and StraightforwardConverter) from digit form to bytes, for the usage of various values of log_d. The table below shows each algorithms script size including signing in bytes for different message lengths, with the best suitable conversion algorithm.