fix MPLAB X windows warnings

This commit is contained in:
toddouska
2013-05-17 11:13:47 -07:00
parent a4c6ed0dda
commit 8f5e98486f
2 changed files with 12 additions and 10 deletions

View File

@@ -249,25 +249,27 @@ static INLINE int DoProcess(Rabbit* ctx, byte* output, const byte* input,
if (msglen) {
word32 i;
byte buffer[16];
word32 tmp[4];
byte* buffer = (byte*)tmp;
XMEMSET(tmp, 0, sizeof(tmp)); /* help static analysis */
/* Iterate the system */
RABBIT_next_state(&(ctx->workCtx));
/* Generate 16 bytes of pseudo-random data */
*(word32*)(buffer+ 0) = LITTLE32(ctx->workCtx.x[0] ^
tmp[0] = LITTLE32(ctx->workCtx.x[0] ^
(ctx->workCtx.x[5]>>16) ^ U32V(ctx->workCtx.x[3]<<16));
*(word32*)(buffer+ 4) = LITTLE32(ctx->workCtx.x[2] ^
tmp[1] = LITTLE32(ctx->workCtx.x[2] ^
(ctx->workCtx.x[7]>>16) ^ U32V(ctx->workCtx.x[5]<<16));
*(word32*)(buffer+ 8) = LITTLE32(ctx->workCtx.x[4] ^
tmp[2] = LITTLE32(ctx->workCtx.x[4] ^
(ctx->workCtx.x[1]>>16) ^ U32V(ctx->workCtx.x[7]<<16));
*(word32*)(buffer+12) = LITTLE32(ctx->workCtx.x[6] ^
tmp[3] = LITTLE32(ctx->workCtx.x[6] ^
(ctx->workCtx.x[3]>>16) ^ U32V(ctx->workCtx.x[1]<<16));
/* Encrypt/decrypt the data */
for (i=0; i<msglen; i++)
output[i] = input[i] ^ buffer[i]; /* scan-build thinks buffer[i] */
/* is garbage, it is not! */
output[i] = input[i] ^ buffer[i];
}
return 0;