/security/nss/lib/freebl/ldvector.c

http://github.com/zpao/v8monkey · C · 309 lines · 210 code · 45 blank · 54 comment · 0 complexity · f91ac77c672184f226b7c50cb4e9ab23 MD5 · raw file

  1. /*
  2. * ldvector.c - platform dependent DSO containing freebl implementation.
  3. *
  4. * ***** BEGIN LICENSE BLOCK *****
  5. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  6. *
  7. * The contents of this file are subject to the Mozilla Public License Version
  8. * 1.1 (the "License"); you may not use this file except in compliance with
  9. * the License. You may obtain a copy of the License at
  10. * http://www.mozilla.org/MPL/
  11. *
  12. * Software distributed under the License is distributed on an "AS IS" basis,
  13. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  14. * for the specific language governing rights and limitations under the
  15. * License.
  16. *
  17. * The Original Code is the Netscape security libraries.
  18. *
  19. * The Initial Developer of the Original Code is
  20. * Netscape Communications Corporation.
  21. * Portions created by the Initial Developer are Copyright (C) 2000
  22. * the Initial Developer. All Rights Reserved.
  23. *
  24. * Contributor(s):
  25. * Dr Vipul Gupta <vipul.gupta@sun.com>, Sun Microsystems Laboratories
  26. *
  27. * Alternatively, the contents of this file may be used under the terms of
  28. * either the GNU General Public License Version 2 or later (the "GPL"), or
  29. * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  30. * in which case the provisions of the GPL or the LGPL are applicable instead
  31. * of those above. If you wish to allow use of your version of this file only
  32. * under the terms of either the GPL or the LGPL, and not to allow others to
  33. * use your version of this file under the terms of the MPL, indicate your
  34. * decision by deleting the provisions above and replace them with the notice
  35. * and other provisions required by the GPL or the LGPL. If you do not delete
  36. * the provisions above, a recipient may use your version of this file under
  37. * the terms of any one of the MPL, the GPL or the LGPL.
  38. *
  39. * ***** END LICENSE BLOCK ***** */
  40. /* $Id: ldvector.c,v 1.29 2011/10/04 22:05:53 wtc%google.com Exp $ */
  41. #ifdef FREEBL_NO_DEPEND
  42. extern int FREEBL_InitStubs(void);
  43. #endif
  44. #include "loader.h"
  45. #include "alghmac.h"
  46. static const struct FREEBLVectorStr vector =
  47. {
  48. sizeof vector,
  49. FREEBL_VERSION,
  50. RSA_NewKey,
  51. RSA_PublicKeyOp,
  52. RSA_PrivateKeyOp,
  53. DSA_NewKey,
  54. DSA_SignDigest,
  55. DSA_VerifyDigest,
  56. DSA_NewKeyFromSeed,
  57. DSA_SignDigestWithSeed,
  58. DH_GenParam,
  59. DH_NewKey,
  60. DH_Derive,
  61. KEA_Derive,
  62. KEA_Verify,
  63. RC4_CreateContext,
  64. RC4_DestroyContext,
  65. RC4_Encrypt,
  66. RC4_Decrypt,
  67. RC2_CreateContext,
  68. RC2_DestroyContext,
  69. RC2_Encrypt,
  70. RC2_Decrypt,
  71. RC5_CreateContext,
  72. RC5_DestroyContext,
  73. RC5_Encrypt,
  74. RC5_Decrypt,
  75. DES_CreateContext,
  76. DES_DestroyContext,
  77. DES_Encrypt,
  78. DES_Decrypt,
  79. AES_CreateContext,
  80. AES_DestroyContext,
  81. AES_Encrypt,
  82. AES_Decrypt,
  83. MD5_Hash,
  84. MD5_HashBuf,
  85. MD5_NewContext,
  86. MD5_DestroyContext,
  87. MD5_Begin,
  88. MD5_Update,
  89. MD5_End,
  90. MD5_FlattenSize,
  91. MD5_Flatten,
  92. MD5_Resurrect,
  93. MD5_TraceState,
  94. MD2_Hash,
  95. MD2_NewContext,
  96. MD2_DestroyContext,
  97. MD2_Begin,
  98. MD2_Update,
  99. MD2_End,
  100. MD2_FlattenSize,
  101. MD2_Flatten,
  102. MD2_Resurrect,
  103. SHA1_Hash,
  104. SHA1_HashBuf,
  105. SHA1_NewContext,
  106. SHA1_DestroyContext,
  107. SHA1_Begin,
  108. SHA1_Update,
  109. SHA1_End,
  110. SHA1_TraceState,
  111. SHA1_FlattenSize,
  112. SHA1_Flatten,
  113. SHA1_Resurrect,
  114. RNG_RNGInit,
  115. RNG_RandomUpdate,
  116. RNG_GenerateGlobalRandomBytes,
  117. RNG_RNGShutdown,
  118. PQG_ParamGen,
  119. PQG_ParamGenSeedLen,
  120. PQG_VerifyParams,
  121. /* End of Version 3.001. */
  122. RSA_PrivateKeyOpDoubleChecked,
  123. RSA_PrivateKeyCheck,
  124. BL_Cleanup,
  125. /* End of Version 3.002. */
  126. SHA256_NewContext,
  127. SHA256_DestroyContext,
  128. SHA256_Begin,
  129. SHA256_Update,
  130. SHA256_End,
  131. SHA256_HashBuf,
  132. SHA256_Hash,
  133. SHA256_TraceState,
  134. SHA256_FlattenSize,
  135. SHA256_Flatten,
  136. SHA256_Resurrect,
  137. SHA512_NewContext,
  138. SHA512_DestroyContext,
  139. SHA512_Begin,
  140. SHA512_Update,
  141. SHA512_End,
  142. SHA512_HashBuf,
  143. SHA512_Hash,
  144. SHA512_TraceState,
  145. SHA512_FlattenSize,
  146. SHA512_Flatten,
  147. SHA512_Resurrect,
  148. SHA384_NewContext,
  149. SHA384_DestroyContext,
  150. SHA384_Begin,
  151. SHA384_Update,
  152. SHA384_End,
  153. SHA384_HashBuf,
  154. SHA384_Hash,
  155. SHA384_TraceState,
  156. SHA384_FlattenSize,
  157. SHA384_Flatten,
  158. SHA384_Resurrect,
  159. /* End of Version 3.003. */
  160. AESKeyWrap_CreateContext,
  161. AESKeyWrap_DestroyContext,
  162. AESKeyWrap_Encrypt,
  163. AESKeyWrap_Decrypt,
  164. /* End of Version 3.004. */
  165. BLAPI_SHVerify,
  166. BLAPI_VerifySelf,
  167. /* End of Version 3.005. */
  168. EC_NewKey,
  169. EC_NewKeyFromSeed,
  170. EC_ValidatePublicKey,
  171. ECDH_Derive,
  172. ECDSA_SignDigest,
  173. ECDSA_VerifyDigest,
  174. ECDSA_SignDigestWithSeed,
  175. /* End of Version 3.006. */
  176. /* End of Version 3.007. */
  177. AES_InitContext,
  178. AESKeyWrap_InitContext,
  179. DES_InitContext,
  180. RC2_InitContext,
  181. RC4_InitContext,
  182. AES_AllocateContext,
  183. AESKeyWrap_AllocateContext,
  184. DES_AllocateContext,
  185. RC2_AllocateContext,
  186. RC4_AllocateContext,
  187. MD2_Clone,
  188. MD5_Clone,
  189. SHA1_Clone,
  190. SHA256_Clone,
  191. SHA384_Clone,
  192. SHA512_Clone,
  193. TLS_PRF,
  194. HASH_GetRawHashObject,
  195. HMAC_Create,
  196. HMAC_Init,
  197. HMAC_Begin,
  198. HMAC_Update,
  199. HMAC_Clone,
  200. HMAC_Finish,
  201. HMAC_Destroy,
  202. RNG_SystemInfoForRNG,
  203. /* End of Version 3.008. */
  204. FIPS186Change_GenerateX,
  205. FIPS186Change_ReduceModQForDSA,
  206. /* End of Version 3.009. */
  207. Camellia_InitContext,
  208. Camellia_AllocateContext,
  209. Camellia_CreateContext,
  210. Camellia_DestroyContext,
  211. Camellia_Encrypt,
  212. Camellia_Decrypt,
  213. PQG_DestroyParams,
  214. PQG_DestroyVerify,
  215. /* End of Version 3.010. */
  216. SEED_InitContext,
  217. SEED_AllocateContext,
  218. SEED_CreateContext,
  219. SEED_DestroyContext,
  220. SEED_Encrypt,
  221. SEED_Decrypt,
  222. BL_Init,
  223. BL_SetForkState,
  224. PRNGTEST_Instantiate,
  225. PRNGTEST_Reseed,
  226. PRNGTEST_Generate,
  227. PRNGTEST_Uninstantiate,
  228. /* End of Version 3.011. */
  229. RSA_PopulatePrivateKey,
  230. DSA_NewRandom,
  231. JPAKE_Sign,
  232. JPAKE_Verify,
  233. JPAKE_Round2,
  234. JPAKE_Final,
  235. /* End of Version 3.012 */
  236. TLS_P_hash,
  237. SHA224_NewContext,
  238. SHA224_DestroyContext,
  239. SHA224_Begin,
  240. SHA224_Update,
  241. SHA224_End,
  242. SHA224_HashBuf,
  243. SHA224_Hash,
  244. SHA224_TraceState,
  245. SHA224_FlattenSize,
  246. SHA224_Flatten,
  247. SHA224_Resurrect,
  248. SHA224_Clone,
  249. BLAPI_SHVerifyFile
  250. /* End of Version 3.013 */
  251. };
  252. const FREEBLVector *
  253. FREEBL_GetVector(void)
  254. {
  255. extern const char __nss_freebl_rcsid[];
  256. extern const char __nss_freebl_sccsid[];
  257. /* force a reference that won't get optimized away */
  258. volatile char c;
  259. c = __nss_freebl_rcsid[0] + __nss_freebl_sccsid[0];
  260. #ifdef FREEBL_NO_DEPEND
  261. FREEBL_InitStubs();
  262. #endif
  263. return &vector;
  264. }