]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
crypt: Use internal names for the SHA-2 block functions
authorFlorian Weimer <fweimer@redhat.com>
Fri, 28 Oct 2016 19:47:44 +0000 (21:47 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 28 Oct 2016 19:49:21 +0000 (21:49 +0200)
These functions are externally visible with a static libcrypt
library.

ChangeLog
crypt/sha256-block.c
crypt/sha256.c
crypt/sha512-block.c
crypt/sha512.c
sysdeps/sparc/sparc64/multiarch/sha256-block.c
sysdeps/sparc/sparc64/multiarch/sha512-block.c

index 5847d6b358c41450fa94a159ee83fe62212b5c63..16313b0d9b879ded2629f561fd8bb2b0c04d8842 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-10-28  Florian Weimer  <fweimer@redhat.com>
+
+       * crypt/sha256.c, crypt/sha256-block.c,
+       sysdeps/sparc/sparc64/multiarch/sha256-block.c: Rename
+       sha256_process_block to __sha256_process_block.
+       * crypt/sha512.c, crypt/sha512-block.c,
+       sysdeps/sparc/sparc64/multiarch/sha512-block.c: Rename
+       sha512_process_block to __sha512_process_block.
+
 2016-10-28  Carlos O'Donell  <carlos@redhat.com>
 
        * elf/Makefile (CFLAGS-tst-linkall-static): Define.
index 8a77096999e670a9b6ca10bfa046a344b8c5bbe2..a44fe01d5b95d02930d4c7b1f68442056ea1ea8f 100644 (file)
@@ -3,7 +3,7 @@
 /* Process LEN bytes of BUFFER, accumulating context into CTX.
    It is assumed that LEN % 64 == 0.  */
 void
-sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx)
+__sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx)
 {
   const uint32_t *words = buffer;
   size_t nwords = len / sizeof (uint32_t);
index e858f4b76050d85fd5df7f0ffc605869c5d09bda..b5497d935dc8d6d4d95bdf373b01665272b9f67a 100644 (file)
@@ -81,8 +81,7 @@ static const uint32_t K[64] =
     0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
   };
 
-void
-sha256_process_block (const void *, size_t, struct sha256_ctx *);
+void __sha256_process_block (const void *, size_t, struct sha256_ctx *);
 
 /* Initialize structure containing state of computation.
    (FIPS 180-2:5.3.2)  */
@@ -131,7 +130,7 @@ __sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
 #endif
 
   /* Process last bytes.  */
-  sha256_process_block (ctx->buffer, bytes + pad + 8, ctx);
+  __sha256_process_block (ctx->buffer, bytes + pad + 8, ctx);
 
   /* Put result from CTX in first 32 bytes following RESBUF.  */
   for (unsigned int i = 0; i < 8; ++i)
@@ -156,7 +155,7 @@ __sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
 
       if (ctx->buflen > 64)
        {
-         sha256_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
+         __sha256_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
 
          ctx->buflen &= 63;
          /* The regions in the following copy operation cannot overlap.  */
@@ -182,14 +181,14 @@ __sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
       if (UNALIGNED_P (buffer))
        while (len > 64)
          {
-           sha256_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
+           __sha256_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
            buffer = (const char *) buffer + 64;
            len -= 64;
          }
       else
 #endif
        {
-         sha256_process_block (buffer, len & ~63, ctx);
+         __sha256_process_block (buffer, len & ~63, ctx);
          buffer = (const char *) buffer + (len & ~63);
          len &= 63;
        }
@@ -204,7 +203,7 @@ __sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
       left_over += len;
       if (left_over >= 64)
        {
-         sha256_process_block (ctx->buffer, 64, ctx);
+         __sha256_process_block (ctx->buffer, 64, ctx);
          left_over -= 64;
          memcpy (ctx->buffer, &ctx->buffer[64], left_over);
        }
index c542db1c9cb4633d739b0584ab4632f2ed25e335..577839fe5ca8070d9adc516fe8a68a3224e0bced 100644 (file)
@@ -3,7 +3,7 @@
 /* Process LEN bytes of BUFFER, accumulating context into CTX.
    It is assumed that LEN % 128 == 0.  */
 void
-sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx)
+__sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx)
 {
   const uint64_t *words = buffer;
   size_t nwords = len / sizeof (uint64_t);
index 47f3f7c60e7c3a30553d6e1a35bfa9b85624a11a..dd2af3c0aab41c32aafffcc1b3ac76a5c413881d 100644 (file)
@@ -101,8 +101,8 @@ static const uint64_t K[80] =
     UINT64_C (0x5fcb6fab3ad6faec), UINT64_C (0x6c44198c4a475817)
   };
 
-void
-sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx);
+void __sha512_process_block (const void *buffer, size_t len,
+                            struct sha512_ctx *ctx);
 
 /* Initialize structure containing state of computation.
    (FIPS 180-2:5.3.3)  */
