/* memxor.c -- perform binary exclusive OR operation of two memory blocks.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* Written by Simon Josefsson. The interface was inspired by memxor
in Niels Möller's Nettle. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "memxor.h"
void *
memxor (void *restrict dest, const void *restrict src, size_t n)
{
+ char const *s = src;
char *d = dest;
for (; n > 0; n--)
- *d++ ^= *src++;
+ *d++ ^= *s++;
return dest;
}