From 927cd71ed96bafde5b6480613769b5e6e96eb272 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 6 Jul 2020 05:43:12 +0200 Subject: [PATCH] use reflect fct --- client/src/loclass/cipherutils.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/client/src/loclass/cipherutils.c b/client/src/loclass/cipherutils.c index 76415b74f..58875216b 100644 --- a/client/src/loclass/cipherutils.c +++ b/client/src/loclass/cipherutils.c @@ -128,24 +128,17 @@ uint64_t x_bytes_to_num(uint8_t *src, size_t len) { return num; } -uint8_t reversebytes(uint8_t b) { - b = (b & 0xF0) >> 4 | (b & 0x0F) << 4; - b = (b & 0xCC) >> 2 | (b & 0x33) << 2; - b = (b & 0xAA) >> 1 | (b & 0x55) << 1; - return b; -} - void reverse_arraybytes(uint8_t *arr, size_t len) { uint8_t i; for (i = 0; i < len ; i++) { - arr[i] = reversebytes(arr[i]); + arr[i] = reflect8(arr[i]); } } void reverse_arraycopy(uint8_t *arr, uint8_t *dest, size_t len) { uint8_t i; for (i = 0; i < len ; i++) { - dest[i] = reversebytes(arr[i]); + dest[i] = reflect8(arr[i]); } }