diff options
author | Karel Zak | 2017-12-12 11:29:02 +0100 |
---|---|---|
committer | Karel Zak | 2017-12-12 11:29:02 +0100 |
commit | 3bd55be742aec60a93ebcdebc325b49737cd6642 (patch) | |
tree | 4894d789632459349384f271ba6d10c5e6840e82 /include/sha1.h | |
parent | Merge branch '2017wk48' of https://github.com/kerolasa/lelux-utiliteetit (diff) | |
download | kernel-qcow2-util-linux-3bd55be742aec60a93ebcdebc325b49737cd6642.tar.gz kernel-qcow2-util-linux-3bd55be742aec60a93ebcdebc325b49737cd6642.tar.xz kernel-qcow2-util-linux-3bd55be742aec60a93ebcdebc325b49737cd6642.zip |
lib/sha1: use ul_/UL_prefix for symbols
Unfortunately, the symbols are visible in statically compiled libuuid
and the names are too generic.
Addresses: https://github.com/karelzak/util-linux/issues/548
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/sha1.h')
-rw-r--r-- | include/sha1.h | 49 |
1 files changed, 15 insertions, 34 deletions
diff --git a/include/sha1.h b/include/sha1.h index 5c28bce92..62af1da6f 100644 --- a/include/sha1.h +++ b/include/sha1.h @@ -1,5 +1,5 @@ -#ifndef SHA1_H -#define SHA1_H +#ifndef UTIL_LINUX_SHA1_H +#define UTIL_LINUX_SHA1_H /* SHA-1 in C @@ -9,38 +9,19 @@ #include "stdint.h" -#define SHA1LENGTH 20 +#define UL_SHA1LENGTH 20 typedef struct { - uint32_t state[5]; - uint32_t count[2]; - unsigned char buffer[64]; -} SHA1_CTX; - -void SHA1Transform( - uint32_t state[5], - const unsigned char buffer[64] - ); - -void SHA1Init( - SHA1_CTX * context - ); - -void SHA1Update( - SHA1_CTX * context, - const unsigned char *data, - uint32_t len - ); - -void SHA1Final( - unsigned char digest[SHA1LENGTH], - SHA1_CTX * context - ); - -void SHA1( - char *hash_out, - const char *str, - unsigned len); - -#endif /* SHA1_H */ + uint32_t state[5]; + uint32_t count[2]; + unsigned char buffer[64]; +} UL_SHA1_CTX; + +void ul_SHA1Transform(uint32_t state[5], const unsigned char buffer[64]); +void ul_SHA1Init(UL_SHA1_CTX *context); +void ul_SHA1Update(UL_SHA1_CTX *context, const unsigned char *data, uint32_t len); +void ul_SHA1Final(unsigned char digest[UL_SHA1LENGTH], UL_SHA1_CTX *context); +void ul_SHA1(char *hash_out, const char *str, unsigned len); + +#endif /* UTIL_LINUX_SHA1_H */ |