summaryrefslogtreecommitdiffstats
path: root/module/icp/algs/sha1
diff options
context:
space:
mode:
Diffstat (limited to 'module/icp/algs/sha1')
-rw-r--r--module/icp/algs/sha1/sha1.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/module/icp/algs/sha1/sha1.c b/module/icp/algs/sha1/sha1.c
index 7f28b3796..e4b7a0c8c 100644
--- a/module/icp/algs/sha1/sha1.c
+++ b/module/icp/algs/sha1/sha1.c
@@ -81,28 +81,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
@@ -269,6 +247,27 @@ typedef uint32_t sha1word;
#define W(n) w_ ## n
#endif /* !defined(W_ARRAY) */
+/*
+ * 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
+
#if defined(__sparc)