@@ -604,26 +604,6 @@ public static void main(String[] args) {
604604 }
605605 }
606606
607- System .out .println ("\n -----------------------------------------------------------------------------" );
608- System .out .println ("DH Benchmark Results" );
609- System .out .println ("-----------------------------------------------------------------------------" );
610-
611- for (Provider provider : providers ) {
612- if (provider instanceof WolfCryptProvider && !FeatureDetect .DhEnabled ()) {
613- continue ;
614- }
615- Security .insertProviderAt (provider , 1 );
616- System .out .println ("\n " + provider .getName () + ":" );
617- for (int keySize : DH_KEY_SIZES ) {
618- try {
619- runDHBenchmark (provider .getName (), keySize );
620- } catch (Exception e ) {
621- System .out .printf ("Failed to benchmark DH %d with provider %s: %s%n" ,
622- keySize , provider .getName (), e .getMessage ());
623- }
624- }
625- }
626-
627607 /* Run RSA benchmarks */
628608 System .out .println ("\n -----------------------------------------------------------------------------" );
629609 System .out .println ("RSA Benchmark Results" );
@@ -656,7 +636,6 @@ public static void main(String[] args) {
656636 curve , provider .getName (), e .getMessage ());
657637 }
658638 }
659- Security .removeProvider (provider .getName ());
660639 }
661640
662641 System .out .println ("\n -----------------------------------------------------------------------------" );
@@ -681,8 +660,26 @@ public static void main(String[] args) {
681660 if (FeatureDetect .HmacSha512Enabled ()) {
682661 runHmacBenchmark ("HmacSHA512" , providerNames [i ]);
683662 }
663+ }
664+
665+ System .out .println ("\n -----------------------------------------------------------------------------" );
666+ System .out .println ("DH Benchmark Results" );
667+ System .out .println ("-----------------------------------------------------------------------------" );
684668
685- Security .removeProvider (providers [i ].getName ());
669+ for (Provider provider : providers ) {
670+ if (provider instanceof WolfCryptProvider && !FeatureDetect .DhEnabled ()) {
671+ continue ;
672+ }
673+ Security .insertProviderAt (provider , 1 );
674+ System .out .println ("\n " + provider .getName () + ":" );
675+ for (int keySize : DH_KEY_SIZES ) {
676+ try {
677+ runDHBenchmark (provider .getName (), keySize );
678+ } catch (Exception e ) {
679+ System .out .printf ("Failed to benchmark DH %d with provider %s: %s%n" ,
680+ keySize , provider .getName (), e .getMessage ());
681+ }
682+ }
686683 }
687684
688685 System .out .println ("-----------------------------------------------------------------------------\n " );
0 commit comments