#if (!defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)) \
|| (!defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)) \
|| !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH)
- long rsa_count = 1;
+ long op_count = 1;
#endif
openssl_speed_sec_t seconds = { SECONDS, RSA_SECONDS, DSA_SECONDS,
ECDSA_SECONDS, ECDH_SECONDS,
BIO_printf(bio_err,
"RSA sign failure. No RSA sign will be done.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
} else {
pkey_print_message("private", "rsa",
rsa_c[testnum][0], rsa_keys[testnum].bits,
: "%ld %u bits private RSA's in %.2fs\n",
count, rsa_keys[testnum].bits, d);
rsa_results[testnum][0] = (double)count / d;
- rsa_count = count;
+ op_count = count;
}
for (i = 0; i < loopargs_len; i++) {
rsa_results[testnum][1] = (double)count / d;
}
- if (rsa_count <= 1) {
+ if (op_count <= 1) {
/* if longer than 10s, don't do any more */
stop_it(rsa_doit, testnum);
}
BIO_printf(bio_err,
"DSA sign failure. No DSA sign will be done.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
} else {
pkey_print_message("sign", "dsa",
dsa_c[testnum][0], dsa_bits[testnum],
: "%ld %u bits DSA signs in %.2fs\n",
count, dsa_bits[testnum], d);
dsa_results[testnum][0] = (double)count / d;
- rsa_count = count;
+ op_count = count;
}
for (i = 0; i < loopargs_len; i++) {
dsa_results[testnum][1] = (double)count / d;
}
- if (rsa_count <= 1) {
+ if (op_count <= 1) {
/* if longer than 10s, don't do any more */
stop_it(dsa_doit, testnum);
}
if (st == 0) {
BIO_printf(bio_err, "ECDSA failure.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
} else {
for (i = 0; i < loopargs_len; i++) {
/* Perform ECDSA signature test */
BIO_printf(bio_err,
"ECDSA sign failure. No ECDSA sign will be done.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
} else {
pkey_print_message("sign", "ecdsa",
ecdsa_c[testnum][0],
"%ld %u bits ECDSA signs in %.2fs \n",
count, ec_curves[testnum].bits, d);
ecdsa_results[testnum][0] = (double)count / d;
- rsa_count = count;
+ op_count = count;
}
/* Perform ECDSA verification test */
ecdsa_results[testnum][1] = (double)count / d;
}
- if (rsa_count <= 1) {
+ if (op_count <= 1) {
/* if longer than 10s, don't do any more */
stop_it(ecdsa_doit, testnum);
}
BIO_printf(bio_err,
"Unhandled error in the error queue during ECDH init.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
break;
}
ecdh_checks = 0;
BIO_printf(bio_err, "ECDH EC params init failure.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
break;
}
/* Create the context for the key generation */
ecdh_checks = 0;
BIO_printf(bio_err, "ECDH keygen failure.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
break;
}
ecdh_checks = 0;
BIO_printf(bio_err, "ECDH key generation failure.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
break;
}
ecdh_checks = 0;
BIO_printf(bio_err, "ECDH computation failure.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
break;
}
ecdh_checks = 0;
BIO_printf(bio_err, "ECDH computations don't match.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
break;
}
"%ld %u-bits ECDH ops in %.2fs\n", count,
ec_curves[testnum].bits, d);
ecdh_results[testnum][0] = (double)count / d;
- rsa_count = count;
+ op_count = count;
}
- if (rsa_count <= 1) {
+ if (op_count <= 1) {
/* if longer than 10s, don't do any more */
stop_it(ecdh_doit, testnum);
}
if (st == 0) {
BIO_printf(bio_err, "EdDSA failure.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
} else {
for (i = 0; i < loopargs_len; i++) {
/* Perform EdDSA signature test */
BIO_printf(bio_err,
"EdDSA sign failure. No EdDSA sign will be done.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
} else {
pkey_print_message("sign", ed_curves[testnum].name,
eddsa_c[testnum][0],
count, ed_curves[testnum].bits,
ed_curves[testnum].name, d);
eddsa_results[testnum][0] = (double)count / d;
- rsa_count = count;
+ op_count = count;
}
/* Perform EdDSA verification test */
for (i = 0; i < loopargs_len; i++) {
eddsa_results[testnum][1] = (double)count / d;
}
- if (rsa_count <= 1) {
+ if (op_count <= 1) {
/* if longer than 10s, don't do any more */
stop_it(eddsa_doit, testnum);
}
if (st == 0) {
BIO_printf(bio_err, "SM2 init failure.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
} else {
for (i = 0; i < loopargs_len; i++) {
size_t sm2_sigsize = loopargs[i].sigsize;
BIO_printf(bio_err,
"SM2 sign failure. No SM2 sign will be done.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
} else {
pkey_print_message("sign", sm2_curves[testnum].name,
sm2_c[testnum][0],
count, sm2_curves[testnum].bits,
sm2_curves[testnum].name, d);
sm2_results[testnum][0] = (double)count / d;
- rsa_count = count;
+ op_count = count;
}
/* Perform SM2 verification test */
sm2_results[testnum][1] = (double)count / d;
}
- if (rsa_count <= 1) {
+ if (op_count <= 1) {
/* if longer than 10s, don't do any more */
for (testnum++; testnum < SM2_NUM; testnum++)
sm2_doit[testnum] = 0;
if (!pkey_A) {
BIO_printf(bio_err, "Error while initialising EVP_PKEY (out of memory?).\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
if (!pkey_B) {
BIO_printf(bio_err, "Error while initialising EVP_PKEY (out of memory?).\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
if (!ffdh_ctx) {
BIO_printf(bio_err, "Error while allocating EVP_PKEY_CTX.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
if (EVP_PKEY_keygen_init(ffdh_ctx) <= 0) {
BIO_printf(bio_err, "Error while initialising EVP_PKEY_CTX.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
if (EVP_PKEY_CTX_set_dh_nid(ffdh_ctx, ffdh_params[testnum].nid) <= 0) {
BIO_printf(bio_err, "Error setting DH key size for keygen.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
EVP_PKEY_keygen(ffdh_ctx, &pkey_B) <= 0) {
BIO_printf(bio_err, "FFDH key generation failure.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
if (!ffdh_ctx) {
BIO_printf(bio_err, "Error while allocating EVP_PKEY_CTX.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
if (EVP_PKEY_derive_init(ffdh_ctx) <= 0) {
BIO_printf(bio_err, "FFDH derivation context init failure.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
if (EVP_PKEY_derive_set_peer(ffdh_ctx, pkey_B) <= 0) {
BIO_printf(bio_err, "Assigning peer key for derivation failed.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
if (EVP_PKEY_derive(ffdh_ctx, NULL, &secret_size) <= 0) {
BIO_printf(bio_err, "Checking size of shared secret failed.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
if (secret_size > MAX_FFDH_SIZE) {
BIO_printf(bio_err, "Assertion failure: shared secret too large.\n");
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
&secret_size) <= 0) {
BIO_printf(bio_err, "Shared secret derive failure.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
if (!test_ctx) {
BIO_printf(bio_err, "Error while allocating EVP_PKEY_CTX.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
!EVP_PKEY_derive(test_ctx, loopargs[i].secret_ff_b, &test_out) ||
test_out != secret_size) {
BIO_printf(bio_err, "FFDH computation failure.\n");
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
loopargs[i].secret_ff_b, secret_size)) {
BIO_printf(bio_err, "FFDH computations don't match.\n");
ERR_print_errors(bio_err);
- rsa_count = 1;
+ op_count = 1;
ffdh_checks = 0;
break;
}
"%ld %u-bits FFDH ops in %.2fs\n", count,
ffdh_params[testnum].bits, d);
ffdh_results[testnum][0] = (double)count / d;
- rsa_count = count;
+ op_count = count;
};
- if (rsa_count <= 1) {
+ if (op_count <= 1) {
/* if longer than 10s, don't do any more */
stop_it(ffdh_doit, testnum);
}