RFR: 8298127: HSS/LMS Signature Verification [v5]

Weijun Wang weijun at openjdk.org
Mon May 8 16:41:35 UTC 2023


On Thu, 4 May 2023 21:24:16 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Ferenc Rakoczi has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   adding key translation, finally block, removing 24-byte LMOTS parameters
>
> src/java.base/share/classes/sun/security/provider/HSS.java line 528:
> 
>> 526:         // update()-digest() sequence) which is parametrized so that the digest output is copied back into this buffer.
>> 527:         // This way, we avoid memory allocations and some computations that would have to be done otherwise.
>> 528:         final byte[] hashBuf;
> 
> I'm a little worried about the mutability of `hashBuf` and whether it's suitable to be put inside `LMOTSParams`.  By using `of` to return an `LMOTSParams` object we have the chance to return cached objects in the future. There should always be one `hashBuf` for each LM-OTS verification, and this is not clear from the current code.

How will the performance change if we make `hashbufSha256_24` and `hashbufSha256_32` static and each time we want to verify an LM-OTS signature we clone one of them?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13691#discussion_r1187651985



More information about the security-dev mailing list