Merge pull request #1321 from esdrubal/currentsystemtimezone
[mono.git] / mcs / class / corlib / System.Security.Cryptography / MD5CryptoServiceProvider.cs
index a2403407d2ddc131d142227b65b57ed16fe2256d..2ea2a222423446f93f00b0c5935e77809325f7ef 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System.Security.Cryptography MD5CryptoServiceProvider Class implementation
+// System.Security.Cryptography.MD5CryptoServiceProvider.cs
 //
 // Authors:
 //     Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
@@ -32,16 +32,9 @@ using System.Runtime.InteropServices;
 
 namespace System.Security.Cryptography {
 
-#if NET_1_0
-       public class MD5CryptoServiceProvider : MD5 {
-#else
-       #if NET_2_0
        [ComVisible (true)]
-       #endif
        public sealed class MD5CryptoServiceProvider : MD5 {
-#endif
                private const int BLOCK_SIZE_BYTES =  64;
-               private const int HASH_SIZE_BYTES  =  16;
                private uint[] _H;
                private uint[] buff;
                private ulong count;
@@ -78,34 +71,34 @@ namespace System.Security.Cryptography {
                        }
                }
 
-               protected override void HashCore (byte[] rgb, int start, int size) 
+               protected override void HashCore (byte[] rgb, int ibStart, int cbSize) 
                {
                        int i;
                        State = 1;
 
                        if (_ProcessingBufferCount != 0) {
-                               if (size < (BLOCK_SIZE_BYTES - _ProcessingBufferCount)) {
-                                       System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, size);
-                                       _ProcessingBufferCount += size;
+                               if (cbSize < (BLOCK_SIZE_BYTES - _ProcessingBufferCount)) {
+                                       System.Buffer.BlockCopy (rgb, ibStart, _ProcessingBuffer, _ProcessingBufferCount, cbSize);
+                                       _ProcessingBufferCount += cbSize;
                                        return;
                                }
                                else {
                                        i = (BLOCK_SIZE_BYTES - _ProcessingBufferCount);
-                                       System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, i);
+                                       System.Buffer.BlockCopy (rgb, ibStart, _ProcessingBuffer, _ProcessingBufferCount, i);
                                        ProcessBlock (_ProcessingBuffer, 0);
                                        _ProcessingBufferCount = 0;
-                                       start += i;
-                                       size -= i;
+                                       ibStart += i;
+                                       cbSize -= i;
                                }
                        }
 
-                       for (i=0; i<size-size%BLOCK_SIZE_BYTES; i += BLOCK_SIZE_BYTES) {
-                               ProcessBlock (rgb, start+i);
+                       for (i = 0; i < cbSize - cbSize % BLOCK_SIZE_BYTES; i += BLOCK_SIZE_BYTES) {
+                               ProcessBlock (rgb, ibStart + i);
                        }
 
-                       if (size%BLOCK_SIZE_BYTES != 0) {
-                               System.Buffer.BlockCopy (rgb, size-size%BLOCK_SIZE_BYTES+start, _ProcessingBuffer, 0, size%BLOCK_SIZE_BYTES);
-                               _ProcessingBufferCount = size%BLOCK_SIZE_BYTES;
+                       if (cbSize % BLOCK_SIZE_BYTES != 0) {
+                               System.Buffer.BlockCopy (rgb, cbSize - cbSize % BLOCK_SIZE_BYTES + ibStart, _ProcessingBuffer, 0, cbSize % BLOCK_SIZE_BYTES);
+                               _ProcessingBufferCount = cbSize % BLOCK_SIZE_BYTES;
                        }
                }