shishi-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

shishi/crypto cbc-cts.c


From: shishi-commit
Subject: shishi/crypto cbc-cts.c
Date: Sun, 19 Oct 2003 19:46:06 -0400

CVSROOT:        /cvsroot/shishi
Module name:    shishi
Branch:         
Changes by:     Simon Josefsson <address@hidden>        03/10/19 19:46:06

Modified files:
        crypto         : cbc-cts.c 

Log message:
        (cbc_cts_encrypt): Fix IV, from Nicolas Pouvesle <address@hidden>.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/crypto/cbc-cts.c.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: shishi/crypto/cbc-cts.c
diff -u shishi/crypto/cbc-cts.c:1.6 shishi/crypto/cbc-cts.c:1.7
--- shishi/crypto/cbc-cts.c:1.6 Fri Aug 15 12:26:36 2003
+++ shishi/crypto/cbc-cts.c     Sun Oct 19 19:46:06 2003
@@ -48,6 +48,12 @@
   unsigned restbytes = (length % block_size) == 0 ?
     block_size : length % block_size;
 
+  if (length > block_size)
+    {
+      if ((length % block_size) == 0)
+       nblocks--;
+    }
+
   for (; nblocks; nblocks--, src += block_size, dst += block_size)
     {
       memxor (iv, src, block_size);
@@ -63,6 +69,7 @@
       memset (dst + restbytes, 0, block_size - restbytes);
       memxor (iv, dst, block_size);
       f (ctx, block_size, dst, iv);
+      memcpy (iv, dst, block_size);
     }
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]