diff options
author | Brian Fitzpatrick <fitz@apache.org> | 2005-12-07 18:29:06 +0000 |
---|---|---|
committer | Brian Fitzpatrick <fitz@apache.org> | 2005-12-07 18:29:06 +0000 |
commit | 16557bf84bee92ba69a2d61e0fa44f03c8b4f89d (patch) | |
tree | bf866f25161dd68ddc79f821fbb64f2e9df7efcb /random/unix | |
parent | b3b0e3cb8b8f521112bc770c59a7072697054b97 (diff) | |
download | apr-16557bf84bee92ba69a2d61e0fa44f03c8b4f89d.tar.gz |
Prefix non-static symbols with 'apr__' to avoid namespace conflicts.
* random/unix/sha2.h, random/unix/sha2_glue.c, random/unix/sha2.c:
Rename SHA256_Init, SHA256_Update, SHA256_Final, SHA256_Transform,
SHA384_Init, SHA512_Init, SHA512_Final, SHA384_Final, SHA512_Update,
SHA384_Update, and SHA512_Transform, , to apr__SHA256_Init,
apr__SHA256_Update, apr__SHA256_Final, apr__SHA256_Transform,
apr__SHA384_Init, apr__SHA512_Init, apr__SHA512_Final,
apr__SHA384_Final, apr__SHA512_Update, apr__SHA384_Update, and
apr__SHA512_Transform.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@354824 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'random/unix')
-rw-r--r-- | random/unix/sha2.c | 66 | ||||
-rw-r--r-- | random/unix/sha2.h | 18 | ||||
-rw-r--r-- | random/unix/sha2_glue.c | 6 |
3 files changed, 45 insertions, 45 deletions
diff --git a/random/unix/sha2.c b/random/unix/sha2.c index 94259ca85..1605b9d5a 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -151,8 +151,8 @@ typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ * only. */ void SHA512_Last(SHA512_CTX*); -void SHA256_Transform(SHA256_CTX*, const sha2_word32*); -void SHA512_Transform(SHA512_CTX*, const sha2_word64*); +void apr__SHA256_Transform(SHA256_CTX*, const sha2_word32*); +void apr__SHA512_Transform(SHA512_CTX*, const sha2_word64*); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ @@ -264,7 +264,7 @@ static const char *sha2_hex_digits = "0123456789abcdef"; /*** SHA-256: *********************************************************/ -void SHA256_Init(SHA256_CTX* context) { +void apr__SHA256_Init(SHA256_CTX* context) { if (context == (SHA256_CTX*)0) { return; } @@ -310,7 +310,7 @@ void SHA256_Init(SHA256_CTX* context) { (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ -void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { +void apr__SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { sha2_word32 a, b, c, d, e, f, g, h, s0, s1; sha2_word32 T1, *W256; int j; @@ -368,7 +368,7 @@ void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { #else /* SHA2_UNROLL_TRANSFORM */ -void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { +void apr__SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { sha2_word32 a, b, c, d, e, f, g, h, s0, s1; sha2_word32 T1, T2, *W256; int j; @@ -448,7 +448,7 @@ void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { #endif /* SHA2_UNROLL_TRANSFORM */ -void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { +void apr__SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { unsigned int freespace, usedspace; if (len == 0) { @@ -471,7 +471,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { context->bitcount += freespace << 3; len -= freespace; data += freespace; - SHA256_Transform(context, (sha2_word32*)context->buffer); + apr__SHA256_Transform(context, (sha2_word32*)context->buffer); } else { /* The buffer is not yet full */ MEMCPY_BCOPY(&context->buffer[usedspace], data, len); @@ -483,7 +483,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { } while (len >= SHA256_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ - SHA256_Transform(context, (sha2_word32*)data); + apr__SHA256_Transform(context, (sha2_word32*)data); context->bitcount += SHA256_BLOCK_LENGTH << 3; len -= SHA256_BLOCK_LENGTH; data += SHA256_BLOCK_LENGTH; @@ -497,7 +497,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { usedspace = freespace = 0; } -void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { +void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { sha2_word32 *d = (sha2_word32*)digest; unsigned int usedspace; @@ -524,7 +524,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { MEMSET_BZERO(&context->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ - SHA256_Transform(context, (sha2_word32*)context->buffer); + apr__SHA256_Transform(context, (sha2_word32*)context->buffer); /* And set-up for the last transform: */ MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); @@ -540,7 +540,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; /* Final transform: */ - SHA256_Transform(context, (sha2_word32*)context->buffer); + apr__SHA256_Transform(context, (sha2_word32*)context->buffer); #if !APR_IS_BIGENDIAN { @@ -569,7 +569,7 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) { assert(context != (SHA256_CTX*)0); if (buffer != (char*)0) { - SHA256_Final(digest, context); + apr__SHA256_Final(digest, context); for (i = 0; i < SHA256_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; @@ -587,14 +587,14 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) { char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { SHA256_CTX context; - SHA256_Init(&context); - SHA256_Update(&context, data, len); + apr__SHA256_Init(&context); + apr__SHA256_Update(&context, data, len); return SHA256_End(&context, digest); } /*** SHA-512: *********************************************************/ -void SHA512_Init(SHA512_CTX* context) { +void apr__SHA512_Init(SHA512_CTX* context) { if (context == (SHA512_CTX*)0) { return; } @@ -639,7 +639,7 @@ void SHA512_Init(SHA512_CTX* context) { (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ j++ -void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { +void apr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { sha2_word64 a, b, c, d, e, f, g, h, s0, s1; sha2_word64 T1, *W512 = (sha2_word64*)context->buffer; int j; @@ -694,7 +694,7 @@ void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { #else /* SHA2_UNROLL_TRANSFORM */ -void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { +void apr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { sha2_word64 a, b, c, d, e, f, g, h, s0, s1; sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer; int j; @@ -772,7 +772,7 @@ void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { #endif /* SHA2_UNROLL_TRANSFORM */ -void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { +void apr__SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { unsigned int freespace, usedspace; if (len == 0) { @@ -795,7 +795,7 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { ADDINC128(context->bitcount, freespace << 3); len -= freespace; data += freespace; - SHA512_Transform(context, (sha2_word64*)context->buffer); + apr__SHA512_Transform(context, (sha2_word64*)context->buffer); } else { /* The buffer is not yet full */ MEMCPY_BCOPY(&context->buffer[usedspace], data, len); @@ -807,7 +807,7 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { } while (len >= SHA512_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ - SHA512_Transform(context, (sha2_word64*)data); + apr__SHA512_Transform(context, (sha2_word64*)data); ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3); len -= SHA512_BLOCK_LENGTH; data += SHA512_BLOCK_LENGTH; @@ -843,7 +843,7 @@ void SHA512_Last(SHA512_CTX* context) { MEMSET_BZERO(&context->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ - SHA512_Transform(context, (sha2_word64*)context->buffer); + apr__SHA512_Transform(context, (sha2_word64*)context->buffer); /* And set-up for the last transform: */ MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH - 2); @@ -860,10 +860,10 @@ void SHA512_Last(SHA512_CTX* context) { *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; /* Final transform: */ - SHA512_Transform(context, (sha2_word64*)context->buffer); + apr__SHA512_Transform(context, (sha2_word64*)context->buffer); } -void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { +void apr__SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ @@ -900,7 +900,7 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) { assert(context != (SHA512_CTX*)0); if (buffer != (char*)0) { - SHA512_Final(digest, context); + apr__SHA512_Final(digest, context); for (i = 0; i < SHA512_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; @@ -918,14 +918,14 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) { char* SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { SHA512_CTX context; - SHA512_Init(&context); - SHA512_Update(&context, data, len); + apr__SHA512_Init(&context); + apr__SHA512_Update(&context, data, len); return SHA512_End(&context, digest); } /*** SHA-384: *********************************************************/ -void SHA384_Init(SHA384_CTX* context) { +void apr__SHA384_Init(SHA384_CTX* context) { if (context == (SHA384_CTX*)0) { return; } @@ -934,11 +934,11 @@ void SHA384_Init(SHA384_CTX* context) { context->bitcount[0] = context->bitcount[1] = 0; } -void SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) { - SHA512_Update((SHA512_CTX*)context, data, len); +void apr__SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) { + apr__SHA512_Update((SHA512_CTX*)context, data, len); } -void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { +void apr__SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ @@ -975,7 +975,7 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) { assert(context != (SHA384_CTX*)0); if (buffer != (char*)0) { - SHA384_Final(digest, context); + apr__SHA384_Final(digest, context); for (i = 0; i < SHA384_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; @@ -993,8 +993,8 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) { char* SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { SHA384_CTX context; - SHA384_Init(&context); - SHA384_Update(&context, data, len); + apr__SHA384_Init(&context); + apr__SHA384_Update(&context, data, len); return SHA384_End(&context, digest); } diff --git a/random/unix/sha2.h b/random/unix/sha2.h index 7f5821614..ae0526fcf 100644 --- a/random/unix/sha2.h +++ b/random/unix/sha2.h @@ -57,23 +57,23 @@ typedef SHA512_CTX SHA384_CTX; /*** SHA-256/384/512 Function Prototypes ******************************/ -void SHA256_Init(SHA256_CTX *); -void SHA256_Update(SHA256_CTX *, const apr_byte_t *, size_t); -void SHA256_Final(apr_byte_t [SHA256_DIGEST_LENGTH], SHA256_CTX *); +void apr__SHA256_Init(SHA256_CTX *); +void apr__SHA256_Update(SHA256_CTX *, const apr_byte_t *, size_t); +void apr__SHA256_Final(apr_byte_t [SHA256_DIGEST_LENGTH], SHA256_CTX *); char* SHA256_End(SHA256_CTX *, char [SHA256_DIGEST_STRING_LENGTH]); char* SHA256_Data(const apr_byte_t *, size_t, char [SHA256_DIGEST_STRING_LENGTH]); -void SHA384_Init(SHA384_CTX *); -void SHA384_Update(SHA384_CTX *, const apr_byte_t *, size_t); -void SHA384_Final(apr_byte_t [SHA384_DIGEST_LENGTH], SHA384_CTX *); +void apr__SHA384_Init(SHA384_CTX *); +void apr__SHA384_Update(SHA384_CTX *, const apr_byte_t *, size_t); +void apr__SHA384_Final(apr_byte_t [SHA384_DIGEST_LENGTH], SHA384_CTX *); char* SHA384_End(SHA384_CTX *, char [SHA384_DIGEST_STRING_LENGTH]); char* SHA384_Data(const apr_byte_t *, size_t, char [SHA384_DIGEST_STRING_LENGTH]); -void SHA512_Init(SHA512_CTX *); -void SHA512_Update(SHA512_CTX *, const apr_byte_t *, size_t); -void SHA512_Final(apr_byte_t [SHA512_DIGEST_LENGTH], SHA512_CTX *); +void apr__SHA512_Init(SHA512_CTX *); +void apr__SHA512_Update(SHA512_CTX *, const apr_byte_t *, size_t); +void apr__SHA512_Final(apr_byte_t [SHA512_DIGEST_LENGTH], SHA512_CTX *); char* SHA512_End(SHA512_CTX *, char [SHA512_DIGEST_STRING_LENGTH]); char* SHA512_Data(const apr_byte_t *, size_t, char [SHA512_DIGEST_STRING_LENGTH]); diff --git a/random/unix/sha2_glue.c b/random/unix/sha2_glue.c index 08f4de3f6..4909a8fe1 100644 --- a/random/unix/sha2_glue.c +++ b/random/unix/sha2_glue.c @@ -5,18 +5,18 @@ static void sha256_init(apr_crypto_hash_t *h) { - SHA256_Init(h->data); + apr__SHA256_Init(h->data); } static void sha256_add(apr_crypto_hash_t *h,const void *data, apr_size_t bytes) { - SHA256_Update(h->data,data,bytes); + apr__SHA256_Update(h->data,data,bytes); } static void sha256_finish(apr_crypto_hash_t *h,unsigned char *result) { - SHA256_Final(result,h->data); + apr__SHA256_Final(result,h->data); } APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p) |