RFR: 8346129: Simplify EdDSA & XDH curve name usage

Anthony Scarpino ascarpino at openjdk.org
Wed Feb 19 23:56:52 UTC 2025


On Wed, 19 Feb 2025 21:19:22 GMT, Artur Barashev <abarashev at openjdk.org> wrote:

>> Hi,
>> 
>> I need a review for the following change. Naming conventions for EdDSA and XDH have inconsistencies between DisabledAlgorithms and KeyPairGenerator. These internal changes help make it more consistent when parsing the actual curve being used vs the broader algorithm name.
>> 
>> thanks
>> 
>> Tony
>
> src/java.base/share/classes/sun/security/util/AbstractAlgorithmConstraints.java line 79:
> 
>> 77:     private static List<String> aliasXDH = null;
>> 78:     private static List<String> aliasX25519 = null;
>> 79: 
> 
> Wouldn't it be more concise to create a static algorithm-to-aliases map and then make getAliases() to do the map lookup?

It's purely a memory allocation solution here.  If I make a Map, I have to populate the entries at initialization.  Right now XDH and EdDSA are very unlikely to be disabled as they are relatively new algorithms.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23647#discussion_r1962545286


More information about the security-dev mailing list