2005-04-18 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Mon, 18 Apr 2005 12:52:03 +0000 (12:52 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Mon, 18 Apr 2005 12:52:03 +0000 (12:52 -0000)
* SymmetricTransform.cs: Fixed a division by zero if someone changes
the feedback value to 0.
* SHA224Managed.cs: Fixed warning about unused private constant.

svn path=/trunk/mcs/; revision=43210

mcs/class/Mono.Security/Mono.Security.Cryptography/ChangeLog
mcs/class/Mono.Security/Mono.Security.Cryptography/SHA224Managed.cs
mcs/class/Mono.Security/Mono.Security.Cryptography/SymmetricTransform.cs

index 232548266190becc0fce470c7aa374723d037a0b..7d8288ffef121893ac478182ce6f8e20dfde413f 100644 (file)
@@ -1,3 +1,9 @@
+2005-04-18  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * SymmetricTransform.cs: Fixed a division by zero if someone changes 
+       the feedback value to 0.
+       * SHA224Managed.cs: Fixed warning about unused private constant.
+
 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
 
        * SymmetricTransform.cs: Fixed a padding bug affecting that can occurs
index 5fa0bd180cbb5935a7ef4936b28aabcee8f8467b..b7000b8997082e99f6ece7d12960f3d67506e68a 100644 (file)
@@ -36,7 +36,7 @@ namespace Mono.Security.Cryptography {
        public class SHA224Managed : SHA224 {
 
                private const int BLOCK_SIZE_BYTES =  64;
-               private const int HASH_SIZE_BYTES  =  32;
+
                private uint[] _H;
                private ulong count;
                private byte[] _ProcessingBuffer;   // Used to start data when passed less than a block worth.
index 036df4108d3524773a6d5d6320656a79793ee700..e19cd42db44d68ec57e3c42df2bd7d3f2aa1a9b3 100755 (executable)
@@ -65,7 +65,8 @@ namespace Mono.Security.Cryptography {
                        Buffer.BlockCopy (rgbIV, 0, temp, 0, BlockSizeByte);
                        temp2 = new byte [BlockSizeByte];
                        FeedBackByte = (algo.FeedbackSize >> 3);
-                       FeedBackIter = (int) BlockSizeByte / FeedBackByte;
+                       if (FeedBackByte != 0)
+                               FeedBackIter = (int) BlockSizeByte / FeedBackByte;
                        // transform buffers
                        workBuff = new byte [BlockSizeByte];
                        workout =  new byte [BlockSizeByte];