On Thu, 11 May 2023 06:02:01 GMT, Ferenc Rakoczi <d...@openjdk.org> wrote:

>> src/java.base/share/classes/sun/security/provider/HSS.java line 571:
>> 
>>> 569:                 preCandidate[21] = (byte) 0x80;
>>> 570: 
>>> 571:                 byte[] preZi = hashBuf.clone();
>> 
>> We can just call `hashbufSha256_32.clone()` here. We'll think about what to 
>> do when more params are supported in the future, together with the next line.
>
> hashBuf is assigned at the initialisation of the LMOTSParams object. If 
> (when) we introduce more algorithms, the initialisation code and the 
> digestFixedLengthPreprocessed() code needs to be changed only (its first 
> parameter should be such that it can use the hash algorithm that the object 
> would be initialised to use).

That's OK. I see you already had `SHA2.SHA256 sha256 = new SHA2.SHA256()` as 
the next line and thought the selection of `hashBuf` and optimized hash impl 
will be local in the future.

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

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

Reply via email to