summaryrefslogtreecommitdiff
path: root/block-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'block-internal.h')
-rw-r--r--block-internal.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/block-internal.h b/block-internal.h
index d7b0c315..e9c26ff6 100644
--- a/block-internal.h
+++ b/block-internal.h
@@ -40,6 +40,7 @@
#include <assert.h>
#include "nettle-types.h"
+#include "bswap-internal.h"
#include "memxor.h"
static inline void
@@ -197,4 +198,15 @@ block16_mulx_ghash (union nettle_block16 *r,
}
#endif /* ! WORDS_BIGENDIAN */
+/* Reverse bytes in X and store the result in R. This supports
+ in-place operation (R and X can overlap). */
+static inline void
+block16_bswap (union nettle_block16 *r,
+ const union nettle_block16 *x)
+{
+ uint64_t t = nettle_bswap64 (x->u64[0]);
+ r->u64[0] = nettle_bswap64 (x->u64[1]);
+ r->u64[1] = t;
+}
+
#endif /* NETTLE_BLOCK_INTERNAL_H_INCLUDED */