From c4b6920a409fdbacfc0c17de39af5f55420a45b5 Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Fri, 18 Nov 2022 17:43:54 +0000 Subject: [PATCH] 8296910: Add EdDSA/XDH/RSASSA-PSS to KeyPairGeneratorBench.java Reviewed-by: weijun --- .../crypto/full/KeyPairGeneratorBench.java | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/test/micro/org/openjdk/bench/javax/crypto/full/KeyPairGeneratorBench.java b/test/micro/org/openjdk/bench/javax/crypto/full/KeyPairGeneratorBench.java index 868c3b1ba6c..6d681604de3 100644 --- a/test/micro/org/openjdk/bench/javax/crypto/full/KeyPairGeneratorBench.java +++ b/test/micro/org/openjdk/bench/javax/crypto/full/KeyPairGeneratorBench.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,8 @@ public class KeyPairGeneratorBench extends CryptoBase { @Setup public void setup() throws NoSuchAlgorithmException { setupProvider(); - generator = (prov == null) ? KeyPairGenerator.getInstance(algorithm) : KeyPairGenerator.getInstance(algorithm, prov); + generator = (prov == null) ? KeyPairGenerator.getInstance(algorithm) + : KeyPairGenerator.getInstance(algorithm, prov); generator.initialize(keyLength); } @@ -57,9 +58,17 @@ public class KeyPairGeneratorBench extends CryptoBase { @Param({"RSA"}) private String algorithm; - @Param({"1024", "2048", "3072"}) + @Param({"1024", "2048", "3072", "4096"}) private int keyLength; + } + public static class RSASSAPSS extends KeyPairGeneratorBench { + + @Param({"RSASSA-PSS"}) + private String algorithm; + + @Param({"1024", "2048", "3072", "4096"}) + private int keyLength; } public static class EC extends KeyPairGeneratorBench { @@ -69,7 +78,23 @@ public class KeyPairGeneratorBench extends CryptoBase { @Param({"256", "384", "521"}) private int keyLength; - } + public static class EdDSA extends KeyPairGeneratorBench { + + @Param({"EdDSA"}) + private String algorithm; + + @Param({"255", "448"}) + private int keyLength; + } + + public static class XDH extends KeyPairGeneratorBench { + + @Param({"XDH"}) + private String algorithm; + + @Param({"255", "448"}) + private int keyLength; + } }