RFR: 8308711: Develop additional Tests for KEM implementation [v4]

Sibabrata Sahoo ssahoo at openjdk.org
Thu Jun 1 14:51:14 UTC 2023


On Thu, 1 Jun 2023 14:16:23 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Sibabrata Sahoo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Comments addressed
>
> test/jdk/javax/crypto/KEM/GenLargeNumberOfKeys.java line 79:
> 
>> 77:                 sk.getEncoded()));
>> 78:         Asserts.assertTrue(Arrays.equals(d.decapsulate(enc.encapsulation()).getEncoded(),
>> 79:                 enc.key().getEncoded()));
> 
> Do you really mean to test this 3 times? If so, add a comment.

Yes.. Thats a valid case to ensure repeated calls don't change anything. I can add a comment there.

> test/jdk/javax/crypto/KEM/KemTest.java line 138:
> 
>> 136:                         decT.decapsulate(enc.encapsulation()).getEncoded().length);
>> 137:                 Asserts.assertEQ(decT.decapsulate(enc.encapsulation()).getEncoded().length,
>> 138:                         enc.key().getEncoded().length);
> 
> Try adding a test on the `encapsulationSize()` method on the decapsulator.

It is there L-130,131, Do you want any specific case?
                Asserts.assertEQ(encT.encapsulationSize(), enc.encapsulation().length);
                Asserts.assertEQ(encT.encapsulationSize(), decT.encapsulationSize());

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14113#discussion_r1213272940
PR Review Comment: https://git.openjdk.org/jdk/pull/14113#discussion_r1213270800



More information about the security-dev mailing list