From 067afcb3a52b5ebe76a00b3f366353cad54c649e Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Wed, 26 Oct 2022 23:48:44 +0300 Subject: 15179 libmd: unused function 'ROTATE_LEFT' Reviewed by: Andy Stormont Reviewed by: Dan McDonald Approved by: Gordon Ross --- usr/src/common/crypto/sha1/sha1.c | 41 ++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/usr/src/common/crypto/sha1/sha1.c b/usr/src/common/crypto/sha1/sha1.c index 08c7a2f52c..13a1f0503d 100644 --- a/usr/src/common/crypto/sha1/sha1.c +++ b/usr/src/common/crypto/sha1/sha1.c @@ -109,28 +109,6 @@ static uint8_t PADDING[64] = { 0x80, /* all zeros */ }; #define G(b, c, d) ((b) ^ (c) ^ (d)) #define H(b, c, d) (((b) & (c)) | (((b)|(c)) & (d))) -/* - * ROTATE_LEFT rotates x left n bits. - */ - -#if defined(__GNUC__) && defined(_LP64) -static __inline__ uint64_t -ROTATE_LEFT(uint64_t value, uint32_t n) -{ - uint32_t t32; - - t32 = (uint32_t)value; - return ((t32 << n) | (t32 >> (32 - n))); -} - -#else - -#define ROTATE_LEFT(x, n) \ - (((x) << (n)) | ((x) >> ((sizeof (x) * NBBY)-(n)))) - -#endif - - /* * SHA1Init() * @@ -456,6 +434,25 @@ SHA1Final(void *digest, SHA1_CTX *ctx) #if !defined(__amd64) +/* + * ROTATE_LEFT rotates x left n bits. + */ + +#if defined(__GNUC__) && defined(_LP64) +static __inline__ uint64_t +ROTATE_LEFT(uint64_t value, uint32_t n) +{ + uint32_t t32; + + t32 = (uint32_t)value; + return ((t32 << n) | (t32 >> (32 - n))); +} + +#else +#define ROTATE_LEFT(x, n) \ + (((x) << (n)) | ((x) >> ((sizeof (x) * NBBY)-(n)))) +#endif + typedef uint32_t sha1word; /* -- cgit v1.2.3