From c1f9522d91bfd8c711cbdab7bd2dd1ce3522a7b6 Mon Sep 17 00:00:00 2001
From: Ruud de Rooij <ruud@debian.org>
Date: Fri, 12 Mar 1999 17:26:49 +0100
Subject: [PATCH] * src/symmetric/twofish.c: Buglet fix by Ruud.

Rev: src/symmetric/twofish.c:1.4
---
 twofish.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/twofish.c b/twofish.c
index 9945a2fa..3837c3f3 100644
--- a/twofish.c
+++ b/twofish.c
@@ -411,9 +411,7 @@ twofish_setup(TWOFISH_context * context, size_t keysize, const UINT8 *key)
     keysize = 32;
   memcpy(key_copy, key, keysize);
 
-  /* FIXME: This truncates the key if it is not a multiple of 4 octets.
-   * Is this really indended? */
-  bytes_to_words(m, key_copy, keysize/4);
+  bytes_to_words(m, key_copy, (keysize + 3)/4);
 
   if (keysize <= 16)
     k = 2;
-- 
GitLab