Skip to content

Commit

Permalink
Allow 72 bytes (576 bits) keys for Blowfish
Browse files Browse the repository at this point in the history
  • Loading branch information
Xartrick authored and sjaeckel committed Sep 14, 2024
1 parent 6865b9f commit 556c322
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ciphers/blowfish.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const struct ltc_cipher_descriptor blowfish_desc =
{
"blowfish",
0,
8, 56, 8, 16,
8, 72, 8, 16,
&blowfish_setup,
&blowfish_ecb_encrypt,
&blowfish_ecb_decrypt,
Expand Down Expand Up @@ -433,7 +433,7 @@ int blowfish_setup(const unsigned char *key, int keylen, int num_rounds,
symmetric_key *skey)
{
/* check key length */
if (keylen < 8 || keylen > 56) {
if (keylen < 8 || keylen > 72) {
return CRYPT_INVALID_KEYSIZE;
}
/* check rounds */
Expand Down Expand Up @@ -648,8 +648,8 @@ int blowfish_keysize(int *keysize)
if (*keysize < 8) {
return CRYPT_INVALID_KEYSIZE;
}
if (*keysize > 56) {
*keysize = 56;
if (*keysize > 72) {
*keysize = 72;
}
return CRYPT_OK;
}
Expand Down

0 comments on commit 556c322

Please sign in to comment.