[go: up one dir, main page]

File: memxor.c

package info (click to toggle)
dibbler 1.0.1-1
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 13,308 kB
  • ctags: 10,470
  • sloc: cpp: 60,323; ansic: 12,233; sh: 11,951; yacc: 3,418; lex: 969; makefile: 940; perl: 319; xml: 116; python: 74
file content (23 lines) | stat: -rw-r--r-- 435 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* memxor.c
 *
 * $Id: memxor.c,v 1.1.2.1 2005/01/28 22:50:03 meilof Exp $
 */

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

#if HAVE_CONFIG_H
# include "dibbler-config.h"
#endif

#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;
}