Skip to content

Commit 5397921

Browse files
committed
Fix issue with AES-GCM decryption benchmarking.
We are ignoring an error from `EVP_DecryptFinal_ex` since we expect the tag to not match the data. I think we also need to ignore the same type of error on the call to `EVP_DecryptUpdate`. Currently, I'm seeing `AES_GCM_AUTH_E` being returned by wolfCrypt, which causes the benchmark to fail.
1 parent 18e0c09 commit 5397921

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bench.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,9 @@ static int aesgcm_dec_bench(const char *alg, EVP_CIPHER_CTX *ctx, size_t len)
396396
err |= EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, sizeof(tag),
397397
tag) != 1;
398398
err |= EVP_DecryptUpdate(ctx, NULL, &outLen, aad, sizeof(aad)) != 1;
399-
err |= EVP_DecryptUpdate(ctx, data, &outLen, data, (int)len) != 1;
400-
EVP_DecryptFinal_ex(ctx, data + outLen, &outLen);
401399
/* Ignore error as the tag doesn't match the data. */
400+
EVP_DecryptUpdate(ctx, data, &outLen, data, (int)len);
401+
EVP_DecryptFinal_ex(ctx, data + outLen, &outLen);
402402
}
403403
cnt += i;
404404
}

0 commit comments

Comments
 (0)