Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
6.5 KiB

  1. #include "factory.h"
  2. #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
  3. #include "modes.h"
  4. #include "dh.h"
  5. #include "esign.h"
  6. #include "md2.h"
  7. #include "rw.h"
  8. #include "md5.h"
  9. #include "rsa.h"
  10. #include "ripemd.h"
  11. #include "dsa.h"
  12. #include "seal.h"
  13. #include "whrlpool.h"
  14. #include "ttmac.h"
  15. #include "camellia.h"
  16. #include "shacal2.h"
  17. #include "tea.h"
  18. #include "panama.h"
  19. #include "pssr.h"
  20. #include "aes.h"
  21. #include "salsa.h"
  22. #include "vmac.h"
  23. #include "tiger.h"
  24. #include "md5.h"
  25. #include "sosemanuk.h"
  26. #include "arc4.h"
  27. #include "ccm.h"
  28. #include "gcm.h"
  29. #include "eax.h"
  30. #include "twofish.h"
  31. #include "serpent.h"
  32. #include "cast.h"
  33. #include "rc6.h"
  34. #include "mars.h"
  35. #include "shacal2.h"
  36. #include "des.h"
  37. #include "idea.h"
  38. #include "rc5.h"
  39. #include "tea.h"
  40. #include "skipjack.h"
  41. #include "cmac.h"
  42. #include "dmac.h"
  43. #include "blowfish.h"
  44. #include "seed.h"
  45. #include "wake.h"
  46. #include "seal.h"
  47. #include "crc.h"
  48. #include "adler32.h"
  49. USING_NAMESPACE(CryptoPP)
  50. void RegisterFactories()
  51. {
  52. static bool s_registered = false;
  53. if (s_registered)
  54. return;
  55. RegisterDefaultFactoryFor<SimpleKeyAgreementDomain, DH>();
  56. RegisterDefaultFactoryFor<HashTransformation, CRC32>();
  57. RegisterDefaultFactoryFor<HashTransformation, Adler32>();
  58. RegisterDefaultFactoryFor<HashTransformation, Weak::MD5>();
  59. RegisterDefaultFactoryFor<HashTransformation, SHA1>();
  60. RegisterDefaultFactoryFor<HashTransformation, SHA224>();
  61. RegisterDefaultFactoryFor<HashTransformation, SHA256>();
  62. RegisterDefaultFactoryFor<HashTransformation, SHA384>();
  63. RegisterDefaultFactoryFor<HashTransformation, SHA512>();
  64. RegisterDefaultFactoryFor<HashTransformation, Whirlpool>();
  65. RegisterDefaultFactoryFor<HashTransformation, Tiger>();
  66. RegisterDefaultFactoryFor<HashTransformation, RIPEMD160>();
  67. RegisterDefaultFactoryFor<HashTransformation, RIPEMD320>();
  68. RegisterDefaultFactoryFor<HashTransformation, RIPEMD128>();
  69. RegisterDefaultFactoryFor<HashTransformation, RIPEMD256>();
  70. RegisterDefaultFactoryFor<HashTransformation, Weak::PanamaHash<LittleEndian> >();
  71. RegisterDefaultFactoryFor<HashTransformation, Weak::PanamaHash<BigEndian> >();
  72. RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<Weak::MD5> >();
  73. RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA1> >();
  74. RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<RIPEMD160> >();
  75. RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA224> >();
  76. RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA256> >();
  77. RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA384> >();
  78. RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA512> >();
  79. RegisterDefaultFactoryFor<MessageAuthenticationCode, TTMAC>();
  80. RegisterDefaultFactoryFor<MessageAuthenticationCode, VMAC<AES> >();
  81. RegisterDefaultFactoryFor<MessageAuthenticationCode, VMAC<AES, 64> >();
  82. RegisterDefaultFactoryFor<MessageAuthenticationCode, Weak::PanamaMAC<LittleEndian> >();
  83. RegisterDefaultFactoryFor<MessageAuthenticationCode, Weak::PanamaMAC<BigEndian> >();
  84. RegisterDefaultFactoryFor<MessageAuthenticationCode, CMAC<AES> >();
  85. RegisterDefaultFactoryFor<MessageAuthenticationCode, DMAC<AES> >();
  86. RegisterDefaultFactoryFor<MessageAuthenticationCode, CMAC<DES_EDE3> >();
  87. RegisterAsymmetricCipherDefaultFactories<RSAES<OAEP<SHA1> > >("RSA/OAEP-MGF1(SHA-1)");
  88. RegisterAsymmetricCipherDefaultFactories<DLIES<> >("DLIES(NoCofactorMultiplication, KDF2(SHA-1), XOR, HMAC(SHA-1), DHAES)");
  89. RegisterSignatureSchemeDefaultFactories<DSA>("DSA(1363)");
  90. RegisterSignatureSchemeDefaultFactories<NR<SHA1> >("NR(1363)/EMSA1(SHA-1)");
  91. RegisterSignatureSchemeDefaultFactories<GDSA<SHA1> >("DSA-1363/EMSA1(SHA-1)");
  92. RegisterSignatureSchemeDefaultFactories<RSASS<PKCS1v15, Weak::MD2> >("RSA/PKCS1-1.5(MD2)");
  93. RegisterSignatureSchemeDefaultFactories<RSASS<PKCS1v15, SHA1> >("RSA/PKCS1-1.5(SHA-1)");
  94. RegisterSignatureSchemeDefaultFactories<ESIGN<SHA1> >("ESIGN/EMSA5-MGF1(SHA-1)");
  95. RegisterSignatureSchemeDefaultFactories<RWSS<P1363_EMSA2, SHA1> >("RW/EMSA2(SHA-1)");
  96. RegisterSignatureSchemeDefaultFactories<RSASS<PSS, SHA1> >("RSA/PSS-MGF1(SHA-1)");
  97. RegisterSymmetricCipherDefaultFactories<SEAL<> >();
  98. RegisterSymmetricCipherDefaultFactories<ECB_Mode<SHACAL2> >();
  99. RegisterSymmetricCipherDefaultFactories<ECB_Mode<Camellia> >();
  100. RegisterSymmetricCipherDefaultFactories<ECB_Mode<TEA> >();
  101. RegisterSymmetricCipherDefaultFactories<ECB_Mode<XTEA> >();
  102. RegisterSymmetricCipherDefaultFactories<PanamaCipher<LittleEndian> >();
  103. RegisterSymmetricCipherDefaultFactories<PanamaCipher<BigEndian> >();
  104. RegisterSymmetricCipherDefaultFactories<ECB_Mode<AES> >();
  105. RegisterSymmetricCipherDefaultFactories<CBC_Mode<AES> >();
  106. RegisterSymmetricCipherDefaultFactories<CFB_Mode<AES> >();
  107. RegisterSymmetricCipherDefaultFactories<OFB_Mode<AES> >();
  108. RegisterSymmetricCipherDefaultFactories<CTR_Mode<AES> >();
  109. RegisterSymmetricCipherDefaultFactories<Salsa20>();
  110. RegisterSymmetricCipherDefaultFactories<XSalsa20>();
  111. RegisterSymmetricCipherDefaultFactories<Sosemanuk>();
  112. RegisterSymmetricCipherDefaultFactories<Weak::MARC4>();
  113. RegisterSymmetricCipherDefaultFactories<WAKE_OFB<LittleEndian> >();
  114. RegisterSymmetricCipherDefaultFactories<WAKE_OFB<BigEndian> >();
  115. RegisterSymmetricCipherDefaultFactories<SEAL<LittleEndian> >();
  116. RegisterAuthenticatedSymmetricCipherDefaultFactories<CCM<AES> >();
  117. RegisterAuthenticatedSymmetricCipherDefaultFactories<GCM<AES> >();
  118. RegisterAuthenticatedSymmetricCipherDefaultFactories<EAX<AES> >();
  119. RegisterSymmetricCipherDefaultFactories<CTR_Mode<Camellia> >();
  120. RegisterSymmetricCipherDefaultFactories<CTR_Mode<Twofish> >();
  121. RegisterSymmetricCipherDefaultFactories<CTR_Mode<Serpent> >();
  122. RegisterSymmetricCipherDefaultFactories<CTR_Mode<CAST256> >();
  123. RegisterSymmetricCipherDefaultFactories<CTR_Mode<RC6> >();
  124. RegisterSymmetricCipherDefaultFactories<ECB_Mode<MARS> >();
  125. RegisterSymmetricCipherDefaultFactories<CTR_Mode<MARS> >();
  126. RegisterSymmetricCipherDefaultFactories<CTR_Mode<SHACAL2> >();
  127. RegisterSymmetricCipherDefaultFactories<CTR_Mode<DES> >();
  128. RegisterSymmetricCipherDefaultFactories<CTR_Mode<DES_XEX3> >();
  129. RegisterSymmetricCipherDefaultFactories<CTR_Mode<DES_EDE3> >();
  130. RegisterSymmetricCipherDefaultFactories<CTR_Mode<IDEA> >();
  131. RegisterSymmetricCipherDefaultFactories<CTR_Mode<RC5> >();
  132. RegisterSymmetricCipherDefaultFactories<CTR_Mode<TEA> >();
  133. RegisterSymmetricCipherDefaultFactories<CTR_Mode<XTEA> >();
  134. RegisterSymmetricCipherDefaultFactories<CTR_Mode<CAST128> >();
  135. RegisterSymmetricCipherDefaultFactories<CTR_Mode<SKIPJACK> >();
  136. RegisterSymmetricCipherDefaultFactories<CTR_Mode<Blowfish> >();
  137. RegisterSymmetricCipherDefaultFactories<ECB_Mode<SEED> >();
  138. RegisterSymmetricCipherDefaultFactories<CTR_Mode<SEED> >();
  139. s_registered = true;
  140. }