]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Delete name mangling of internal poly1305 symbols
authorNiels Möller <nisse@lysator.liu.se>
Mon, 30 Nov 2020 13:49:17 +0000 (14:49 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 30 Nov 2020 13:49:17 +0000 (14:49 +0100)
ChangeLog
chacha-poly1305.c
poly1305-aes.c
poly1305-internal.c
poly1305-internal.h

index bf5ae93a71e0379f7e6fd1b08f72059188507d65..ba61efc684dc0f62d14b8b92832c107b7f0fdb89 100644 (file)
--- 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  <nisse@lysator.liu.se>
 
index 3eb37cd52fe8f2c501dd411b07d85a1319137b1b..7a423e1e627ac12cd221468063f8c3e9c5f292e4 100644 (file)
@@ -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);
 }
index 85a6d2ae138b2d69a6156d6494edd5fd1f6734c6..a4050254bb9ff15d4ad553f72bec26231a2bdcc6 100644 (file)
@@ -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);
index 8713fcb6889404c8805af6721b3846b55059f347..490fdf714aa7f253aeadcbb1abb24f1987ce95d6 100644 (file)
@@ -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;
index f6b7ee83540d82fc43efcd0c40a4072b044aaf38..9932d5245eee33b097aced314accade9fcc08ac2 100644 (file)
 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
 }