New tests.
[mono.git] / mcs / class / corlib / System.Security.Cryptography / SHA512.cs
index 49f266701e79b378b97ca55e8c740fc2b401206e..00baef00d084cc62d6143499109c145893b2798c 100644 (file)
@@ -3,43 +3,56 @@
 //\r
 // Authors:\r
 //   Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)\r
+//   Sebastien Pouliot <sebastien@ximian.com>
 //\r
 // Copyright 2001 by Matthew S. Ford.\r
-//\r
-\r
-\r
-using System.Security.Cryptography;\r
+// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)\r
+// Copyright (C) 2004-2006 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
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if !MOONLIGHT
+
+using System.Runtime.InteropServices;
 \r
 namespace System.Security.Cryptography {\r
-       \r
-       /// <summary>\r
-       /// Common base class for all derived SHA512 iplementations.\r
-       /// </summary>\r
+
+       [ComVisible (true)]
        public abstract class SHA512 : HashAlgorithm {\r
-               \r
-               /// <summary>\r
-               /// Called from constructor of derived class.\r
-               /// </summary>\r
-               public SHA512 () {\r
-               \r
+
+               protected SHA512 ()
+               {\r
+                       HashSizeValue = 512;\r
                }\r
 \r
-       \r
-               /// <summary>\r
-               /// Creates the default derived class.\r
-               /// </summary>\r
-               public static new SHA512 Create () {\r
-                       return new SHA512Managed();\r
+               public static new SHA512 Create () \r
+               {\r
+                       return Create ("System.Security.Cryptography.SHA512");\r
                }\r
        \r
-               /// <summary>\r
-               /// Creates a new derived class.\r
-               /// </summary>\r
-               /// <param name="st">FIXME: No clue.  Specifies which derived class to create?</param>\r
-               [MonoTODO]\r
-               public static new SHA512 Create (string st) {\r
-                       return Create();\r
+               public static new SHA512 Create (string hashName) \r
+               {\r
+                       return (SHA512) CryptoConfig.CreateFromName (hashName);\r
                }\r
        }\r
 }\r
-\r
+#endif
+