summaryrefslogtreecommitdiff
path: root/src/libstddjb/bitarray_xor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/bitarray_xor.c')
-rw-r--r--src/libstddjb/bitarray_xor.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libstddjb/bitarray_xor.c b/src/libstddjb/bitarray_xor.c
new file mode 100644
index 0000000..8b16f25
--- /dev/null
+++ b/src/libstddjb/bitarray_xor.c
@@ -0,0 +1,10 @@
+/* ISC license. */
+
+#include <skalibs/bitarray.h>
+
+void bitarray_xor (unsigned char *c, unsigned char const *a, unsigned char const *b, unsigned int n)
+{
+ unsigned int len = bitarray_div8(n) ;
+ register unsigned int i = 0 ;
+ for (; i < len ; i++) c[i] = a[i] ^ b[i] ;
+}