From a8ca289b0097cf7dd1946af03dbd9f21b8903d59 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 30 Jul 2015 12:00:25 -0400 Subject: [PATCH] Cleared "signed/unsigned" warning on Debian 8/i686. ROUNDS was already unsigned; suspect this was a compiler or port issue --- blowfish.cpp | 6 +++--- blowfish.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/blowfish.cpp b/blowfish.cpp index aaa637cc..0e95d3ea 100644 --- a/blowfish.cpp +++ b/blowfish.cpp @@ -17,7 +17,7 @@ void Blowfish::Base::UncheckedSetKey(const byte *key_string, unsigned int keylen memcpy(sbox, s_init, sizeof(s_init)); // Xor key string into encryption key vector - for (i=0 ; i(ROUNDS)+2 ; ++i) { data = 0 ; for (k=0 ; k<4 ; ++k ) @@ -27,7 +27,7 @@ void Blowfish::Base::UncheckedSetKey(const byte *key_string, unsigned int keylen crypt_block(dspace, pbox); - for (i=0; i(ROUNDS); i+=2) crypt_block(pbox+i, pbox+i+2); crypt_block(pbox+ROUNDS, sbox); @@ -36,7 +36,7 @@ void Blowfish::Base::UncheckedSetKey(const byte *key_string, unsigned int keylen crypt_block(sbox+i, sbox+i+2); if (!IsForwardTransformation()) - for (i=0; i<(ROUNDS+2)/2; i++) + for (i=0; i<(static_cast(ROUNDS)+2)/2; i++) std::swap(pbox[i], pbox[ROUNDS+1-i]); } diff --git a/blowfish.h b/blowfish.h index ebc4f94d..4c75260e 100644 --- a/blowfish.h +++ b/blowfish.h @@ -1,3 +1,5 @@ +// blowfish.h - written and placed in the public domain by Wei Dai + #ifndef CRYPTOPP_BLOWFISH_H #define CRYPTOPP_BLOWFISH_H