RFR: 8331008: KDF Implementation

Sibabrata Sahoo ssahoo at openjdk.org
Thu May 9 08:45:54 UTC 2024


On Tue, 23 Apr 2024 20:42:51 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).

src/java.base/share/classes/javax/crypto/spec/HKDFParameterSpec.java line 133:

> 131:          */
> 132:         public Builder addIKM(byte[] ikm) {
> 133:             if (ikm != null && ikm.length != 0) {

I am not an expert here. Please correct me if i am wrong. As per TLSv1.3 RFC: https://datatracker.ietf.org/doc/html/rfc8446#section-7.1 the statement says "if PSK is not in use, Early Secret will still be HKDF-Extract(0, 0)". Here "Early Secret" i assume it's PRK. Does that mean zero length allowed? 

Same applies to "addSalt(byte[] slat)" too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18924#discussion_r1595153996



More information about the security-dev mailing list