diff options
author | Niels Möller <nisse@lysator.liu.se> | 2014-01-17 08:52:10 +0100 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2014-01-17 08:52:10 +0100 |
commit | 52f99db25d4066e3a783b15533a7b4f0a5f6c2b3 (patch) | |
tree | a111130e41204b5a5ebe6bb097fde95ca26929f0 /poly1305-aes.c | |
parent | 0164c997554c2e3a236f329b7f8ceccbe3378011 (diff) | |
download | nettle-52f99db25d4066e3a783b15533a7b4f0a5f6c2b3.tar.gz |
Move nonce from poly1305_ctx to poly1305_aes_ctx.
Diffstat (limited to 'poly1305-aes.c')
-rw-r--r-- | poly1305-aes.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |