mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
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>
This commit is contained in:
parent
683eda2f92
commit
80c8a1ca95
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user