RFR: 8331008: KDF Implementation [v3]

Weijun Wang weijun at openjdk.org
Thu May 9 21:33:18 UTC 2024


On Thu, 9 May 2024 19:46:39 GMT, Kevin Driver <kdriver at openjdk.org> wrote:

>> Introduce an API for Key Derivation Functions (KDFs), which are cryptographic algorithms for deriving additional keys from a secret key and other data. See [JEP 478](https://openjdk.org/jeps/478).
>
> Kevin Driver has updated the pull request incrementally with one additional commit since the last revision:
> 
>   some code review comments

On tests.

test/jdk/com/sun/crypto/provider/KDF/TestHKDFInitialization.java line 53:

> 51:         KDFParameterSpec kdfParameterSpec = HKDFParameterSpec.extractExpand(
> 52:             HKDFParameterSpec.extract().addIKM(ikm).addSalt(salt).extractOnly(),
> 53:             info, 42);

Please at least add a case where `addSalt` is not called. This is a common use case.

test/jdk/com/sun/crypto/provider/KDF/TestHkdf.java line 233:

> 231:      * are the same.
> 232:      */
> 233:     private static boolean compareKeyAndData(Key outKey, byte[] outData,

We have `Asserts.assertEqualsByteArray` in `test/lib`.

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

PR Review: https://git.openjdk.org/jdk/pull/18924#pullrequestreview-2048871144
PR Review Comment: https://git.openjdk.org/jdk/pull/18924#discussion_r1596007191
PR Review Comment: https://git.openjdk.org/jdk/pull/18924#discussion_r1596006335



More information about the security-dev mailing list