Commit bbecbf2b authored by Niels Möller's avatar Niels Möller

In aead tests, use aead->digest_size.

parent 360dfd98
2014-04-11 Niels Möller <nisse@lysator.liu.se>
* testsuite/testutils.c (test_aead): Use aead->digest_size.
* configure.ac: Skip GMP tests if public key support is disabled.
* eax.c (block16_xor): Fixed bug effecting 32-bit platforms.
......
......@@ -478,19 +478,19 @@ test_aead(const struct nettle_aead *aead,
{
void *ctx = xalloc(aead->context_size);
uint8_t *data;
uint8_t *buffer = xalloc(aead->block_size);
uint8_t *buffer = xalloc(aead->digest_size);
size_t length;
ASSERT (cleartext->length == ciphertext->length);
length = cleartext->length;
ASSERT (key->length == aead->key_size);
ASSERT (digest->length <= aead->block_size);
ASSERT (digest->length <= aead->digest_size);
data = xalloc(length);
/* encryption */
memset(buffer, 0, aead->block_size);
memset(buffer, 0, aead->digest_size);
aead->set_encrypt_key(ctx, key->data);
if (nonce->length != aead->nonce_size)
......@@ -513,7 +513,7 @@ test_aead(const struct nettle_aead *aead,
ASSERT(MEMEQ(digest->length, buffer, digest->data));
/* decryption */
memset(buffer, 0, aead->block_size);
memset(buffer, 0, aead->digest_size);
aead->set_decrypt_key(ctx, key->data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment