summaryrefslogtreecommitdiff
path: root/lib/crypto
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2015-08-27 13:44:56 +0200
committerJeremy Allison <jra@samba.org>2015-08-27 20:23:20 +0200
commit80c8a1ca9577075d5917fb63ae820105cffebd57 (patch)
tree0be9e7b0d885f62295b4e32b2a09f1f17eb68ba6 /lib/crypto
parent683eda2f92cd296e36c57d96d6f0b22dde1819f4 (diff)
downloadsamba-80c8a1ca9577075d5917fb63ae820105cffebd57.tar.gz
lib/crypto: verify 0 updates in aes_gcm_128 tests
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11451 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/crypto')
-rw-r--r--lib/crypto/aes_gcm_128_test.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/crypto/aes_gcm_128_test.c b/lib/crypto/aes_gcm_128_test.c
index f70d8519e82..4b534870fd3 100644
--- a/lib/crypto/aes_gcm_128_test.c
+++ b/lib/crypto/aes_gcm_128_test.c
@@ -178,11 +178,17 @@ bool torture_local_crypto_aes_gcm_128(struct torture_context *torture)
aes_gcm_128_init(&ctx, testarray[i].K.data, testarray[i].IV.data);
for (j=0; j < testarray[i].A.length; j++) {
+ aes_gcm_128_updateA(&ctx, NULL, 0);
aes_gcm_128_updateA(&ctx, &testarray[i].A.data[j], 1);
+ aes_gcm_128_updateA(&ctx, NULL, 0);
}
for (j=0; j < C.length; j++) {
+ aes_gcm_128_crypt(&ctx, NULL, 0);
+ aes_gcm_128_updateC(&ctx, NULL, 0);
aes_gcm_128_crypt(&ctx, &C.data[j], 1);
aes_gcm_128_updateC(&ctx, &C.data[j], 1);
+ aes_gcm_128_crypt(&ctx, NULL, 0);
+ aes_gcm_128_updateC(&ctx, NULL, 0);
}
aes_gcm_128_digest(&ctx, T);
@@ -244,11 +250,17 @@ bool torture_local_crypto_aes_gcm_128(struct torture_context *torture)
aes_gcm_128_init(&ctx, testarray[i].K.data, testarray[i].IV.data);
for (j=0; j < testarray[i].A.length; j++) {
+ aes_gcm_128_updateA(&ctx, NULL, 0);
aes_gcm_128_updateA(&ctx, &testarray[i].A.data[j], 1);
+ aes_gcm_128_updateA(&ctx, NULL, 0);
}
for (j=0; j < P.length; j++) {
+ aes_gcm_128_updateC(&ctx, NULL, 0);
+ aes_gcm_128_crypt(&ctx, NULL, 0);
aes_gcm_128_updateC(&ctx, &P.data[j], 1);
aes_gcm_128_crypt(&ctx, &P.data[j], 1);
+ aes_gcm_128_updateC(&ctx, NULL, 0);
+ aes_gcm_128_crypt(&ctx, NULL, 0);
}
aes_gcm_128_digest(&ctx, T);