Skip to content
Snippets Groups Projects
Commit 92d6dbb3 authored by Adam Langley's avatar Adam Langley Committed by Niels Möller
Browse files

(memxor3): New function, suggested by Adam Langley.

Rev: src/nettle/memxor.c:1.4
Rev: src/nettle/memxor.h:1.4
parent 05179128
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,8 @@
#include "memxor.h"
uint8_t *memxor(uint8_t *dst, const uint8_t *src, size_t n)
uint8_t *
memxor(uint8_t *dst, const uint8_t *src, size_t n)
{
size_t i;
for (i = 0; i<n; i++)
......@@ -21,3 +22,14 @@ uint8_t *memxor(uint8_t *dst, const uint8_t *src, size_t n)
return dst;
}
uint8_t *
memxor3(uint8_t *dst, const uint8_t *a, const uint8_t *b, size_t n)
{
size_t i;
for (i = 0; i<n; i++)
dst[i] = a[i] ^ b[i];
return dst;
}
......@@ -9,5 +9,6 @@
#include "nettle-types.h"
uint8_t *memxor(uint8_t *dst, const uint8_t *src, size_t n);
uint8_t *memxor3(uint8_t *dst, const uint8_t *a, const uint8_t *b, size_t n);
#endif /* NETTLE_MEMXOR_H_INCLUDED */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment