PageRenderTime 32ms CodeModel.GetById 15ms app.highlight 12ms RepoModel.GetById 2ms app.codeStats 0ms

/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
 42#ifdef FREEBL_NO_DEPEND
 43extern int FREEBL_InitStubs(void);
 44#endif
 45
 46#include "loader.h"
 47#include "alghmac.h"
 48
 49
 50static const struct FREEBLVectorStr vector = 
 51{
 52
 53    sizeof vector,
 54    FREEBL_VERSION,
 55
 56    RSA_NewKey,
 57    RSA_PublicKeyOp,
 58    RSA_PrivateKeyOp,
 59    DSA_NewKey,
 60    DSA_SignDigest,
 61    DSA_VerifyDigest,
 62    DSA_NewKeyFromSeed,
 63    DSA_SignDigestWithSeed,
 64    DH_GenParam,
 65    DH_NewKey,
 66    DH_Derive,
 67    KEA_Derive,
 68    KEA_Verify,
 69    RC4_CreateContext,
 70    RC4_DestroyContext,
 71    RC4_Encrypt,
 72    RC4_Decrypt,
 73    RC2_CreateContext,
 74    RC2_DestroyContext,
 75    RC2_Encrypt,
 76    RC2_Decrypt,
 77    RC5_CreateContext,
 78    RC5_DestroyContext,
 79    RC5_Encrypt,
 80    RC5_Decrypt,
 81    DES_CreateContext,
 82    DES_DestroyContext,
 83    DES_Encrypt,
 84    DES_Decrypt,
 85    AES_CreateContext,
 86    AES_DestroyContext,
 87    AES_Encrypt,
 88    AES_Decrypt,
 89    MD5_Hash,
 90    MD5_HashBuf,
 91    MD5_NewContext,
 92    MD5_DestroyContext,
 93    MD5_Begin,
 94    MD5_Update,
 95    MD5_End,
 96    MD5_FlattenSize,
 97    MD5_Flatten,
 98    MD5_Resurrect,
 99    MD5_TraceState,
100    MD2_Hash,
101    MD2_NewContext,
102    MD2_DestroyContext,
103    MD2_Begin,
104    MD2_Update,
105    MD2_End,
106    MD2_FlattenSize,
107    MD2_Flatten,
108    MD2_Resurrect,
109    SHA1_Hash,
110    SHA1_HashBuf,
111    SHA1_NewContext,
112    SHA1_DestroyContext,
113    SHA1_Begin,
114    SHA1_Update,
115    SHA1_End,
116    SHA1_TraceState,
117    SHA1_FlattenSize,
118    SHA1_Flatten,
119    SHA1_Resurrect,
120    RNG_RNGInit,
121    RNG_RandomUpdate,
122    RNG_GenerateGlobalRandomBytes,
123    RNG_RNGShutdown,
124    PQG_ParamGen,
125    PQG_ParamGenSeedLen,
126    PQG_VerifyParams,
127
128    /* End of Version 3.001. */
129
130    RSA_PrivateKeyOpDoubleChecked,
131    RSA_PrivateKeyCheck,
132    BL_Cleanup,
133
134    /* End of Version 3.002. */
135
136    SHA256_NewContext,
137    SHA256_DestroyContext,
138    SHA256_Begin,
139    SHA256_Update,
140    SHA256_End,
141    SHA256_HashBuf,
142    SHA256_Hash,
143    SHA256_TraceState,
144    SHA256_FlattenSize,
145    SHA256_Flatten,
146    SHA256_Resurrect,
147
148    SHA512_NewContext,
149    SHA512_DestroyContext,
150    SHA512_Begin,
151    SHA512_Update,
152    SHA512_End,
153    SHA512_HashBuf,
154    SHA512_Hash,
155    SHA512_TraceState,
156    SHA512_FlattenSize,
157    SHA512_Flatten,
158    SHA512_Resurrect,
159
160    SHA384_NewContext,
161    SHA384_DestroyContext,
162    SHA384_Begin,
163    SHA384_Update,
164    SHA384_End,
165    SHA384_HashBuf,
166    SHA384_Hash,
167    SHA384_TraceState,
168    SHA384_FlattenSize,
169    SHA384_Flatten,
170    SHA384_Resurrect,
171
172    /* End of Version 3.003. */
173
174    AESKeyWrap_CreateContext,
175    AESKeyWrap_DestroyContext,
176    AESKeyWrap_Encrypt,
177    AESKeyWrap_Decrypt,
178
179    /* End of Version 3.004. */
180
181    BLAPI_SHVerify,
182    BLAPI_VerifySelf,
183
184    /* End of Version 3.005. */
185
186    EC_NewKey,
187    EC_NewKeyFromSeed,
188    EC_ValidatePublicKey,
189    ECDH_Derive,
190    ECDSA_SignDigest,
191    ECDSA_VerifyDigest,
192    ECDSA_SignDigestWithSeed,
193
194    /* End of Version 3.006. */
195    /* End of Version 3.007. */
196
197    AES_InitContext,
198    AESKeyWrap_InitContext,
199    DES_InitContext,
200    RC2_InitContext,
201    RC4_InitContext,
202
203    AES_AllocateContext,
204    AESKeyWrap_AllocateContext,
205    DES_AllocateContext,
206    RC2_AllocateContext,
207    RC4_AllocateContext,
208
209    MD2_Clone,
210    MD5_Clone,
211    SHA1_Clone,
212    SHA256_Clone,
213    SHA384_Clone,
214    SHA512_Clone,
215
216    TLS_PRF,
217    HASH_GetRawHashObject,
218
219    HMAC_Create,
220    HMAC_Init,
221    HMAC_Begin,
222    HMAC_Update,
223    HMAC_Clone,
224    HMAC_Finish,
225    HMAC_Destroy,
226
227    RNG_SystemInfoForRNG,
228
229    /* End of Version 3.008. */
230
231    FIPS186Change_GenerateX,
232    FIPS186Change_ReduceModQForDSA,
233
234    /* End of Version 3.009. */
235    Camellia_InitContext,
236    Camellia_AllocateContext,
237    Camellia_CreateContext,
238    Camellia_DestroyContext,
239    Camellia_Encrypt,
240    Camellia_Decrypt,
241
242    PQG_DestroyParams,
243    PQG_DestroyVerify,
244
245    /* End of Version 3.010. */
246
247    SEED_InitContext,
248    SEED_AllocateContext,
249    SEED_CreateContext,
250    SEED_DestroyContext,
251    SEED_Encrypt,
252    SEED_Decrypt,
253
254    BL_Init,
255    BL_SetForkState,
256
257    PRNGTEST_Instantiate,
258    PRNGTEST_Reseed,
259    PRNGTEST_Generate,
260
261    PRNGTEST_Uninstantiate,
262
263    /* End of Version 3.011. */
264
265    RSA_PopulatePrivateKey,
266
267    DSA_NewRandom,
268
269    JPAKE_Sign,
270    JPAKE_Verify,
271    JPAKE_Round2,
272    JPAKE_Final,
273
274    /* End of Version 3.012 */
275
276    TLS_P_hash,
277    SHA224_NewContext,
278    SHA224_DestroyContext,
279    SHA224_Begin,
280    SHA224_Update,
281    SHA224_End,
282    SHA224_HashBuf,
283    SHA224_Hash,
284    SHA224_TraceState,
285    SHA224_FlattenSize,
286    SHA224_Flatten,
287    SHA224_Resurrect,
288    SHA224_Clone,
289    BLAPI_SHVerifyFile
290
291    /* End of Version 3.013 */
292};
293
294const FREEBLVector * 
295FREEBL_GetVector(void)
296{
297    extern const char __nss_freebl_rcsid[];
298    extern const char __nss_freebl_sccsid[];
299
300    /* force a reference that won't get optimized away */
301    volatile char c;
302
303    c = __nss_freebl_rcsid[0] + __nss_freebl_sccsid[0]; 
304#ifdef FREEBL_NO_DEPEND
305    FREEBL_InitStubs();
306#endif
307    return &vector;
308}
309