Skip to content

Commit

Permalink
Cleared "signed/unsigned" warning on Debian 8/i686. ROUNDS was alread…
Browse files Browse the repository at this point in the history
…y unsigned; suspect this was a compiler or port issue
  • Loading branch information
noloader committed Jul 30, 2015
1 parent 4d8ac2d commit a8ca289
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions blowfish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
for (i=0 ; i<static_cast<unsigned int>(ROUNDS)+2 ; ++i)
{
data = 0 ;
for (k=0 ; k<4 ; ++k )
Expand All @@ -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)
for (i=0; i<static_cast<unsigned int>(ROUNDS); i+=2)
crypt_block(pbox+i, pbox+i+2);

crypt_block(pbox+ROUNDS, sbox);
Expand All @@ -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<unsigned int>(ROUNDS)+2)/2; i++)
std::swap(pbox[i], pbox[ROUNDS+1-i]);
}

Expand Down
2 changes: 2 additions & 0 deletions blowfish.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// blowfish.h - written and placed in the public domain by Wei Dai

#ifndef CRYPTOPP_BLOWFISH_H
#define CRYPTOPP_BLOWFISH_H

Expand Down

0 comments on commit a8ca289

Please sign in to comment.