summaryrefslogtreecommitdiff
path: root/poly1305.h
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2014-01-17 08:52:10 +0100
committerNiels Möller <nisse@lysator.liu.se>2014-01-17 08:52:10 +0100
commit52f99db25d4066e3a783b15533a7b4f0a5f6c2b3 (patch)
treea111130e41204b5a5ebe6bb097fde95ca26929f0 /poly1305.h
parent0164c997554c2e3a236f329b7f8ceccbe3378011 (diff)
downloadnettle-52f99db25d4066e3a783b15533a7b4f0a5f6c2b3.tar.gz
Move nonce from poly1305_ctx to poly1305_aes_ctx.
Diffstat (limited to 'poly1305.h')
-rw-r--r--poly1305.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/poly1305.h b/poly1305.h
index 12c7bdab..3257bf63 100644
--- a/poly1305.h
+++ b/poly1305.h
@@ -35,7 +35,6 @@ extern "C" {
/* Name mangling */
#define poly1305_set_key nettle_poly1305_set_key
-#define poly1305_set_nonce nettle_poly1305_set_nonce
#define poly1305_update nettle_poly1305_update
#define poly1305_block nettle_poly1305_block
#define poly1305_digest nettle_poly1305_digest
@@ -68,13 +67,11 @@ struct poly1305_ctx {
uint64_t h64[2];
} h;
- uint8_t nonce[POLY1305_BLOCK_SIZE];
uint8_t block[POLY1305_BLOCK_SIZE];
unsigned index;
};
void poly1305_set_key(struct poly1305_ctx *ctx, const uint8_t key[POLY1305_KEY_SIZE]);
-void poly1305_set_nonce (struct poly1305_ctx *ctx, const uint8_t * nonce);
void poly1305_block (struct poly1305_ctx *ctx, const uint8_t m[POLY1305_BLOCK_SIZE]);
void poly1305_update (struct poly1305_ctx *ctx, size_t size, const uint8_t *data);
void poly1305_digest (struct poly1305_ctx *ctx,
@@ -84,11 +81,13 @@ void poly1305_digest (struct poly1305_ctx *ctx,
#define POLY1305_AES_KEY_SIZE 32
#define POLY1305_AES_DIGEST_SIZE 16
+#define POLY1305_AES_NONCE_SIZE 16
struct poly1305_aes_ctx
{
/* Must be first element, for the poly1305_aes_update cast to work. */
struct poly1305_ctx pctx;
+ uint8_t nonce[POLY1305_BLOCK_SIZE];
struct aes128_ctx aes;
};