2010-03-12 Jb Evain <jbevain@novell.com>
[mono.git] / mcs / class / corlib / System.Security.Cryptography / MACTripleDES.cs
index f24dad755527248c83502492b1986a7da60d0d25..aebd4b4086f3bc73ffaefe19dae3a8f06543c27d 100644 (file)
@@ -2,10 +2,10 @@
 // MACTripleDES.cs: Handles MAC with TripleDES
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot (sebastien@ximian.com)
 //
 // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -27,6 +27,8 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if !NET_2_1 || MONOTOUCH
+
 using System.Runtime.InteropServices;
 
 using Mono.Security.Cryptography;
@@ -39,6 +41,7 @@ namespace System.Security.Cryptography {
        //      http://www.itl.nist.gov/fipspubs/fip81.htm
        
        // LAMESPEC: MACTripleDES == MAC-CBC using TripleDES (not MAC-CFB).
+       [ComVisible (true)]
        public class MACTripleDES: KeyedHashAlgorithm {
        
                private TripleDES tdes;
@@ -91,13 +94,11 @@ namespace System.Security.Cryptography {
                        Dispose (false);
                }
 
-#if NET_2_0
                [ComVisible (false)]
                public PaddingMode Padding {
                        get { return tdes.Padding; }
                        set { tdes.Padding = value; }
                }
-#endif
 
                protected override void Dispose (bool disposing) 
                {
@@ -130,7 +131,7 @@ namespace System.Security.Cryptography {
                        mac.Initialize (KeyValue);
                }
        
-               protected override void HashCore (byte[] rgb, int ib, int cb
+               protected override void HashCore (byte[] rgbData, int ibStart, int cbSize
                {
                        if (m_disposed)
                                throw new ObjectDisposedException ("MACTripleDES");
@@ -138,7 +139,7 @@ namespace System.Security.Cryptography {
                                Initialize ();
                                State = 1;
                        }
-                       mac.Core (rgb, ib, cb);
+                       mac.Core (rgbData, ibStart, cbSize);
                }
        
                protected override byte[] HashFinal () 
@@ -150,3 +151,6 @@ namespace System.Security.Cryptography {
                }
        }
 }
+
+#endif
+