Skip to content
Snippets Groups Projects
memxor.c 328 B
Newer Older
Niels Möller's avatar
Niels Möller committed
/* memxor.c
 *
 * $Id$
 */

/* XOR LEN bytes starting at SRCADDR onto DESTADDR.  Result undefined
   if the source overlaps with the destination.
   Return DESTADDR. */

#include "memxor.h"

uint8_t *memxor(uint8_t *dst, const uint8_t *src, size_t n)
{
  size_t i;
  for (i = 0; i<n; i++)
    dst[i] ^= src[i];

  return dst;
}