diff --git a/blowfish.cpp b/blowfish.cpp index aaa637cca..0e95d3ea5 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 ebc4f94d3..4c75260e6 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