#ifndef OPENSSL_NO_ENGINE
{"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"},
#endif
+ {NULL},
};
#define D_MD2 0
ecdh_doit[i] = 0;
#endif
- if ((buf_malloc =
- (unsigned char *)OPENSSL_malloc((int)BUFSIZE + misalign)) == NULL) {
- BIO_printf(bio_err, "out of memory\n");
- goto end;
- }
- if ((buf2_malloc =
- (unsigned char *)OPENSSL_malloc((int)BUFSIZE + misalign)) == NULL) {
- BIO_printf(bio_err, "out of memory\n");
- goto end;
- }
+ buf = buf_malloc = app_malloc((int)BUFSIZE + misalign, "input buffer");
+ buf2 = buf2_malloc = app_malloc((int)BUFSIZE + misalign, "output buffer");
misalign = 0;
- buf = buf_malloc;
- buf2 = buf2_malloc;
prog = opt_init(argc, argv, speed_options);
while ((o = opt_next()) != OPT_EOF) {
int *fds;
static char sep[] = ":";
- fds = malloc(multi * sizeof *fds);
+ fds = malloc(sizeof(*fds) * multi);
for (n = 0; n < multi; ++n) {
if (pipe(fd) == -1) {
fprintf(stderr, "pipe failure\n");
continue;
}
printf("Got: %s from %d\n", buf, n);
- if (!strncmp(buf, "+F:", 3)) {
+ if (strncmp(buf, "+F:", 3) == 0) {
int alg;
int j;
sstrsep(&p, sep);
for (j = 0; j < SIZE_NUM; ++j)
results[alg][j] += atof(sstrsep(&p, sep));
- } else if (!strncmp(buf, "+F2:", 4)) {
+ } else if (strncmp(buf, "+F2:", 4) == 0) {
int k;
double d;
rsa_results[k][1] = d;
}
# ifndef OPENSSL_NO_DSA
- else if (!strncmp(buf, "+F3:", 4)) {
+ else if (strncmp(buf, "+F3:", 4) == 0) {
int k;
double d;
}
# endif
# ifndef OPENSSL_NO_EC
- else if (!strncmp(buf, "+F4:", 4)) {
+ else if (strncmp(buf, "+F4:", 4) == 0) {
int k;
double d;
# endif
# ifndef OPENSSL_NO_EC
- else if (!strncmp(buf, "+F5:", 4)) {
+ else if (strncmp(buf, "+F5:", 4) == 0) {
int k;
double d;
}
# endif
- else if (!strncmp(buf, "+H:", 3)) {
+ else if (strncmp(buf, "+H:", 3) == 0) {
;
} else
fprintf(stderr, "Unknown type '%s' from child %d\n", buf, n);
{
static int mblengths[] =
{ 8 * 1024, 2 * 8 * 1024, 4 * 8 * 1024, 8 * 8 * 1024, 8 * 16 * 1024 };
- int j, count, num = sizeof(lengths) / sizeof(lengths[0]);
+ int j, count, num = OSSL_NELEM(lengths);
const char *alg_name;
unsigned char *inp, *out, no_key[32], no_iv[16];
EVP_CIPHER_CTX ctx;
double d = 0.0;
- inp = OPENSSL_malloc(mblengths[num - 1]);
- out = OPENSSL_malloc(mblengths[num - 1] + 1024);
- if (!inp || !out) {
- BIO_printf(bio_err, "Out of memory\n");
- goto end;
- }
-
+ inp = app_malloc(mblengths[num - 1], "multiblock input buffer");
+ out = app_malloc(mblengths[num - 1] + 1024, "multiblock output buffer");
EVP_CIPHER_CTX_init(&ctx);
EVP_EncryptInit_ex(&ctx, evp_cipher, NULL, no_key, no_iv);
EVP_CIPHER_CTX_ctrl(&ctx, EVP_CTRL_AEAD_SET_MAC_KEY, sizeof(no_key),
print_message(alg_name, 0, mblengths[j]);
Time_F(START);
for (count = 0, run = 1; run && count < 0x7fffffff; count++) {
- unsigned char aad[13];
+ unsigned char aad[EVP_AEAD_TLS1_AAD_LEN];
EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM mb_param;
size_t len = mblengths[j];
int packlen;
aad[11] = len >> 8;
aad[12] = len;
pad = EVP_CIPHER_CTX_ctrl(&ctx,
- EVP_CTRL_AEAD_TLS1_AAD, 13, aad);
+ EVP_CTRL_AEAD_TLS1_AAD,
+ EVP_AEAD_TLS1_AAD_LEN, aad);
EVP_Cipher(&ctx, out, inp, len + pad);
}
}
fprintf(stdout, "\n");
}
-end:
- if (inp)
- OPENSSL_free(inp);
- if (out)
- OPENSSL_free(out);
+ OPENSSL_free(inp);
+ OPENSSL_free(out);
}