@@ -153,7 +153,7 @@ __sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
                                           (ctx->total[TOTAL128_low] >> 61));
 
   /* Process last bytes.  */
-  sha512_process_block (ctx->buffer, bytes + pad + 16, ctx);
+  __sha512_process_block (ctx->buffer, bytes + pad + 16, ctx);
 
   /* Put result from CTX in first 64 bytes following RESBUF.  */
   for (unsigned int i = 0; i < 8; ++i)
@@ -178,7 +178,7 @@ __sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
 
       if (ctx->buflen > 128)
        {
-         sha512_process_block (ctx->buffer, ctx->buflen & ~127, ctx);
+         __sha512_process_block (ctx->buffer, ctx->buflen & ~127, ctx);
 
          ctx->buflen &= 127;
          /* The regions in the following copy operation cannot overlap.  */
@@ -204,7 +204,7 @@ __sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
       if (UNALIGNED_P (buffer))
        while (len > 128)
          {
-           sha512_process_block (memcpy (ctx->buffer, buffer, 128), 128,
+           __sha512_process_block (memcpy (ctx->buffer, buffer, 128), 128,
                                    ctx);
            buffer = (const char *) buffer + 128;
            len -= 128;
@@ -212,7 +212,7 @@ __sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
       else
 #endif
        {
-         sha512_process_block (buffer, len & ~127, ctx);
+         __sha512_process_block (buffer, len & ~127, ctx);
          buffer = (const char *) buffer + (len & ~127);
          len &= 127;
        }
@@ -227,7 +227,7 @@ __sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
       left_over += len;
       if (left_over >= 128)
        {
-         sha512_process_block (ctx->buffer, 128, ctx);
+         __sha512_process_block (ctx->buffer, 128, ctx);
          left_over -= 128;
          memcpy (ctx->buffer, &ctx->buffer[128], left_over);
        }
index 79966b93d7fc9213fd8b2cb880f37620d5e95dc5..9d65315a5a04365d77548ff36a2be547add00131 100644 (file)
@@ -1,12 +1,12 @@
 #include <sparc-ifunc.h>
 
-#define sha256_process_block sha256_process_block_generic
-extern void sha256_process_block_generic (const void *buffer, size_t len,
-                                         struct sha256_ctx *ctx);
+#define __sha256_process_block __sha256_process_block_generic
+extern void __sha256_process_block_generic (const void *buffer, size_t len,
+                                           struct sha256_ctx *ctx);
 
 #include <crypt/sha256-block.c>
 
-#undef sha256_process_block
+#undef __sha256_process_block
 
 extern void __sha256_process_block_crop (const void *buffer, size_t len,
                                         struct sha256_ctx *ctx);
@@ -25,6 +25,8 @@ static bool cpu_supports_sha256(int hwcap)
   return false;
 }
 
-extern void sha256_process_block (const void *buffer, size_t len,
-                                 struct sha256_ctx *ctx);
-sparc_libc_ifunc(sha256_process_block, cpu_supports_sha256(hwcap) ? __sha256_process_block_crop : sha256_process_block_generic);
+extern void __sha256_process_block (const void *buffer, size_t len,
+                                   struct sha256_ctx *ctx);
+sparc_libc_ifunc (__sha256_process_block,
+                 cpu_supports_sha256(hwcap) ? __sha256_process_block_crop
+                   : __sha256_process_block_generic);
index 0d1c3dd6d8c278af142cab161917c0db766bbd4a..2863e05d09126549f96e5cf2ec933a993a18f818 100644 (file)
@@ -1,12 +1,12 @@
 #include <sparc-ifunc.h>
 
-#define sha512_process_block sha512_process_block_generic
-extern void sha512_process_block_generic (const void *buffer, size_t len,
-                                         struct sha512_ctx *ctx);
+#define __sha512_process_block __sha512_process_block_generic
+extern void __sha512_process_block_generic (const void *buffer, size_t len,
+                                           struct sha512_ctx *ctx);
 
 #include <crypt/sha512-block.c>
 
-#undef sha512_process_block
+#undef __sha512_process_block
 
 extern void __sha512_process_block_crop (const void *buffer, size_t len,
                                         struct sha512_ctx *ctx);
@@ -25,6 +25,8 @@ static bool cpu_supports_sha512(int hwcap)
   return false;
 }
 
-extern void sha512_process_block (const void *buffer, size_t len,
-                                 struct sha512_ctx *ctx);
-sparc_libc_ifunc(sha512_process_block, cpu_supports_sha512(hwcap) ? __sha512_process_block_crop : sha512_process_block_generic);
+extern void __sha512_process_block (const void *buffer, size_t len,
+                                   struct sha512_ctx *ctx);
+sparc_libc_ifunc (__sha512_process_block,
+                 cpu_supports_sha512(hwcap) ? __sha512_process_block_crop
+                   : __sha512_process_block_generic);