RFR: 8213719: Both sect163r2 and sect163k1 are default curves for field size 163
Valerie Peng
valeriep at openjdk.java.net
Mon Nov 30 21:49:59 UTC 2020
On Mon, 30 Nov 2020 21:31:18 GMT, Weijun Wang <weijun at openjdk.org> wrote:
>>>
>>>
>>> > Based on CurveDB line 141, it seems we uses the first one and discards the rest? Are you sure we keep the last one?
>>> > Don't have answers for your questions though.
>>>
>>> Before this change both sect163k1 and sect163r2 have "BD" so both will be added to lengthMap and the 2nd one wins out.
>>
>> Hmm, ok, I re-read the code and it's true that both are added to the lengthMap. Actually, non-PD/non-BD entries are added to the length map too if no entries for such length in length map is present at time of the add() call, right?
>
>> > > Based on CurveDB line 141, it seems we uses the first one and discards the rest? Are you sure we keep the last one?
>> > > Don't have answers for your questions though.
>> >
>> >
>> > Before this change both sect163k1 and sect163r2 have "BD" so both will be added to lengthMap and the 2nd one wins out.
>>
>> Hmm, ok, I re-read the code and it's true that both are added to the lengthMap. Actually, non-PD/non-BD entries are added to the length map too if no entries for such length in length map is present at time of the add() call, right?
>
> Yes, I think that's what "if there are multiple matches for the given size, an arbitrary one is returns" in the comment of `lookup(int)` means. If there is a PD/BD with the same length, the previously added will be substituted anyway.
Alright, I have no more comments/questions. Thanks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1485
More information about the security-dev
mailing list