#define COND(unused_cond) (run && count < (testmode ? 1 : INT_MAX))
#define COUNT(d) (count)
-#define TAG_LEN 16
+#define TAG_LEN 16 /* 16 bytes tag length works for all AEAD modes */
+#define AEAD_IVLEN 12 /* 12 bytes iv length works for all AEAD modes */
static unsigned int mode_op; /* AE Mode of operation */
static unsigned int aead = 0; /* AEAD flag */
-static unsigned char aead_iv[12]; /* For AEAD modes */
+static unsigned char aead_iv[AEAD_IVLEN]; /* For AEAD modes */
static unsigned char aad[EVP_AEAD_TLS1_AAD_LEN] = { 0xcc };
-static int aead_ivlen = sizeof(aead_iv);
typedef struct loopargs_st {
ASYNC_JOB *inprogress_job;
/* Set length of iv (Doesn't apply to SIV mode) */
if (mode_op != EVP_CIPH_SIV_MODE) {
if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN,
- aead_ivlen, NULL)) {
+ sizeof(aead_iv), NULL)) {
BIO_printf(bio_err, "\nFailed to set iv length\n");
dofail();
exit(1);
/* Set the length of iv (Doesn't apply to SIV mode) */
if (mode_op != EVP_CIPH_SIV_MODE) {
if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN,
- aead_ivlen, NULL)) {
+ sizeof(aead_iv), NULL)) {
BIO_printf(bio_err, "\nFailed to set iv length\n");
dofail();
exit(1);
if (mode_op != EVP_CIPH_SIV_MODE) {
if (!EVP_CIPHER_CTX_ctrl(loopargs[k].ctx,
EVP_CTRL_AEAD_SET_IVLEN,
- aead_ivlen, NULL)) {
+ sizeof(aead_iv), NULL)) {
BIO_printf(bio_err, "\nFailed to set iv length\n");
dofail();
exit(1);