Commit 5a66bb56 authored by Niels Möller's avatar Niels Möller

Make poly1305 code use struct aes128_ctx.

parent 2667d597
2014-01-16 Niels Möller <nisse@lysator.liu.se>
* poly1305-aes.h (struct poly1305_aes_ctx): Replace struct aes_ctx
by struct aes128_ctx.
* poly1305-aes.c (poly1305_aes_set_key, poly1305_aes_digest):
Update to use aes128_* functions.
* poly1305.h (POLY1305_SET_KEY): Drop key size argument when
calling set_key.
2013-12-19 Niels Möller <nisse@lysator.liu.se>
* poly1305-aes.h (poly1305_aes_update): Define as an alias for
......
......@@ -30,7 +30,7 @@
void
poly1305_aes_set_key (struct poly1305_aes_ctx *ctx, const uint8_t * key)
{
POLY1305_SET_KEY(ctx, aes_set_encrypt_key, key);
POLY1305_SET_KEY(ctx, aes128_set_encrypt_key, key);
}
void
......@@ -44,5 +44,5 @@ void
poly1305_aes_digest (struct poly1305_aes_ctx *ctx,
size_t length, uint8_t * digest)
{
POLY1305_DIGEST(ctx, aes_encrypt, length, digest);
POLY1305_DIGEST(ctx, aes128_encrypt, length, digest);
}
......@@ -41,7 +41,7 @@ extern "C" {
#define poly1305_aes_set_nonce nettle_poly1305_aes_set_nonce
#define poly1305_aes_digest nettle_poly1305_aes_digest
struct poly1305_aes_ctx POLY1305_CTX(struct aes_ctx);
struct poly1305_aes_ctx POLY1305_CTX(struct aes128_ctx);
/* The _set_key function initialize the nonce to zero. */
void
......
/* poly1305-aes.h
/* poly1305.h
*
* Poly1305 message authentication code.
*/
......@@ -77,7 +77,7 @@ void poly1305_digest (struct poly1305_ctx *ctx,
#define POLY1305_SET_KEY(ctx, set_key, key) \
do { \
poly1305_set_key(&(ctx)->pctx, (key+16)); \
(set_key)(&(ctx)->cipher, 16, (key)); \
(set_key)(&(ctx)->cipher, (key)); \
(ctx)->pctx.index = 0; \
} while (0)
......
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