Bug 1216318, Get NSS ready for android, use memcpy, r=kaie
--- a/lib/freebl/desblapi.c
+++ b/lib/freebl/desblapi.c
@@ -17,38 +17,18 @@
#include <stddef.h>
#include "secerr.h"
#if defined(NSS_X86_OR_X64)
/* Intel X86 CPUs do unaligned loads and stores without complaint. */
#define COPY8B(to, from, ptr) \
HALFPTR(to)[0] = HALFPTR(from)[0]; \
HALFPTR(to)[1] = HALFPTR(from)[1];
-#elif defined(USE_MEMCPY)
+#else
#define COPY8B(to, from, ptr) memcpy(to, from, 8)
-#else
-#define COPY8B(to, from, ptr) \
- if (((ptrdiff_t)(ptr) & 0x3) == 0) { \
- HALFPTR(to)[0] = HALFPTR(from)[0]; \
- HALFPTR(to)[1] = HALFPTR(from)[1]; \
- } else if (((ptrdiff_t)(ptr) & 0x1) == 0) { \
- SHORTPTR(to)[0] = SHORTPTR(from)[0]; \
- SHORTPTR(to)[1] = SHORTPTR(from)[1]; \
- SHORTPTR(to)[2] = SHORTPTR(from)[2]; \
- SHORTPTR(to)[3] = SHORTPTR(from)[3]; \
- } else { \
- BYTEPTR(to)[0] = BYTEPTR(from)[0]; \
- BYTEPTR(to)[1] = BYTEPTR(from)[1]; \
- BYTEPTR(to)[2] = BYTEPTR(from)[2]; \
- BYTEPTR(to)[3] = BYTEPTR(from)[3]; \
- BYTEPTR(to)[4] = BYTEPTR(from)[4]; \
- BYTEPTR(to)[5] = BYTEPTR(from)[5]; \
- BYTEPTR(to)[6] = BYTEPTR(from)[6]; \
- BYTEPTR(to)[7] = BYTEPTR(from)[7]; \
- }
#endif
#define COPY8BTOHALF(to, from) COPY8B(to, from, from)
#define COPY8BFROMHALF(to, from) COPY8B(to, from, to)
static void
DES_ECB(DESContext *cx, BYTE *out, const BYTE *in, unsigned int len)
{
while (len) {