From 52f99db25d4066e3a783b15533a7b4f0a5f6c2b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Fri, 17 Jan 2014 08:52:10 +0100 Subject: Move nonce from poly1305_ctx to poly1305_aes_ctx. --- poly1305-aes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'poly1305-aes.c') diff --git a/poly1305-aes.c b/poly1305-aes.c index 847bf34d..8a7d9d13 100644 --- a/poly1305-aes.c +++ b/poly1305-aes.c @@ -40,7 +40,7 @@ void poly1305_aes_set_nonce (struct poly1305_aes_ctx *ctx, const uint8_t * nonce) { - poly1305_set_nonce(&ctx->pctx, nonce); + memcpy (ctx->nonce, nonce, POLY1305_AES_NONCE_SIZE); } void @@ -48,8 +48,8 @@ poly1305_aes_digest (struct poly1305_aes_ctx *ctx, size_t length, uint8_t * digest) { uint8_t s[POLY1305_BLOCK_SIZE]; - aes128_encrypt(&ctx->aes, POLY1305_BLOCK_SIZE, s, ctx->pctx.nonce); + aes128_encrypt(&ctx->aes, POLY1305_BLOCK_SIZE, s, ctx->nonce); poly1305_digest (&ctx->pctx, length, digest, s); - INCREMENT (16, (ctx)->pctx.nonce); - (ctx)->pctx.index = 0; + INCREMENT (16, ctx->nonce); + ctx->pctx.index = 0; } -- cgit v1.2.1