RFR: 8271745: Correct block size for KW, KWP mode and use fixed IV for KWP mode for SunJCE

Sean Mullan mullan at openjdk.java.net
Wed Sep 1 12:23:49 UTC 2021


On Wed, 1 Sep 2021 02:29:37 GMT, Valerie Peng <valeriep at openjdk.org> wrote:

>> So the block size is always 8 even when there is no padding?
>
> Yes, with KW (no pad), data must be in multiples of 8. When data does not meet this size requirement, an external padding scheme such as PKCS5/7 padding is needed to pad the data to multiples of 8 in order for KW mode to process the data.
> As for KWP mode, it internally pads the data to multiples of 8 before starting the internal processing. Thus, no external padding is needed. Are you asking if 8 should be returned for KWP mode due to its internal padding? KWP is like a variant of KW, so it seems to me that it should return the same block size as KW.

Your explanation make sense. I just wanted to make sure we didn't miss something.

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

PR: https://git.openjdk.java.net/jdk/pull/5236



More information about the security-dev mailing list