RFR: 8331008: Implement JEP 478: Key Derivation Function API (Preview) [v11]

Valerie Peng valeriep at openjdk.org
Thu Aug 29 17:53:29 UTC 2024


On Thu, 29 Aug 2024 16:08:33 GMT, Kevin Driver <kdriver at openjdk.org> wrote:

>> 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?

You can double-check if output is the same.
Conceptually, if you call update() with a 0-length input vs skipping the update() call, they should be equivalent.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1736824460


More information about the security-dev mailing list