summaryrefslogtreecommitdiff
path: root/poly1305.h
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2013-12-19 13:07:18 +0100
committerNiels Möller <nisse@lysator.liu.se>2013-12-19 13:07:18 +0100
commit2667d597ab530f3a6b50bb1d7690839fd2fd0d32 (patch)
tree2b2391b2d55d1c1d3706dc8256060a0fa01e398f /poly1305.h
parent2cd7a85468fc3202c8a1e18f64712a0f00fd5636 (diff)
downloadnettle-2667d597ab530f3a6b50bb1d7690839fd2fd0d32.tar.gz
New function poly1305_update.
Diffstat (limited to 'poly1305.h')
-rw-r--r--poly1305.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/poly1305.h b/poly1305.h
index 3f71d8b1..13b2d6c8 100644
--- a/poly1305.h
+++ b/poly1305.h
@@ -30,9 +30,7 @@
extern "C" {
#endif
-/* Low level functions/macros for the poly1305 construction.
- * For the macros to be useful include macros.h
- */
+/* Low level functions/macros for the poly1305 construction. */
#include "nettle-types.h"
@@ -46,7 +44,7 @@ struct poly1305_ctx {
uint32_t s32[3];
/* State, represented as words of 26, 32 or 64 bits, depending on
implementation. */
- /* High bits, first to maintain alignment. */
+ /* High bits first, to maintain alignment. */
uint32_t hh;
union
{
@@ -65,13 +63,14 @@ struct poly1305_ctx {
#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
void poly1305_set_key(struct poly1305_ctx *ctx, const uint8_t key[16]);
void poly1305_set_nonce (struct poly1305_ctx *ctx, const uint8_t * nonce);
void poly1305_block (struct poly1305_ctx *ctx, const uint8_t m[16]);
-
+void poly1305_update (struct poly1305_ctx *ctx, size_t size, const uint8_t *data);
void poly1305_digest (struct poly1305_ctx *ctx,
size_t length, uint8_t *digest, const uint8_t *s);
@@ -85,14 +84,6 @@ void poly1305_digest (struct poly1305_ctx *ctx,
#define POLY1305_SET_NONCE(ctx, data) \
poly1305_set_nonce(&(ctx)->pctx, (data))
-#define _POLY1305_BLOCK(ctx, block) do { \
- poly1305_block(ctx, block); \
- } while (0)
-
-
-#define POLY1305_UPDATE(ctx, length, data) \
- MD_UPDATE (&(ctx)->pctx, (length), (data), _POLY1305_BLOCK, (void) 0)
-
#define POLY1305_DIGEST(ctx, encrypt, length, digest) \
do { \
uint8_t _ts[16]; \