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

Valerie Peng valeriep at openjdk.org
Thu Aug 15 22:22:55 UTC 2024


On Tue, 13 Aug 2024 15:24:11 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).
>> 
>> Work was begun in [another PR](https://github.com/openjdk/jdk/pull/18924).
>
> Kevin Driver has updated the pull request incrementally with one additional commit since the last revision:
> 
>   addressed several review comments, namely: - renaming the getParameters method - renaming the AlgorithmParameterSpec object - address some javadoc exception messages - add some information to KDF class private constructor javadocs - other general cleanup

src/java.base/share/classes/com/sun/crypto/provider/HkdfKeyDerivation.java line 279:

> 277: 
> 278:     /**
> 279:      * Perform the HMAC-Extract operation.

typo: 'HMAC' should be 'HKDF'

src/java.base/share/classes/com/sun/crypto/provider/HkdfKeyDerivation.java line 284:

> 282:      *     the input keying material used for the HKDF-Extract operation.
> 283:      * @param salt
> 284:      *     the salt value used for HKDF-Extract.  If no salt is to be used a

"If no salt is to be used a {@code null} value should be provided." should be "if no salt is given, a (@code null} is passed"

src/java.base/share/classes/com/sun/crypto/provider/HkdfKeyDerivation.java line 310:

> 308: 
> 309:     /**
> 310:      * Perform the HMAC-Expand operation.  At the end of the operation, the

typo: 'HMAC' should be 'HKDF'.

src/java.base/share/classes/com/sun/crypto/provider/HkdfKeyDerivation.java line 331:

> 329:      *     or derived during the generation of the PRK.
> 330:      */
> 331:     protected byte[] hkdfExpand(SecretKey prk, byte[] info, int outLen)

Same here, can be made 'private'.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1719066716
PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1719069276
PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1719067109
PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1719064506



More information about the security-dev mailing list