00001 #include "factory.h" 00002 00003 #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 00004 #include "modes.h" 00005 #include "dh.h" 00006 #include "esign.h" 00007 #include "md2.h" 00008 #include "rw.h" 00009 #include "md5.h" 00010 #include "rsa.h" 00011 #include "ripemd.h" 00012 #include "dsa.h" 00013 #include "seal.h" 00014 #include "whrlpool.h" 00015 #include "ttmac.h" 00016 #include "camellia.h" 00017 #include "shacal2.h" 00018 #include "tea.h" 00019 #include "panama.h" 00020 #include "pssr.h" 00021 #include "aes.h" 00022 #include "salsa.h" 00023 #include "vmac.h" 00024 #include "tiger.h" 00025 #include "md5.h" 00026 #include "sosemanuk.h" 00027 #include "arc4.h" 00028 #include "ccm.h" 00029 #include "gcm.h" 00030 #include "eax.h" 00031 #include "twofish.h" 00032 #include "serpent.h" 00033 #include "cast.h" 00034 #include "rc6.h" 00035 #include "mars.h" 00036 #include "shacal2.h" 00037 #include "des.h" 00038 #include "idea.h" 00039 #include "rc5.h" 00040 #include "tea.h" 00041 #include "skipjack.h" 00042 #include "cmac.h" 00043 #include "dmac.h" 00044 #include "blowfish.h" 00045 #include "seed.h" 00046 #include "wake.h" 00047 #include "seal.h" 00048 #include "crc.h" 00049 #include "adler32.h" 00050 00051 USING_NAMESPACE(CryptoPP) 00052 00053 void RegisterFactories() 00054 { 00055 static bool s_registered = false; 00056 if (s_registered) 00057 return; 00058 00059 RegisterDefaultFactoryFor<SimpleKeyAgreementDomain, DH>(); 00060 RegisterDefaultFactoryFor<HashTransformation, CRC32>(); 00061 RegisterDefaultFactoryFor<HashTransformation, Adler32>(); 00062 RegisterDefaultFactoryFor<HashTransformation, Weak::MD5>(); 00063 RegisterDefaultFactoryFor<HashTransformation, SHA1>(); 00064 RegisterDefaultFactoryFor<HashTransformation, SHA224>(); 00065 RegisterDefaultFactoryFor<HashTransformation, SHA256>(); 00066 RegisterDefaultFactoryFor<HashTransformation, SHA384>(); 00067 RegisterDefaultFactoryFor<HashTransformation, SHA512>(); 00068 RegisterDefaultFactoryFor<HashTransformation, Whirlpool>(); 00069 RegisterDefaultFactoryFor<HashTransformation, Tiger>(); 00070 RegisterDefaultFactoryFor<HashTransformation, RIPEMD160>(); 00071 RegisterDefaultFactoryFor<HashTransformation, RIPEMD320>(); 00072 RegisterDefaultFactoryFor<HashTransformation, RIPEMD128>(); 00073 RegisterDefaultFactoryFor<HashTransformation, RIPEMD256>(); 00074 RegisterDefaultFactoryFor<HashTransformation, Weak::PanamaHash<LittleEndian> >(); 00075 RegisterDefaultFactoryFor<HashTransformation, Weak::PanamaHash<BigEndian> >(); 00076 RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<Weak::MD5> >(); 00077 RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA1> >(); 00078 RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<RIPEMD160> >(); 00079 RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA224> >(); 00080 RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA256> >(); 00081 RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA384> >(); 00082 RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA512> >(); 00083 RegisterDefaultFactoryFor<MessageAuthenticationCode, TTMAC>(); 00084 RegisterDefaultFactoryFor<MessageAuthenticationCode, VMAC<AES> >(); 00085 RegisterDefaultFactoryFor<MessageAuthenticationCode, VMAC<AES, 64> >(); 00086 RegisterDefaultFactoryFor<MessageAuthenticationCode, Weak::PanamaMAC<LittleEndian> >(); 00087 RegisterDefaultFactoryFor<MessageAuthenticationCode, Weak::PanamaMAC<BigEndian> >(); 00088 RegisterDefaultFactoryFor<MessageAuthenticationCode, CMAC<AES> >(); 00089 RegisterDefaultFactoryFor<MessageAuthenticationCode, DMAC<AES> >(); 00090 RegisterDefaultFactoryFor<MessageAuthenticationCode, CMAC<DES_EDE3> >(); 00091 RegisterAsymmetricCipherDefaultFactories<RSAES<OAEP<SHA1> > >("RSA/OAEP-MGF1(SHA-1)"); 00092 RegisterAsymmetricCipherDefaultFactories<DLIES<> >("DLIES(NoCofactorMultiplication, KDF2(SHA-1), XOR, HMAC(SHA-1), DHAES)"); 00093 RegisterSignatureSchemeDefaultFactories<DSA>("DSA(1363)"); 00094 RegisterSignatureSchemeDefaultFactories<NR<SHA1> >("NR(1363)/EMSA1(SHA-1)"); 00095 RegisterSignatureSchemeDefaultFactories<GDSA<SHA1> >("DSA-1363/EMSA1(SHA-1)"); 00096 RegisterSignatureSchemeDefaultFactories<RSASS<PKCS1v15, Weak::MD2> >("RSA/PKCS1-1.5(MD2)"); 00097 RegisterSignatureSchemeDefaultFactories<RSASS<PKCS1v15, SHA1> >("RSA/PKCS1-1.5(SHA-1)"); 00098 RegisterSignatureSchemeDefaultFactories<ESIGN<SHA1> >("ESIGN/EMSA5-MGF1(SHA-1)"); 00099 RegisterSignatureSchemeDefaultFactories<RWSS<P1363_EMSA2, SHA1> >("RW/EMSA2(SHA-1)"); 00100 RegisterSignatureSchemeDefaultFactories<RSASS<PSS, SHA1> >("RSA/PSS-MGF1(SHA-1)"); 00101 RegisterSymmetricCipherDefaultFactories<SEAL<> >(); 00102 RegisterSymmetricCipherDefaultFactories<ECB_Mode<SHACAL2> >(); 00103 RegisterSymmetricCipherDefaultFactories<ECB_Mode<Camellia> >(); 00104 RegisterSymmetricCipherDefaultFactories<ECB_Mode<TEA> >(); 00105 RegisterSymmetricCipherDefaultFactories<ECB_Mode<XTEA> >(); 00106 RegisterSymmetricCipherDefaultFactories<PanamaCipher<LittleEndian> >(); 00107 RegisterSymmetricCipherDefaultFactories<PanamaCipher<BigEndian> >(); 00108 RegisterSymmetricCipherDefaultFactories<ECB_Mode<AES> >(); 00109 RegisterSymmetricCipherDefaultFactories<CBC_Mode<AES> >(); 00110 RegisterSymmetricCipherDefaultFactories<CFB_Mode<AES> >(); 00111 RegisterSymmetricCipherDefaultFactories<OFB_Mode<AES> >(); 00112 RegisterSymmetricCipherDefaultFactories<CTR_Mode<AES> >(); 00113 RegisterSymmetricCipherDefaultFactories<Salsa20>(); 00114 RegisterSymmetricCipherDefaultFactories<XSalsa20>(); 00115 RegisterSymmetricCipherDefaultFactories<Sosemanuk>(); 00116 RegisterSymmetricCipherDefaultFactories<Weak::MARC4>(); 00117 RegisterSymmetricCipherDefaultFactories<WAKE_OFB<LittleEndian> >(); 00118 RegisterSymmetricCipherDefaultFactories<WAKE_OFB<BigEndian> >(); 00119 RegisterSymmetricCipherDefaultFactories<SEAL<LittleEndian> >(); 00120 RegisterAuthenticatedSymmetricCipherDefaultFactories<CCM<AES> >(); 00121 RegisterAuthenticatedSymmetricCipherDefaultFactories<GCM<AES> >(); 00122 RegisterAuthenticatedSymmetricCipherDefaultFactories<EAX<AES> >(); 00123 RegisterSymmetricCipherDefaultFactories<CTR_Mode<Camellia> >(); 00124 RegisterSymmetricCipherDefaultFactories<CTR_Mode<Twofish> >(); 00125 RegisterSymmetricCipherDefaultFactories<CTR_Mode<Serpent> >(); 00126 RegisterSymmetricCipherDefaultFactories<CTR_Mode<CAST256> >(); 00127 RegisterSymmetricCipherDefaultFactories<CTR_Mode<RC6> >(); 00128 RegisterSymmetricCipherDefaultFactories<ECB_Mode<MARS> >(); 00129 RegisterSymmetricCipherDefaultFactories<CTR_Mode<MARS> >(); 00130 RegisterSymmetricCipherDefaultFactories<CTR_Mode<SHACAL2> >(); 00131 RegisterSymmetricCipherDefaultFactories<CTR_Mode<DES> >(); 00132 RegisterSymmetricCipherDefaultFactories<CTR_Mode<DES_XEX3> >(); 00133 RegisterSymmetricCipherDefaultFactories<CTR_Mode<DES_EDE3> >(); 00134 RegisterSymmetricCipherDefaultFactories<CTR_Mode<IDEA> >(); 00135 RegisterSymmetricCipherDefaultFactories<CTR_Mode<RC5> >(); 00136 RegisterSymmetricCipherDefaultFactories<CTR_Mode<TEA> >(); 00137 RegisterSymmetricCipherDefaultFactories<CTR_Mode<XTEA> >(); 00138 RegisterSymmetricCipherDefaultFactories<CTR_Mode<CAST128> >(); 00139 RegisterSymmetricCipherDefaultFactories<CTR_Mode<SKIPJACK> >(); 00140 RegisterSymmetricCipherDefaultFactories<CTR_Mode<Blowfish> >(); 00141 RegisterSymmetricCipherDefaultFactories<ECB_Mode<SEED> >(); 00142 RegisterSymmetricCipherDefaultFactories<CTR_Mode<SEED> >(); 00143 00144 s_registered = true; 00145 }