summaryrefslogtreecommitdiffstats
path: root/module/icp/algs/skein
diff options
context:
space:
mode:
Diffstat (limited to 'module/icp/algs/skein')
-rw-r--r--module/icp/algs/skein/skein.c2
-rw-r--r--module/icp/algs/skein/skein_port.h15
2 files changed, 2 insertions, 15 deletions
diff --git a/module/icp/algs/skein/skein.c b/module/icp/algs/skein/skein.c
index 39a0bff35..83fe84260 100644
--- a/module/icp/algs/skein/skein.c
+++ b/module/icp/algs/skein/skein.c
@@ -5,8 +5,6 @@
*/
/* Copyright 2013 Doug Whiting. This code is released to the public domain. */
-#define SKEIN_PORT_CODE /* instantiate any code in skein_port.h */
-
#include <sys/sysmacros.h>
#include <sys/types.h>
#include <sys/skein.h> /* get the Skein API definitions */
diff --git a/module/icp/algs/skein/skein_port.h b/module/icp/algs/skein/skein_port.h
index 4fe268bb5..417ed7c4b 100644
--- a/module/icp/algs/skein/skein_port.h
+++ b/module/icp/algs/skein/skein_port.h
@@ -44,19 +44,16 @@
#include <sys/isa_defs.h> /* get endianness selection */
-#define PLATFORM_MUST_ALIGN _ALIGNMENT_REQUIRED
#if defined(_BIG_ENDIAN)
/* here for big-endian CPUs */
#define SKEIN_NEED_SWAP (1)
#else
/* here for x86 and x86-64 CPUs (and other detected little-endian CPUs) */
#define SKEIN_NEED_SWAP (0)
-#if PLATFORM_MUST_ALIGN == 0 /* ok to use "fast" versions? */
#define Skein_Put64_LSB_First(dst08, src64, bCnt) bcopy(src64, dst08, bCnt)
#define Skein_Get64_LSB_First(dst64, src08, wCnt) \
bcopy(src08, dst64, 8 * (wCnt))
#endif
-#endif
#endif /* ifndef SKEIN_NEED_SWAP */
@@ -80,9 +77,8 @@
#endif /* ifndef Skein_Swap64 */
#ifndef Skein_Put64_LSB_First
-void
+static inline void
Skein_Put64_LSB_First(uint8_t *dst, const uint64_t *src, size_t bCnt)
-#ifdef SKEIN_PORT_CODE /* instantiate the function code here? */
{
/*
* this version is fully portable (big-endian or little-endian),
@@ -93,15 +89,11 @@ Skein_Put64_LSB_First(uint8_t *dst, const uint64_t *src, size_t bCnt)
for (n = 0; n < bCnt; n++)
dst[n] = (uint8_t)(src[n >> 3] >> (8 * (n & 7)));
}
-#else
-; /* output only the function prototype */
-#endif
#endif /* ifndef Skein_Put64_LSB_First */
#ifndef Skein_Get64_LSB_First
-void
+static inline void
Skein_Get64_LSB_First(uint64_t *dst, const uint8_t *src, size_t wCnt)
-#ifdef SKEIN_PORT_CODE /* instantiate the function code here? */
{
/*
* this version is fully portable (big-endian or little-endian),
@@ -119,9 +111,6 @@ Skein_Get64_LSB_First(uint64_t *dst, const uint8_t *src, size_t wCnt)
(((uint64_t)src[n + 6]) << 48) +
(((uint64_t)src[n + 7]) << 56);
}
-#else
-; /* output only the function prototype */
-#endif
#endif /* ifndef Skein_Get64_LSB_First */
#endif /* _SKEIN_PORT_H_ */