diff options
author | Dan McDonald <danmcd@mnx.io> | 2022-11-18 09:15:55 -0500 |
---|---|---|
committer | Dan McDonald <danmcd@mnx.io> | 2022-11-18 09:15:55 -0500 |
commit | f469a20c1f7649b781dd6c84ef40d1b2fb54cfbb (patch) | |
tree | c632c067d0cea004d8a60a0bf6daa6c7f0e1f8f0 | |
parent | bc68779dc3906e3badf883308b4990adeb7b1955 (diff) | |
parent | 067afcb3a52b5ebe76a00b3f366353cad54c649e (diff) | |
download | illumos-joyent-f469a20c1f7649b781dd6c84ef40d1b2fb54cfbb.tar.gz |
[illumos-gate merge]
commit 067afcb3a52b5ebe76a00b3f366353cad54c649e
15179 libmd: unused function 'ROTATE_LEFT'
commit 6c3eb1522a391079b03bb1847a6e4dc8bddf0224
15178 libmp: unused parameter
-rw-r--r-- | usr/src/common/crypto/sha1/sha1.c | 41 | ||||
-rw-r--r-- | usr/src/lib/libmp/common/util.c | 14 |
2 files changed, 23 insertions, 32 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 @@ -110,28 +110,6 @@ static uint8_t PADDING[64] = { 0x80, /* all zeros */ }; #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() * * purpose: initializes the sha1 context and begins and sha1 digest operation @@ -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; /* diff --git a/usr/src/lib/libmp/common/util.c b/usr/src/lib/libmp/common/util.c index 48f38d4a91..5c0b292d47 100644 --- a/usr/src/lib/libmp/common/util.c +++ b/usr/src/lib/libmp/common/util.c @@ -1,5 +1,5 @@ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* @@ -7,7 +7,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -/* Portions Copyright(c) 1988, Sun Microsystems Inc. */ +/* Portions Copyright(c) 1988, Sun Microsystems Inc. */ /* All Rights Reserved */ /* @@ -15,10 +15,6 @@ * All rights reserved. */ -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ - -/* LINTLIBRARY */ - #include <stdio.h> #include <mp.h> #include <sys/types.h> @@ -45,10 +41,8 @@ _mp_move(MINT *a, MINT *b) } } -/* ARGSUSED */ -/* VARARGS */ short * -_mp_xalloc(int nint, char *s) +_mp_xalloc(int nint, char *s __unused) { short *i; @@ -226,7 +220,7 @@ mp_mtox(MINT *key) } else { size = -key->len; } - hex = malloc((size_t) ((size * BASEBITS + 3)) / 4 + (size ? 1 : 2)); + hex = malloc((size_t)((size * BASEBITS + 3)) / 4 + (size ? 1 : 2)); if (hex == NULL) { return (NULL); } |