From 63cd646817ecc6d0730034b5f0abc622b59aa3f3 Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Fri, 1 Aug 2014 04:43:18 -0700 Subject: [PATCH] add array_xor32 to copy+xor an array of 32 bits values. --- cbits/cryptonite_bitfn.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cbits/cryptonite_bitfn.h b/cbits/cryptonite_bitfn.h index 2ed5b5e..defad22 100644 --- a/cbits/cryptonite_bitfn.h +++ b/cbits/cryptonite_bitfn.h @@ -151,6 +151,13 @@ static inline void array_copy32(uint32_t *d, uint32_t *s, uint32_t nb) } #endif +#ifndef ARCH_HAS_ARRAY_XOR32 +static inline void array_xor32(uint32_t *d, uint32_t *s, uint32_t nb) +{ + while (nb--) *d++ ^= *s++; +} +#endif + #ifndef ARCH_HAS_ARRAY_COPY64 static inline void array_copy64(uint64_t *d, uint64_t *s, uint32_t nb) {