2 // CommonCrypto Code Generator
5 // Sebastien Pouliot <sebastien@xamarin.com>
7 // Copyright 2012 Xamarin Inc.
11 using System.Collections.Generic;
18 static void Main (string [] args)
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);
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);
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);
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)
49 // System.Core replacements
50 CommonCryptor.Generate ("System.Security.Cryptography", "AesManaged", "Aes", "AES128", "128");
51 CommonCryptor.Generate ("System.Security.Cryptography", "AesCryptoServiceProvider", "Aes", "AES128");
53 // Mono.Security replacements
54 // RC4 is a stream (not a block) cipher so it can not reuse the generated code