Limit and document Blowfish key lengths to 8-576 bits
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Thu, 18 Apr 2019 15:53:35 +0000 (18:53 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Thu, 18 Apr 2019 15:53:35 +0000 (18:53 +0300)
commit3546599e5578f89f9e77b08bf599f9c44b23da5f
tree0c992941e7d2a1b1f00d5df9cf5c0a09c00b05c6
parentd11ae95d05dc39ec6b825d1109afadd964589880
Limit and document Blowfish key lengths to 8-576 bits

* cipher/blowfish.c (BLOWFISH_KEY_MIN_BITS)
(BLOWFISH_KEY_MAX_BITS): New.
(do_bf_setkey): Check input key length to MIN_BITS and MAX_BITS.
* doc/gcrypt.texi: Update supported Blowfish key lengths.
* tests/basic.c (check_ecb_cipher): New, with Blowfish test vectors
for different key lengths.
(check_cipher_modes): Call 'check_ecb_cipher'.
--

As noted by Peter Wu, Blowfish cipher implementation already supports key
lengths 8 to 576 bits [1]. This change updates documentation to reflect
that and adds new test vectors to check handling of different key lengths.

[1] https://lists.gnupg.org/pipermail/gcrypt-devel/2019-April/004680.html

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/blowfish.c
doc/gcrypt.texi
tests/basic.c