Merge pull request #2810 from kumpera/fix_hazard_free
[mono.git] / mcs / class / corlib / CommonCrypto / generator.cs
1 //
2 // CommonCrypto Code Generator
3 //
4 // Authors:
5 //      Sebastien Pouliot  <sebastien@xamarin.com>
6 //
7 // Copyright 2012 Xamarin Inc.
8 //
9
10 using System;
11 using System.Collections.Generic;
12 using System.IO;
13 using System.Text;
14
15 namespace Xamarin {
16         
17         class Program {
18                 static void Main (string [] args)
19                 {
20                         // mscorlib replacements
21                         CommonDigest.Generate ("System.Security.Cryptography", "MD5CryptoServiceProvider", "MD5", 1000);
22                         CommonDigest.Generate ("System.Security.Cryptography", "SHA1CryptoServiceProvider", "SHA1", 1000);
23                         CommonDigest.Generate ("System.Security.Cryptography", "SHA1Managed", "SHA1", 1000);
24                         CommonDigest.Generate ("System.Security.Cryptography", "SHA256Managed", "SHA256", 1000);
25                         CommonDigest.Generate ("System.Security.Cryptography", "SHA384Managed", "SHA384", 1000);
26                         CommonDigest.Generate ("System.Security.Cryptography", "SHA512Managed", "SHA512", 1000);
27                         
28                         // System.Core replacements - not yet in MT profile (4.0 - functional dupes anyway)
29                         //CommonDigest.Generate ("System.Security.Cryptography", "MD5Cng", "MD5", 1000);
30                         //CommonDigest.Generate ("System.Security.Cryptography", "SHA256Cng", "SHA256", 1000);
31                         //CommonDigest.Generate ("System.Security.Cryptography", "SHA384Cng", "SHA384", 1000);
32                         //CommonDigest.Generate ("System.Security.Cryptography", "SHA512Cng", "SHA512", 1000);
33                         //CommonDigest.Generate ("System.Security.Cryptography", "SHA256CryptoServiceProvider", "SHA256", 1000);
34                         //CommonDigest.Generate ("System.Security.Cryptography", "SHA384CryptoServiceProvider", "SHA384", 1000);
35                         //CommonDigest.Generate ("System.Security.Cryptography", "SHA512CryptoServiceProvider", "SHA512", 1000);
36                         
37                         // Mono.Security replacements
38                         CommonDigest.Generate ("Mono.Security.Cryptography", "MD2Managed", "MD2", 1000, "#if !INSIDE_CORLIB", "#endif");
39                         CommonDigest.Generate ("Mono.Security.Cryptography", "MD4Managed", "MD4", 1000, "#if !INSIDE_CORLIB", "#endif");
40                         CommonDigest.Generate ("Mono.Security.Cryptography", "SHA224Managed", "SHA224", 1000);
41
42                         // mscorlib replacements
43                         CommonCryptor.Generate ("System.Security.Cryptography", "DESCryptoServiceProvider", "DES", "DES");
44                         CommonCryptor.Generate ("System.Security.Cryptography", "TripleDESCryptoServiceProvider", "TripleDES", "TripleDES");
45                         CommonCryptor.Generate ("System.Security.Cryptography", "RC2CryptoServiceProvider", "RC2", "RC2", ctorInitializers: "LegalKeySizesValue = new[] { new KeySizes(40, 128, 8) };");
46                         // Rijndael supports block sizes that are not available in AES - as such it does not use the same generated code
47                         // but has it's own version, using AES (128 bits block size) and falling back to managed (192/256 bits block size)
48
49                         // System.Core replacements
50                         CommonCryptor.Generate ("System.Security.Cryptography", "AesManaged", "Aes", "AES128", "128");
51                         CommonCryptor.Generate ("System.Security.Cryptography", "AesCryptoServiceProvider", "Aes", "AES128");
52
53                         // Mono.Security replacements
54                         // RC4 is a stream (not a block) cipher so it can not reuse the generated code
55                 }
56         }
57 }