RFR: 8297878: KEM: Implementation

Sean Mullan mullan at openjdk.org
Wed Apr 12 15:26:14 UTC 2023


On Fri, 31 Mar 2023 02:25:04 GMT, Weijun Wang <weijun at openjdk.org> wrote:

> The KEM API and DHKEM impl. Note that this PR uses new methods in https://github.com/openjdk/jdk/pull/13250.

src/java.base/share/classes/javax/crypto/KEMSpi.java line 211:

> 209:      * The caller of this method has already validated the parameters to
> 210:      * ensure that {@code pk} is not {@code null}. Therefore an implementation
> 211:      * of this method does not to validate it.

s/not to/not need to/

Also, suggest saying who the caller is, "The caller (KEM.newEncapsulator) of this method ..."

src/java.base/share/classes/javax/crypto/KEMSpi.java line 215:

> 213:      * @param pk the receiver's public key. This argument is never {@code null}.
> 214:      * @param spec the optional parameter, can be {@code null}
> 215:      * @param secureRandom the source of randomness for encapsulation,

s/encapsulation/encapsulation./

src/java.base/share/classes/javax/crypto/KEMSpi.java line 216:

> 214:      * @param spec the optional parameter, can be {@code null}
> 215:      * @param secureRandom the source of randomness for encapsulation,
> 216:      *                     If {@code null}, the implementation should provide

s/should/must/

src/java.base/share/classes/javax/crypto/KEMSpi.java line 231:

> 229:      * Creates a KEM decapsulator.
> 230:      * <p>
> 231:      * The caller of this method has already validated the parameters to

Similar comments as engineNewEncapsulator.

src/java.base/share/classes/javax/crypto/KEMSpi.java line 236:

> 234:      *
> 235:      * @param sk the receiver's private key. This argument is never {@code null}.
> 236:      * @param spec the parameter, can be {@code null}

"the optional parameter, ..." (use same wording as engineNewEncapsulator).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13256#discussion_r1164290210
PR Review Comment: https://git.openjdk.org/jdk/pull/13256#discussion_r1164290739
PR Review Comment: https://git.openjdk.org/jdk/pull/13256#discussion_r1164291396
PR Review Comment: https://git.openjdk.org/jdk/pull/13256#discussion_r1164294422
PR Review Comment: https://git.openjdk.org/jdk/pull/13256#discussion_r1164293863



More information about the security-dev mailing list