diff options
author | Maamoun TK <maamoun.tk@googlemail.com> | 2022-11-01 08:09:44 +0200 |
---|---|---|
committer | Maamoun TK <maamoun.tk@googlemail.com> | 2022-11-01 08:09:44 +0200 |
commit | aec77fd3b29663ca5b2b7094b3b590e4262da6b4 (patch) | |
tree | a7ab2d4f687d98e01e0beb45f24f1b441cdab2aa /poly1305-update.c | |
parent | 57dce2ba98b2fc2dda44353e4eebdc3b7c932200 (diff) | |
download | nettle-aec77fd3b29663ca5b2b7094b3b590e4262da6b4.tar.gz |
[PowerPC] Implement _nettle_poly1305_blocks based on radix 2^44
Diffstat (limited to 'poly1305-update.c')
-rw-r--r-- | poly1305-update.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/poly1305-update.c b/poly1305-update.c index fdc72558..5493e17b 100644 --- a/poly1305-update.c +++ b/poly1305-update.c @@ -37,6 +37,21 @@ #include "poly1305-internal.h" #include "md-internal.h" +#if HAVE_NATIVE_fat_poly1305_blocks +const uint8_t * +_nettle_poly1305_blocks_c(struct poly1305_ctx *ctx, + size_t blocks, const uint8_t *m); + +const uint8_t * +_nettle_poly1305_blocks_c(struct poly1305_ctx *ctx, + size_t blocks, const uint8_t *m) +{ + for (; blocks; blocks--, m += POLY1305_BLOCK_SIZE) + _nettle_poly1305_block(ctx, m, 1); + return m; +} +#endif + unsigned _nettle_poly1305_update (struct poly1305_ctx *ctx, uint8_t *block, unsigned index, @@ -49,7 +64,7 @@ _nettle_poly1305_update (struct poly1305_ctx *ctx, length, m); _nettle_poly1305_block(ctx, block, 1); } -#if HAVE_NATIVE_poly1305_blocks +#if HAVE_NATIVE_poly1305_blocks || HAVE_NATIVE_fat_poly1305_blocks m = _nettle_poly1305_blocks (ctx, length >> 4, m); length &= 15; #else |