On Thu, 29 Aug 2024 16:08:33 GMT, Kevin Driver <kdri...@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

Reply via email to