From e30dbf3ecd4177cea7af04608c6b90b772b0d1c6 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 16 Apr 2019 15:22:39 +0200 Subject: [PATCH] style --- common/crapto1/crypto1.c | 2 +- tools/nonce2key/crypto1.c | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/common/crapto1/crypto1.c b/common/crapto1/crypto1.c index 46e9fc239..7d6bb6e7d 100644 --- a/common/crapto1/crypto1.c +++ b/common/crapto1/crypto1.c @@ -68,7 +68,7 @@ uint8_t crypto1_bit(struct Crypto1State *s, uint8_t in, int is_encrypted) { uint32_t feedin, t; uint8_t ret = filter(s->odd); - feedin = ret & !!is_encrypted; + feedin = ret & (!!is_encrypted); feedin ^= !!in; feedin ^= LF_POLY_ODD & s->odd; feedin ^= LF_POLY_EVEN & s->even; diff --git a/tools/nonce2key/crypto1.c b/tools/nonce2key/crypto1.c index 0c3f97b88..f6f4642e2 100644 --- a/tools/nonce2key/crypto1.c +++ b/tools/nonce2key/crypto1.c @@ -62,13 +62,6 @@ uint8_t crypto1_bit(struct Crypto1State *s, uint8_t in, int is_encrypted) { return ret; } uint8_t crypto1_byte(struct Crypto1State *s, uint8_t in, int is_encrypted) { - /* - uint8_t i, ret = 0; - - for (i = 0; i < 8; ++i) - ret |= crypto1_bit(s, BIT(in, i), is_encrypted) << i; - */ -// unfold loop 20161012 uint8_t ret = 0; ret |= crypto1_bit(s, BIT(in, 0), is_encrypted) << 0; ret |= crypto1_bit(s, BIT(in, 1), is_encrypted) << 1; @@ -81,13 +74,6 @@ uint8_t crypto1_byte(struct Crypto1State *s, uint8_t in, int is_encrypted) { return ret; } uint32_t crypto1_word(struct Crypto1State *s, uint32_t in, int is_encrypted) { - /* - uint32_t i, ret = 0; - - for (i = 0; i < 32; ++i) - ret |= crypto1_bit(s, BEBIT(in, i), is_encrypted) << (i ^ 24); - */ -//unfold loop 2016012 uint32_t ret = 0; ret |= crypto1_bit(s, BEBIT(in, 0), is_encrypted) << (0 ^ 24); ret |= crypto1_bit(s, BEBIT(in, 1), is_encrypted) << (1 ^ 24);