From 138a380a26afeddf186ff807732c440f1c8efae0 Mon Sep 17 00:00:00 2001 From: Joost Rijneveld Date: Thu, 19 Oct 2017 17:20:38 +0200 Subject: [PATCH] Remove unnecessary endianness difference The current code results in the same output regardless of endianness. Verified using a QEMU VM to emulate MIPS. --- hash.c | 5 ----- hash.h | 2 -- 2 files changed, 7 deletions(-) diff --git a/hash.c b/hash.c index 424adbf..54bacdc 100644 --- a/hash.c +++ b/hash.c @@ -10,14 +10,10 @@ unsigned char* addr_to_byte(unsigned char *bytes, const uint32_t addr[8]) { -#if IS_LITTLE_ENDIAN==1 int i; for (i = 0; i < 8; i++) { to_byte(bytes + i*4, addr[i], 4); } -#else - memcpy(bytes, addr, 32); -#endif return bytes; } @@ -90,7 +86,6 @@ int hash_h(const xmss_params *params, set_key_and_mask(addr, 0); addr_to_byte(byte_addr, addr); prf(params, key, byte_addr, pub_seed, params->n); - // Use MSB order set_key_and_mask(addr, 1); addr_to_byte(byte_addr, addr); prf(params, bitmask, byte_addr, pub_seed, params->n); diff --git a/hash.h b/hash.h index f44d9f3..64b244c 100644 --- a/hash.h +++ b/hash.h @@ -4,8 +4,6 @@ #include #include "params.h" -#define IS_LITTLE_ENDIAN 1 - unsigned char* addr_to_byte(unsigned char *bytes, const uint32_t addr[8]); int prf(const xmss_params *params,