fixed endianess for toByte and base_w
This commit is contained in:
parent
c37b9dcfca
commit
2b73688b7c
2
wots.c
2
wots.c
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user