RFR: 8331008: Implement JEP 478: Key Derivation Function API (Preview) [v11]
Kevin Driver
kdriver at openjdk.org
Thu Aug 29 16:11:34 UTC 2024
On Wed, 21 Aug 2024 00:25:08 GMT, Valerie Peng <valeriep at openjdk.org> wrote:
>> I'll need to double-check the logic of this snippet. For example, in the first iteration of the loop, isn't `tLength` == 0? Yet, you have it always set to `hmacLen`.
>
> Sure, I added an if-check to skip the `hmacObj.update(...)` call for the i=0 case. This way, you don't need to set `tLength` to 0 and then changing it to `hmacLen` afterwards. I find it easier to understand.
But this way, the first update call is skipped. Even if the last parameter (the length) is zero, does it affect the internal state of the Mac in some way?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1736603288
More information about the security-dev
mailing list