fixed endianess for toByte and base_w

This commit is contained in:
Andreas 2016-02-16 19:24:12 +01:00
parent c37b9dcfca
commit 2b73688b7c
2 changed files with 2 additions and 2 deletions

2
wots.c
View File

@ -71,7 +71,7 @@ static void base_w(int *output, const unsigned char *input, int in_len, const wo
for (consumed = 0; consumed < 8 * in_len; consumed += params->log_w) { for (consumed = 0; consumed < 8 * in_len; consumed += params->log_w) {
if (bits == 0) { if (bits == 0) {
total = input[in_len - 1 - in]; total = input[in];
in++; in++;
bits += 8; bits += 8;
} }

View File

@ -12,7 +12,7 @@ Public domain.
void to_byte(unsigned char *out, unsigned int in, int bytes) void to_byte(unsigned char *out, unsigned int in, int bytes)
{ {
int i; int i;
for (i = 0; i < bytes; i++) { for (i = bytes-1; i >= 0; i--) {
out[i] = in & 0xff; out[i] = in & 0xff;
in = in >> 8; in = in >> 8;
} }