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

index ba61efc684dc0f62d14b8b92832c107b7f0fdb89..707f7e16f0fd966b888c255c21e128dd179b7205 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
        * dsa-internal.h: Likewise.
        * gost28147-internal.h: Likewise.
        * poly1305-internal.h: Likewise.
+       * salsa20-internal.h: Likewise.
 
 2020-11-26  Niels Möller  <nisse@lysator.liu.se>
 
index f9d3daf2301dc71722c321066a7963a3c011c4ff..8f6b2fc9a391bcfc6421533619b9b753e59fb8c6 100644 (file)
@@ -94,7 +94,7 @@ _nettle_salsa20_core_c(uint32_t *dst, const uint32_t *src, unsigned rounds);
   } while(0)
 
 void
-_salsa20_core(uint32_t *dst, const uint32_t *src, unsigned rounds)
+_nettle_salsa20_core(uint32_t *dst, const uint32_t *src, unsigned rounds)
 {
   uint32_t x[_SALSA20_INPUT_LENGTH];
   unsigned i;
index da4732bcd192cb3a6d29460dead5c1a2b2daa5bc..6d53bc2bc652bbbb29ce5c326c864a197ad6136c 100644 (file)
 #include "memxor.h"
 
 #if HAVE_NATIVE_salsa20_2core
-#undef _salsa20_crypt_2core
-#define _salsa20_crypt_2core _salsa20_crypt
+#define _nettle_salsa20_crypt_2core _nettle_salsa20_crypt
 #elif !HAVE_NATIVE_fat_salsa20_2core
-#undef _salsa20_crypt_1core
-#define _salsa20_crypt_1core _salsa20_crypt
+#define _nettle_salsa20_crypt_1core _nettle_salsa20_crypt
 #endif
 
 #if HAVE_NATIVE_salsa20_2core || HAVE_NATIVE_fat_salsa20_2core
 void
-_salsa20_crypt_2core(struct salsa20_ctx *ctx, unsigned rounds,
-                    size_t length, uint8_t *dst,
-                    const uint8_t *src)
+_nettle_salsa20_crypt_2core(struct salsa20_ctx *ctx, unsigned rounds,
+                           size_t length, uint8_t *dst,
+                           const uint8_t *src)
 {
   uint32_t x[2*_SALSA20_INPUT_LENGTH];
   while (length > SALSA20_BLOCK_SIZE)
     {
-      _salsa20_2core (x, ctx->input, rounds);
+      _nettle_salsa20_2core (x, ctx->input, rounds);
       ctx->input[8] += 2;
       ctx->input[9] += (ctx->input[8] < 2);
       if (length <= 2 * SALSA20_BLOCK_SIZE)
@@ -75,7 +73,7 @@ _salsa20_crypt_2core(struct salsa20_ctx *ctx, unsigned rounds,
       dst += 2*SALSA20_BLOCK_SIZE;
       src += 2*SALSA20_BLOCK_SIZE;
     }
-  _salsa20_core (x, ctx->input, rounds);
+  _nettle_salsa20_core (x, ctx->input, rounds);
   ctx->input[9] += (++ctx->input[8] == 0);
   memxor3 (dst, src, x, length);
 }
@@ -83,16 +81,16 @@ _salsa20_crypt_2core(struct salsa20_ctx *ctx, unsigned rounds,
 
 #if !HAVE_NATIVE_salsa20_2core
 void
-_salsa20_crypt_1core(struct salsa20_ctx *ctx, unsigned rounds,
-                    size_t length,
-                    uint8_t *dst,
-                    const uint8_t *src)
+_nettle_salsa20_crypt_1core(struct salsa20_ctx *ctx, unsigned rounds,
+                           size_t length,
+                           uint8_t *dst,
+                           const uint8_t *src)
 {
   for (;;)
     {
       uint32_t x[_SALSA20_INPUT_LENGTH];
 
-      _salsa20_core (x, ctx->input, rounds);
+      _nettle_salsa20_core (x, ctx->input, rounds);
 
       ctx->input[9] += (++ctx->input[8] == 0);
 
index 2031d42db9666b1859eb2937ec6765a6743cd927..cca9d6d9b2ca6f68c8be6acc825e5bd7222271b1 100644 (file)
@@ -53,5 +53,5 @@ salsa20_crypt(struct salsa20_ctx *ctx,
   if (!length)
     return;
 
-  _salsa20_crypt (ctx, 20, length, c, m);
+  _nettle_salsa20_crypt (ctx, 20, length, c, m);
 }
index 8d7684e0991df4e424d540aa3a32cb2d8b0db991..c5230db8fdb3e8ef15390d0c32b362aa04e9ee55 100644 (file)
 #include "nettle-types.h"
 #include "salsa20.h"
 
-#define _salsa20_core _nettle_salsa20_core
-#define _salsa20_2core _nettle_salsa20_2core
-#define _salsa20_crypt _nettle_salsa20_crypt
-#define _salsa20_crypt_1core _nettle_salsa20_crypt_1core
-#define _salsa20_crypt_2core _nettle_salsa20_crypt_2core
-
 void
-_salsa20_core(uint32_t *dst, const uint32_t *src, unsigned rounds);
+_nettle_salsa20_core(uint32_t *dst, const uint32_t *src, unsigned rounds);
 
 void
-_salsa20_crypt(struct salsa20_ctx *ctx, unsigned rounds,
-              size_t length, uint8_t *dst,
-              const uint8_t *src);
+_nettle_salsa20_crypt(struct salsa20_ctx *ctx, unsigned rounds,
+                     size_t length, uint8_t *dst,
+                     const uint8_t *src);
 
 /* Functions available only in some configurations */
 void
-_salsa20_2core(uint32_t *dst, const uint32_t *src, unsigned rounds);
+_nettle_salsa20_2core(uint32_t *dst, const uint32_t *src, unsigned rounds);
 
 void
-_salsa20_crypt_1core(struct salsa20_ctx *ctx, unsigned rounds,
-                    size_t length, uint8_t *dst,
-                    const uint8_t *src);
+_nettle_salsa20_crypt_1core(struct salsa20_ctx *ctx, unsigned rounds,
+                           size_t length, uint8_t *dst,
+                           const uint8_t *src);
 void
-_salsa20_crypt_2core(struct salsa20_ctx *ctx, unsigned rounds,
-                    size_t length, uint8_t *dst,
-                    const uint8_t *src);
+_nettle_salsa20_crypt_2core(struct salsa20_ctx *ctx, unsigned rounds,
+                           size_t length, uint8_t *dst,
+                           const uint8_t *src);
 
 #endif /* NETTLE_SALSA20_INTERNAL_H_INCLUDED */
index 9515251aeaa6a1b176dc3f0ed8d14b6a839b0ee0..a20e1a074acae9a01c3bae5b1fb258877c896297 100644 (file)
@@ -53,5 +53,5 @@ salsa20r12_crypt(struct salsa20_ctx *ctx,
   if (!length)
     return;
 
-  _salsa20_crypt (ctx, 12, length, c, m);
+  _nettle_salsa20_crypt (ctx, 12, length, c, m);
 }