Skip to content

Commit 556c322

Browse files
Xartricksjaeckel
authored andcommitted
Allow 72 bytes (576 bits) keys for Blowfish
1 parent 6865b9f commit 556c322

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ciphers/blowfish.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const struct ltc_cipher_descriptor blowfish_desc =
1212
{
1313
"blowfish",
1414
0,
15-
8, 56, 8, 16,
15+
8, 72, 8, 16,
1616
&blowfish_setup,
1717
&blowfish_ecb_encrypt,
1818
&blowfish_ecb_decrypt,
@@ -433,7 +433,7 @@ int blowfish_setup(const unsigned char *key, int keylen, int num_rounds,
433433
symmetric_key *skey)
434434
{
435435
/* check key length */
436-
if (keylen < 8 || keylen > 56) {
436+
if (keylen < 8 || keylen > 72) {
437437
return CRYPT_INVALID_KEYSIZE;
438438
}
439439
/* check rounds */
@@ -648,8 +648,8 @@ int blowfish_keysize(int *keysize)
648648
if (*keysize < 8) {
649649
return CRYPT_INVALID_KEYSIZE;
650650
}
651-
if (*keysize > 56) {
652-
*keysize = 56;
651+
if (*keysize > 72) {
652+
*keysize = 72;
653653
}
654654
return CRYPT_OK;
655655
}

0 commit comments

Comments
 (0)