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