From 183d95bffa2c67a933dafa51282a1c9980f40129 Mon Sep 17 00:00:00 2001 From: jakcron Date: Thu, 25 May 2017 12:56:51 +0800 Subject: [PATCH] [ctrtool] fixed keygen add()/sub() functions --- ctrtool/aes_keygen.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/ctrtool/aes_keygen.c b/ctrtool/aes_keygen.c index d8bda85..eb81bdf 100644 --- a/ctrtool/aes_keygen.c +++ b/ctrtool/aes_keygen.c @@ -45,14 +45,6 @@ void n128_add(const uint8_t *a, const uint8_t *b, uint8_t *out) carry = sum >> 8; out[i] = sum & 0xff; } - - while (carry != 0) { - for (int i = 15; i >= 0; i--) { - sum = out[i] + carry; - carry = sum >> 8; - out[i] = sum & 0xff; - } - } } /* out = a - b @@ -77,25 +69,6 @@ void n128_sub(const uint8_t *a, const uint8_t *b, uint8_t *out) // set value out[i] = sum & 0xff; } - - - while (carry != 0) { - for (int i = 15; i >= 0; i--) { - sum = out[i] - carry; - - // check to see if anything was borrowed from next byte - if (out[i] < carry) { - sum += 0x100; - carry = 1; - } - else { - carry = 0; - } - - out[i] = sum & 0xff; - } - } - } void n128_xor(const uint8_t *a, const uint8_t *b, uint8_t *out)