Lines Matching +full:no +full:- +full:multiblock

2  * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
102 static int mr = 0; /* machine-readeable output format to merge fork results */
145 # define SIGALRM -1
202 if (strcmp(name, pairs->name) == 0) { in opt_found()
203 *result = pairs->retval; in opt_found()
219 {OPT_HELP_STR, 1, '-', "Usage: %s [options] [algorithm...]\n"},
222 {"help", OPT_HELP, '-', "Display this summary"},
223 {"mb", OPT_MB, '-',
224 "Enable (tls1>=1) multi-block mode on EVP-named cipher"},
225 {"mr", OPT_MR, '-', "Produce machine readable output"},
239 {"evp", OPT_EVP, 's', "Use EVP-named cipher or digest"},
240 {"hmac", OPT_HMAC, 's', "HMAC using EVP-named digest"},
241 {"cmac", OPT_CMAC, 's', "CMAC using EVP-named cipher"},
242 {"decrypt", OPT_DECRYPT, '-',
244 {"aead", OPT_AEAD, '-',
245 "Benchmark EVP-named AEAD cipher in TLS-like sequence"},
248 {"elapsed", OPT_ELAPSED, '-',
249 "Use wall-clock time instead of CPU user time as divisor"},
253 "Run [non-PKI] benchmarks on custom-sized buffer"},
255 "Use specified offset to mis-align buffers"},
278 "des-cbc", "des-ede3", "rc4", "idea-cbc", "seed-cbc",
279 "rc2-cbc", "rc5-cbc", "blowfish", "cast-cbc",
280 "aes-128-cbc", "aes-192-cbc", "aes-256-cbc",
281 "camellia-128-cbc", "camellia-192-cbc", "camellia-256-cbc",
300 {"des-cbc", D_CBC_DES},
301 {"des-ede3", D_EDE3_DES},
302 {"aes-128-cbc", D_CBC_128_AES},
303 {"aes-192-cbc", D_CBC_192_AES},
304 {"aes-256-cbc", D_CBC_256_AES},
305 {"camellia-128-cbc", D_CBC_128_CML},
306 {"camellia-192-cbc", D_CBC_192_CML},
307 {"camellia-256-cbc", D_CBC_256_CML},
308 {"rc2-cbc", D_CBC_RC2},
310 {"rc5-cbc", D_CBC_RC5},
312 {"idea-cbc", D_CBC_IDEA},
314 {"seed-cbc", D_CBC_SEED},
316 {"bf-cbc", D_CBC_BF},
319 {"cast-cbc", D_CBC_CAST},
452 # define SM2_ID_LEN sizeof("TLSv1.3+GM+Cipher+Suite") - 1
499 /* Nb of iterations to do per algorithm and key-size */
505 static char *evp_mac_ciphername = "aes-128-cbc";
544 unsigned char *buf = tempargs->buf; in EVP_Digest_loop()
550 return -1; in EVP_Digest_loop()
554 count = -1; in EVP_Digest_loop()
590 unsigned char *buf = tempargs->buf; in EVP_MAC_loop()
591 EVP_MAC_CTX *mctx = tempargs->mctx; in EVP_MAC_loop()
601 return -1; in EVP_MAC_loop()
646 unsigned char *buf = tempargs->buf; in EVP_Cipher_loop()
649 if (tempargs->ctx == NULL) in EVP_Cipher_loop()
650 return -1; in EVP_Cipher_loop()
652 if (EVP_Cipher(tempargs->ctx, buf, buf, (size_t)lengths[testnum]) <= 0) in EVP_Cipher_loop()
653 return -1; in EVP_Cipher_loop()
660 unsigned char *buf = tempargs->buf; in GHASH_loop()
661 EVP_MAC_CTX *mctx = tempargs->mctx; in GHASH_loop()
667 return -1; in GHASH_loop()
715 unsigned char *buf = tempargs->buf; in RAND_bytes_loop()
727 unsigned char *buf = tempargs->buf; in EVP_Update_loop()
728 EVP_CIPHER_CTX *ctx = tempargs->ctx; in EVP_Update_loop()
740 EVP_CipherInit_ex(ctx, NULL, NULL, NULL, iv, -1); in EVP_Update_loop()
748 EVP_CipherInit_ex(ctx, NULL, NULL, NULL, iv, -1); in EVP_Update_loop()
761 * each message is encrypted using the same (key,iv)-pair. Do not use this
767 unsigned char *buf = tempargs->buf; in EVP_Update_loop_ccm()
768 EVP_CIPHER_CTX *ctx = tempargs->ctx; in EVP_Update_loop_ccm()
797 * To make AEAD benchmarking more relevant perform TLS-like operations,
798 * 13-byte AAD followed by payload. But don't use TLS-formatted AAD, as
804 unsigned char *buf = tempargs->buf; in EVP_Update_loop_aead()
805 EVP_CIPHER_CTX *ctx = tempargs->ctx; in EVP_Update_loop_aead()
835 unsigned char *buf = tempargs->buf; in RSA_sign_loop()
836 unsigned char *buf2 = tempargs->buf2; in RSA_sign_loop()
837 size_t *rsa_num = &tempargs->sigsize; in RSA_sign_loop()
838 EVP_PKEY_CTX **rsa_sign_ctx = tempargs->rsa_sign_ctx; in RSA_sign_loop()
842 *rsa_num = tempargs->buflen; in RSA_sign_loop()
847 count = -1; in RSA_sign_loop()
857 unsigned char *buf = tempargs->buf; in RSA_verify_loop()
858 unsigned char *buf2 = tempargs->buf2; in RSA_verify_loop()
859 size_t rsa_num = tempargs->sigsize; in RSA_verify_loop()
860 EVP_PKEY_CTX **rsa_verify_ctx = tempargs->rsa_verify_ctx; in RSA_verify_loop()
868 count = -1; in RSA_verify_loop()
881 EVP_PKEY_CTX *ffdh_ctx = tempargs->ffdh_ctx[testnum]; in FFDH_derive_key_loop()
882 unsigned char *derived_secret = tempargs->secret_ff_a; in FFDH_derive_key_loop()
886 /* outlen can be overwritten with a too small value (no padding used) */ in FFDH_derive_key_loop()
899 unsigned char *buf = tempargs->buf; in DSA_sign_loop()
900 unsigned char *buf2 = tempargs->buf2; in DSA_sign_loop()
901 size_t *dsa_num = &tempargs->sigsize; in DSA_sign_loop()
902 EVP_PKEY_CTX **dsa_sign_ctx = tempargs->dsa_sign_ctx; in DSA_sign_loop()
906 *dsa_num = tempargs->buflen; in DSA_sign_loop()
911 count = -1; in DSA_sign_loop()
921 unsigned char *buf = tempargs->buf; in DSA_verify_loop()
922 unsigned char *buf2 = tempargs->buf2; in DSA_verify_loop()
923 size_t dsa_num = tempargs->sigsize; in DSA_verify_loop()
924 EVP_PKEY_CTX **dsa_verify_ctx = tempargs->dsa_verify_ctx; in DSA_verify_loop()
932 count = -1; in DSA_verify_loop()
943 unsigned char *buf = tempargs->buf; in ECDSA_sign_loop()
944 unsigned char *buf2 = tempargs->buf2; in ECDSA_sign_loop()
945 size_t *ecdsa_num = &tempargs->sigsize; in ECDSA_sign_loop()
946 EVP_PKEY_CTX **ecdsa_sign_ctx = tempargs->ecdsa_sign_ctx; in ECDSA_sign_loop()
950 *ecdsa_num = tempargs->buflen; in ECDSA_sign_loop()
955 count = -1; in ECDSA_sign_loop()
965 unsigned char *buf = tempargs->buf; in ECDSA_verify_loop()
966 unsigned char *buf2 = tempargs->buf2; in ECDSA_verify_loop()
967 size_t ecdsa_num = tempargs->sigsize; in ECDSA_verify_loop()
968 EVP_PKEY_CTX **ecdsa_verify_ctx = tempargs->ecdsa_verify_ctx; in ECDSA_verify_loop()
977 count = -1; in ECDSA_verify_loop()
990 EVP_PKEY_CTX *ctx = tempargs->ecdh_ctx[testnum]; in ECDH_EVP_derive_key_loop()
991 unsigned char *derived_secret = tempargs->secret_a; in ECDH_EVP_derive_key_loop()
993 size_t *outlen = &(tempargs->outlen[testnum]); in ECDH_EVP_derive_key_loop()
1005 unsigned char *buf = tempargs->buf; in EdDSA_sign_loop()
1006 EVP_MD_CTX **edctx = tempargs->eddsa_ctx; in EdDSA_sign_loop()
1007 unsigned char *eddsasig = tempargs->buf2; in EdDSA_sign_loop()
1008 size_t *eddsasigsize = &tempargs->sigsize; in EdDSA_sign_loop()
1016 count = -1; in EdDSA_sign_loop()
1023 count = -1; in EdDSA_sign_loop()
1033 unsigned char *buf = tempargs->buf; in EdDSA_verify_loop()
1034 EVP_MD_CTX **edctx = tempargs->eddsa_ctx2; in EdDSA_verify_loop()
1035 unsigned char *eddsasig = tempargs->buf2; in EdDSA_verify_loop()
1036 size_t eddsasigsize = tempargs->sigsize; in EdDSA_verify_loop()
1044 count = -1; in EdDSA_verify_loop()
1051 count = -1; in EdDSA_verify_loop()
1063 unsigned char *buf = tempargs->buf; in SM2_sign_loop()
1064 EVP_MD_CTX **sm2ctx = tempargs->sm2_ctx; in SM2_sign_loop()
1065 unsigned char *sm2sig = tempargs->buf2; in SM2_sign_loop()
1068 EVP_PKEY **sm2_pkey = tempargs->sm2_pkey; in SM2_sign_loop()
1078 count = -1; in SM2_sign_loop()
1086 count = -1; in SM2_sign_loop()
1090 tempargs->sigsize = sm2sigsize; in SM2_sign_loop()
1099 unsigned char *buf = tempargs->buf; in SM2_verify_loop()
1100 EVP_MD_CTX **sm2ctx = tempargs->sm2_vfy_ctx; in SM2_verify_loop()
1101 unsigned char *sm2sig = tempargs->buf2; in SM2_verify_loop()
1102 size_t sm2sigsize = tempargs->sigsize; in SM2_verify_loop()
1104 EVP_PKEY **sm2_pkey = tempargs->sm2_pkey; in SM2_verify_loop()
1111 count = -1; in SM2_verify_loop()
1119 count = -1; in SM2_verify_loop()
1153 if (job_op_count == -1) { in run_benchmark()
1208 if (select_result == -1 && errno == EINTR) in run_benchmark()
1211 if (select_result == -1) { in run_benchmark()
1255 if (job_op_count == -1) { in run_benchmark()
1260 --num_inprogress; in run_benchmark()
1265 --num_inprogress; in run_benchmark()
1275 return error ? -1 : total_op_count; in run_benchmark()
1305 kctx = EVP_PKEY_CTX_new_id(curve->nid, NULL); in get_ecdsa()
1334 curve->nid) <= 0 in get_ecdsa()
1359 memset(do_it + test_num, 0, OSSL_NELEM(do_it) - test_num);
1371 int async_init = 0, multiblock = 0, pr_header = 0; in speed_main() local
1489 OPENSSL_assert(ed_curves[EdDSA_NUM - 1].nid == NID_ED448); in speed_main()
1490 OPENSSL_assert(strcmp(eddsa_choices[EdDSA_NUM - 1].name, "ed448") == 0); in speed_main()
1492 OPENSSL_assert(ec_curves[EC_NUM - 1].nid == NID_X448); in speed_main()
1493 OPENSSL_assert(strcmp(ecdh_choices[EC_NUM - 1].name, "ecdhx448") == 0); in speed_main()
1495 OPENSSL_assert(ec_curves[ECDSA_NUM - 1].nid == NID_brainpoolP512t1); in speed_main()
1496 OPENSSL_assert(strcmp(ecdsa_choices[ECDSA_NUM - 1].name, "ecdsabrp512t1") == 0); in speed_main()
1499 OPENSSL_assert(sm2_curves[SM2_NUM - 1].nid == NID_sm2); in speed_main()
1500 OPENSSL_assert(strcmp(sm2_choices[SM2_NUM - 1].name, "curveSM2") == 0); in speed_main()
1509 BIO_printf(bio_err, "%s: Use -help for summary.\n", prog); in speed_main()
1520 BIO_printf(bio_err, "%s: -evp option cannot be used more than once\n", prog); in speed_main()
1603 multiblock = 1; in speed_main()
1606 "%s: -mb specified but multi-block support is disabled\n", in speed_main()
1749 BIO_printf(bio_err, "-aead can be used only with an AEAD cipher\n"); in speed_main()
1758 if (multiblock) { in speed_main()
1760 BIO_printf(bio_err, "-mb can be used only with a multi-block" in speed_main()
1765 BIO_printf(bio_err, "%s is not a multi-block capable\n", in speed_main()
1769 BIO_printf(bio_err, "Async mode is not supported with -mb"); in speed_main()
1797 buflen = lengths[size_num - 1]; in speed_main()
1800 if (INT_MAX - (MAX_MISALIGNMENT + 1) < buflen) { in speed_main()
1813 loopargs[i].buflen = buflen - misalign; in speed_main()
1814 loopargs[i].sigsize = buflen - misalign; in speed_main()
1831 /* No parameters; turn on everything. */ in speed_main()
2051 loopargs[i].ctx = init_evp_cipher_ctx("des-cbc", deskey, in speed_main()
2072 loopargs[i].ctx = init_evp_cipher_ctx("des-ede3-cbc", deskey, in speed_main()
2175 "aes-128-gcm", 0); in speed_main()
2178 sizeof(gmac_iv) - 1); in speed_main()
2220 if (multiblock && (EVP_CIPHER_get_flags(evp_cipher) & in speed_main()
2263 loopargs[k].key, NULL, -1)) { in speed_main()
2363 /* we haven't set keys yet, generate multi-prime RSA keys */ in speed_main()
2396 "RSA sign setup failure. No RSA sign will be done.\n"); in speed_main()
2428 "RSA verify setup failure. No RSA verify will be done.\n"); in speed_main()
2476 "DSA sign setup failure. No DSA sign will be done.\n"); in speed_main()
2507 "DSA verify setup failure. No DSA verify will be done.\n"); in speed_main()
2555 "ECDSA sign setup failure. No ECDSA sign will be done.\n"); in speed_main()
2586 "ECDSA verify setup failure. No ECDSA verify will be done.\n"); in speed_main()
2686 "%ld %u-bits ECDH ops in %.2fs\n", count, in speed_main()
2759 "EdDSA sign failure. No EdDSA sign will be done.\n"); in speed_main()
2788 "EdDSA verify failure. No EdDSA verify will be done.\n"); in speed_main()
2861 * No need to allow user to set an explicit ID here, just use in speed_main()
2862 * the one defined in the 'draft-yang-tls-tl13-sm-suites' I-D. in speed_main()
2891 "SM2 sign failure. No SM2 sign will be done.\n"); in speed_main()
2921 "SM2 verify failure. No SM2 verify will be done.\n"); in speed_main()
3119 "%ld %u-bits FFDH ops in %.2fs\n", count, in speed_main()
3169 printf("%-13s", alg_name); in speed_main()
3407 if (count == -1) { in print_result()
3456 if (pipe(fd) == -1) { in do_multi()
3468 if (dup(fd[1]) == -1) { in do_multi()
3616 while (wait(&status) == -1) in do_multi()
3650 inp = app_malloc(mblengths[num - 1], "multiblock input buffer"); in multiblock_speed()
3651 out = app_malloc(mblengths[num - 1] + 1024, "multiblock output buffer"); in multiblock_speed()
3675 print_message(alg_name, 0, mblengths[j], seconds->sym); in multiblock_speed()
3739 fprintf(stdout, "%-24s", alg_name); in multiblock_speed()