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

Delete length argument from GCM_SET_KEY.

parent b85125a8
2014-01-25 Niels Möller <nisse@lysator.liu.se>
* gcm.h (GCM_SET_KEY): Deleted length argument.
* gcm-aes.c (gcm_aes_set_key): Use aes_set_encrypt_key and
gcm_set_key, can no longer use GCM_SET_KEY macro.
2014-01-23 Niels Möller <nisse@lysator.liu.se>
* testsuite/gcm-test.c (test_main): Use the correct
......
......@@ -32,7 +32,9 @@
void
gcm_aes_set_key(struct gcm_aes_ctx *ctx, size_t length, const uint8_t *key)
{
GCM_SET_KEY(ctx, aes_set_encrypt_key, aes_encrypt, length, key);
aes_set_encrypt_key (&ctx->cipher, length, key);
gcm_set_key (&ctx->key, &ctx->cipher,
(nettle_crypt_func *) aes_encrypt);
}
void
......
......@@ -115,9 +115,9 @@ gcm_digest(struct gcm_ctx *ctx, const struct gcm_key *key,
{ type cipher; struct gcm_key key; struct gcm_ctx gcm; }
/* NOTE: Avoid using NULL, as we don't include anything defining it. */
#define GCM_SET_KEY(ctx, set_key, encrypt, length, data) \
#define GCM_SET_KEY(ctx, set_key, encrypt, key) \
do { \
(set_key)(&(ctx)->cipher, (length), (data)); \
(set_key)(&(ctx)->cipher, (key)); \
if (0) (encrypt)(&(ctx)->cipher, 0, (void *)0, (void *)0); \
gcm_set_key(&(ctx)->key, &(ctx)->cipher, \
(nettle_crypt_func *) (encrypt)); \
......
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