From: Niels Möller Date: Mon, 30 Nov 2020 13:49:17 +0000 (+0100) Subject: Delete name mangling of internal poly1305 symbols X-Git-Tag: nettle_3.7rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d066c53084a639c31d291174e27a26487f1df70a;p=thirdparty%2Fnettle.git Delete name mangling of internal poly1305 symbols --- diff --git a/ChangeLog b/ChangeLog index bf5ae93a..ba61efc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ * ctr-internal.h: Likewise. * dsa-internal.h: Likewise. * gost28147-internal.h: Likewise. + * poly1305-internal.h: Likewise. 2020-11-26 Niels Möller diff --git a/chacha-poly1305.c b/chacha-poly1305.c index 3eb37cd5..7a423e1e 100644 --- a/chacha-poly1305.c +++ b/chacha-poly1305.c @@ -81,7 +81,7 @@ chacha_poly1305_set_nonce (struct chacha_poly1305_ctx *ctx, chacha_set_nonce96 (&ctx->chacha, nonce); /* Generate authentication key */ _nettle_chacha_core (u.x, ctx->chacha.state, CHACHA_ROUNDS); - _poly1305_set_key (&ctx->poly1305, u.subkey); + _nettle_poly1305_set_key (&ctx->poly1305, u.subkey); /* For final poly1305 processing */ memcpy (ctx->s.b, u.subkey + 16, 16); /* Increment block count */ @@ -91,7 +91,7 @@ chacha_poly1305_set_nonce (struct chacha_poly1305_ctx *ctx, } /* FIXME: Duplicated in poly1305-aes128.c */ -#define COMPRESS(ctx, data) _poly1305_block(&(ctx)->poly1305, (data), 1) +#define COMPRESS(ctx, data) _nettle_poly1305_block(&(ctx)->poly1305, (data), 1) static void poly1305_update (struct chacha_poly1305_ctx *ctx, @@ -107,7 +107,7 @@ poly1305_pad (struct chacha_poly1305_ctx *ctx) { memset (ctx->block + ctx->index, 0, POLY1305_BLOCK_SIZE - ctx->index); - _poly1305_block(&ctx->poly1305, ctx->block, 1); + _nettle_poly1305_block(&ctx->poly1305, ctx->block, 1); ctx->index = 0; } } @@ -161,8 +161,8 @@ chacha_poly1305_digest (struct chacha_poly1305_ctx *ctx, LE_WRITE_UINT64 (buf, ctx->auth_size); LE_WRITE_UINT64 (buf + 8, ctx->data_size); - _poly1305_block (&ctx->poly1305, buf, 1); + _nettle_poly1305_block (&ctx->poly1305, buf, 1); - _poly1305_digest (&ctx->poly1305, &ctx->s); + _nettle_poly1305_digest (&ctx->poly1305, &ctx->s); memcpy (digest, &ctx->s.b, length); } diff --git a/poly1305-aes.c b/poly1305-aes.c index 85a6d2ae..a4050254 100644 --- a/poly1305-aes.c +++ b/poly1305-aes.c @@ -45,7 +45,7 @@ void poly1305_aes_set_key (struct poly1305_aes_ctx *ctx, const uint8_t * key) { aes128_set_encrypt_key(&ctx->aes, (key)); - _poly1305_set_key(&ctx->pctx, (key+16)); + _nettle_poly1305_set_key(&ctx->pctx, (key+16)); ctx->index = 0; } @@ -56,7 +56,7 @@ poly1305_aes_set_nonce (struct poly1305_aes_ctx *ctx, memcpy (ctx->nonce, nonce, POLY1305_AES_NONCE_SIZE); } -#define COMPRESS(ctx, data) _poly1305_block(&(ctx)->pctx, (data), 1) +#define COMPRESS(ctx, data) _nettle_poly1305_block(&(ctx)->pctx, (data), 1) void poly1305_aes_update (struct poly1305_aes_ctx *ctx, @@ -79,11 +79,11 @@ poly1305_aes_digest (struct poly1305_aes_ctx *ctx, memset (ctx->block + ctx->index + 1, 0, POLY1305_BLOCK_SIZE - 1 - ctx->index); - _poly1305_block (&ctx->pctx, ctx->block, 0); + _nettle_poly1305_block (&ctx->pctx, ctx->block, 0); } aes128_encrypt(&ctx->aes, POLY1305_BLOCK_SIZE, s.b, ctx->nonce); - _poly1305_digest (&ctx->pctx, &s); + _nettle_poly1305_digest (&ctx->pctx, &s); memcpy (digest, s.b, length); INCREMENT (16, ctx->nonce); diff --git a/poly1305-internal.c b/poly1305-internal.c index 8713fcb6..490fdf71 100644 --- a/poly1305-internal.c +++ b/poly1305-internal.c @@ -86,7 +86,7 @@ #define h4 hh void -_poly1305_set_key(struct poly1305_ctx *ctx, const uint8_t key[16]) +_nettle_poly1305_set_key(struct poly1305_ctx *ctx, const uint8_t key[16]) { uint32_t t0,t1,t2,t3; @@ -114,7 +114,7 @@ _poly1305_set_key(struct poly1305_ctx *ctx, const uint8_t key[16]) } void -_poly1305_block (struct poly1305_ctx *ctx, const uint8_t *m, unsigned t4) +_nettle_poly1305_block (struct poly1305_ctx *ctx, const uint8_t *m, unsigned t4) { uint32_t t0,t1,t2,t3; uint32_t b; @@ -149,7 +149,7 @@ _poly1305_block (struct poly1305_ctx *ctx, const uint8_t *m, unsigned t4) /* Adds digest to the nonce */ void -_poly1305_digest (struct poly1305_ctx *ctx, union nettle_block16 *s) +_nettle_poly1305_digest (struct poly1305_ctx *ctx, union nettle_block16 *s) { uint32_t b, nb; uint64_t f0,f1,f2,f3; diff --git a/poly1305-internal.h b/poly1305-internal.h index f6b7ee83..9932d524 100644 --- a/poly1305-internal.h +++ b/poly1305-internal.h @@ -41,23 +41,18 @@ extern "C" { #endif -/* Name mangling */ -#define _poly1305_set_key _nettle_poly1305_set_key -#define _poly1305_digest _nettle_poly1305_digest -#define _poly1305_block _nettle_poly1305_block - /* Low level functions/macros for the poly1305 construction. */ #define POLY1305_DIGEST_SIZE 16 #define POLY1305_KEY_SIZE 16 /* Low-level internal interface. */ -void _poly1305_set_key(struct poly1305_ctx *ctx, const uint8_t key[POLY1305_KEY_SIZE]); +void _nettle_poly1305_set_key(struct poly1305_ctx *ctx, const uint8_t key[POLY1305_KEY_SIZE]); /* Extracts digest, and adds it to s, the encrypted nonce. */ -void _poly1305_digest (struct poly1305_ctx *ctx, union nettle_block16 *s); -/* Internal function. Process one block. */ -void _poly1305_block (struct poly1305_ctx *ctx, const uint8_t *m, - unsigned high); +void _nettle_poly1305_digest (struct poly1305_ctx *ctx, union nettle_block16 *s); +/* Process one block. */ +void _nettle_poly1305_block (struct poly1305_ctx *ctx, const uint8_t *m, + unsigned high); #ifdef __cplusplus }