23 typedef unsigned long chunk;
25 inline void XOR_equal(
unsigned char *dst,
const unsigned char *src,
size_t len) {
26 chunk *dl = (chunk *)dst;
27 const chunk *sl = (
const chunk *)src;
28 size_t ll = len / (8*
sizeof(chunk));
29 size_t lr = len % (8*
sizeof(chunk));
30 for(
size_t i=0; i<ll; i++) {
41 dst = (
unsigned char *)dl;
42 src = (
const unsigned char *)sl;
43 for(
size_t i=0; i<lr; i++) {
49 inline void XOR_memblocks(
unsigned char *dst,
const unsigned char *src1,
50 const unsigned char *src2,
size_t len) {
51 chunk *dl = (chunk *)dst;
52 const chunk *sl1 = (
const chunk *)src1;
53 const chunk *sl2 = (
const chunk *)src2;
54 size_t ll = len / (8*
sizeof(chunk));
55 size_t lr = len % (8*
sizeof(chunk));
56 for(
size_t i=0; i<ll; i++) {
57 *(dl++) = *(sl1++) ^ *(sl2++);
58 *(dl++) = *(sl1++) ^ *(sl2++);
59 *(dl++) = *(sl1++) ^ *(sl2++);
60 *(dl++) = *(sl1++) ^ *(sl2++);
61 *(dl++) = *(sl1++) ^ *(sl2++);
62 *(dl++) = *(sl1++) ^ *(sl2++);
63 *(dl++) = *(sl1++) ^ *(sl2++);
64 *(dl++) = *(sl1++) ^ *(sl2++);
67 dst = (
unsigned char *)dl;
68 src1 = (
const unsigned char *)sl1;
69 src2 = (
const unsigned char *)sl2;
70 for(
size_t i=0; i<lr; i++) {
71 *(dst++) = *(src1++) ^ *(src2++);