aboutsummaryrefslogtreecommitdiff
path: root/crypt
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2016-10-28 21:47:44 +0200
committerFlorian Weimer <fweimer@redhat.com>2016-10-28 21:49:21 +0200
commit09472915dd89305ba5d318902a214d24945d223e (patch)
tree0c88f8c559eb5497deb15a3ea97b00f9556a6882 /crypt
parentFix building tst-linkall-static. (diff)
downloadglibc-09472915dd89305ba5d318902a214d24945d223e.tar.gz
glibc-09472915dd89305ba5d318902a214d24945d223e.tar.bz2
glibc-09472915dd89305ba5d318902a214d24945d223e.zip
crypt: Use internal names for the SHA-2 block functions
These functions are externally visible with a static libcrypt library.
Diffstat (limited to 'crypt')
-rw-r--r--crypt/sha256-block.c2
-rw-r--r--crypt/sha256.c13
-rw-r--r--crypt/sha512-block.c2
-rw-r--r--crypt/sha512.c14
4 files changed, 15 insertions, 16 deletions
diff --git a/crypt/sha256-block.c b/crypt/sha256-block.c
index 8a77096999..a44fe01d5b 100644
--- a/crypt/sha256-block.c
+++ b/crypt/sha256-block.c
@@ -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);
diff --git a/crypt/sha256.c b/crypt/sha256.c
index e858f4b760..b5497d935d 100644
--- a/crypt/sha256.c
+++ b/crypt/sha256.c
@@ -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);
}
diff --git a/crypt/sha512-block.c b/crypt/sha512-block.c
index c542db1c9c..577839fe5c 100644
--- a/crypt/sha512-block.c
+++ b/crypt/sha512-block.c
@@ -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);
diff --git a/crypt/sha512.c b/crypt/sha512.c
index 47f3f7c60e..dd2af3c0aa 100644
--- a/crypt/sha512.c
+++ b/crypt/sha512.c
@@ -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);
}