2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / Mono.Security.Win32 / Mono.Security.Cryptography / MD2.cs
1 //
2 // MD2.cs - Message Digest 2 Abstract class
3 //
4 // Author:
5 //      Sebastien Pouliot (spouliot@motus.com)
6 //
7 // (C) 2001-2003 Motus Technologies Inc. (http://www.motus.com)
8 //
9
10 using System;
11 using System.Security.Cryptography;
12
13 namespace Mono.Security.Cryptography {
14
15 public abstract class MD2 : HashAlgorithm {
16
17         protected MD2 () 
18         {
19                 // MD2 hash length are 128 bits long
20                 HashSizeValue = 128; 
21         }
22
23         public static new MD2 Create ()
24         {
25                 // for this to work we must register ourself with CryptoConfig
26                 return Create ("MD2");
27         }
28
29         public static new MD2 Create (string hashName)
30         {
31                 object o = CryptoConfig.CreateFromName (hashName);
32                 // in case machine.config isn't configured to use any MD2 implementation
33                 if (o == null) {
34                         o = new MD2CryptoServiceProvider ();
35                 }
36                 return (MD2) o;
37         }
38 }
39
40 }