security/nss/lib/freebl/loader.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/lib/freebl/loader.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,724 @@
     1.4 +/*
     1.5 + * loader.h - load platform dependent DSO containing freebl implementation.
     1.6 + *
     1.7 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    1.10 +
    1.11 +#ifndef _LOADER_H_
    1.12 +#define _LOADER_H_ 1
    1.13 +
    1.14 +#include "blapi.h"
    1.15 +
    1.16 +#define FREEBL_VERSION 0x0311
    1.17 +
    1.18 +struct FREEBLVectorStr {
    1.19 +
    1.20 +  unsigned short length;  /* of this struct in bytes */
    1.21 +  unsigned short version; /* of this struct. */
    1.22 +
    1.23 +  RSAPrivateKey * (* p_RSA_NewKey)(int         keySizeInBits,
    1.24 +				 SECItem *   publicExponent);
    1.25 +
    1.26 +  SECStatus (* p_RSA_PublicKeyOp) (RSAPublicKey *   key,
    1.27 +				 unsigned char *  output,
    1.28 +				 const unsigned char *  input);
    1.29 +
    1.30 +  SECStatus (* p_RSA_PrivateKeyOp)(RSAPrivateKey *  key,
    1.31 +				  unsigned char *  output,
    1.32 +				  const unsigned char *  input);
    1.33 +
    1.34 +  SECStatus (* p_DSA_NewKey)(const PQGParams *    params, 
    1.35 +		            DSAPrivateKey **      privKey);
    1.36 +
    1.37 +  SECStatus (* p_DSA_SignDigest)(DSAPrivateKey *   key,
    1.38 +				SECItem *         signature,
    1.39 +				const SECItem *   digest);
    1.40 +
    1.41 +  SECStatus (* p_DSA_VerifyDigest)(DSAPublicKey *  key,
    1.42 +				  const SECItem *  signature,
    1.43 +				  const SECItem *  digest);
    1.44 +
    1.45 +  SECStatus (* p_DSA_NewKeyFromSeed)(const PQGParams *params, 
    1.46 +				     const unsigned char * seed,
    1.47 +                                     DSAPrivateKey **privKey);
    1.48 +
    1.49 +  SECStatus (* p_DSA_SignDigestWithSeed)(DSAPrivateKey * key,
    1.50 +				        SECItem *             signature,
    1.51 +				        const SECItem *       digest,
    1.52 +				        const unsigned char * seed);
    1.53 +
    1.54 + SECStatus (* p_DH_GenParam)(int primeLen, DHParams ** params);
    1.55 +
    1.56 + SECStatus (* p_DH_NewKey)(DHParams *           params, 
    1.57 +                           DHPrivateKey **	privKey);
    1.58 +
    1.59 + SECStatus (* p_DH_Derive)(SECItem *    publicValue, 
    1.60 +		           SECItem *    prime, 
    1.61 +			   SECItem *    privateValue, 
    1.62 +			   SECItem *    derivedSecret,
    1.63 +			   unsigned int maxOutBytes);
    1.64 +
    1.65 + SECStatus (* p_KEA_Derive)(SECItem *prime, 
    1.66 +                            SECItem *public1, 
    1.67 +                            SECItem *public2, 
    1.68 +			    SECItem *private1, 
    1.69 +			    SECItem *private2,
    1.70 +			    SECItem *derivedSecret);
    1.71 +
    1.72 + PRBool (* p_KEA_Verify)(SECItem *Y, SECItem *prime, SECItem *subPrime);
    1.73 +
    1.74 + RC4Context * (* p_RC4_CreateContext)(const unsigned char *key, int len);
    1.75 +
    1.76 + void (* p_RC4_DestroyContext)(RC4Context *cx, PRBool freeit);
    1.77 +
    1.78 + SECStatus (* p_RC4_Encrypt)(RC4Context *cx, unsigned char *output,
    1.79 +			    unsigned int *outputLen, unsigned int maxOutputLen,
    1.80 +			    const unsigned char *input, unsigned int inputLen);
    1.81 +
    1.82 + SECStatus (* p_RC4_Decrypt)(RC4Context *cx, unsigned char *output,
    1.83 +			    unsigned int *outputLen, unsigned int maxOutputLen,
    1.84 +			    const unsigned char *input, unsigned int inputLen);
    1.85 +
    1.86 + RC2Context * (* p_RC2_CreateContext)(const unsigned char *key, 
    1.87 +                     unsigned int len, const unsigned char *iv, 
    1.88 +		     int mode, unsigned effectiveKeyLen);
    1.89 +
    1.90 + void (* p_RC2_DestroyContext)(RC2Context *cx, PRBool freeit);
    1.91 +
    1.92 + SECStatus (* p_RC2_Encrypt)(RC2Context *cx, unsigned char *output,
    1.93 +			    unsigned int *outputLen, unsigned int maxOutputLen,
    1.94 +			    const unsigned char *input, unsigned int inputLen);
    1.95 +
    1.96 + SECStatus (* p_RC2_Decrypt)(RC2Context *cx, unsigned char *output,
    1.97 +			    unsigned int *outputLen, unsigned int maxOutputLen,
    1.98 +			    const unsigned char *input, unsigned int inputLen);
    1.99 +
   1.100 + RC5Context *(* p_RC5_CreateContext)(const SECItem *key, unsigned int rounds,
   1.101 +                     unsigned int wordSize, const unsigned char *iv, int mode);
   1.102 +
   1.103 + void (* p_RC5_DestroyContext)(RC5Context *cx, PRBool freeit);
   1.104 +
   1.105 + SECStatus (* p_RC5_Encrypt)(RC5Context *cx, unsigned char *output,
   1.106 +                            unsigned int *outputLen, unsigned int maxOutputLen,
   1.107 +                            const unsigned char *input, unsigned int inputLen);
   1.108 +
   1.109 + SECStatus (* p_RC5_Decrypt)(RC5Context *cx, unsigned char *output,
   1.110 +                            unsigned int *outputLen, unsigned int maxOutputLen,
   1.111 +                            const unsigned char *input, unsigned int inputLen);
   1.112 +
   1.113 + DESContext *(* p_DES_CreateContext)(const unsigned char *key, 
   1.114 +                                     const unsigned char *iv,
   1.115 +				     int mode, PRBool encrypt);
   1.116 +
   1.117 + void (* p_DES_DestroyContext)(DESContext *cx, PRBool freeit);
   1.118 +
   1.119 + SECStatus (* p_DES_Encrypt)(DESContext *cx, unsigned char *output,
   1.120 +			    unsigned int *outputLen, unsigned int maxOutputLen,
   1.121 +			    const unsigned char *input, unsigned int inputLen);
   1.122 +
   1.123 + SECStatus (* p_DES_Decrypt)(DESContext *cx, unsigned char *output,
   1.124 +			    unsigned int *outputLen, unsigned int maxOutputLen,
   1.125 +			    const unsigned char *input, unsigned int inputLen);
   1.126 +
   1.127 + AESContext * (* p_AES_CreateContext)(const unsigned char *key, 
   1.128 +                            const unsigned char *iv, 
   1.129 +			    int mode, int encrypt, unsigned int keylen, 
   1.130 +			    unsigned int blocklen);
   1.131 +
   1.132 + void (* p_AES_DestroyContext)(AESContext *cx, PRBool freeit);
   1.133 +
   1.134 + SECStatus (* p_AES_Encrypt)(AESContext *cx, unsigned char *output,
   1.135 +			    unsigned int *outputLen, unsigned int maxOutputLen,
   1.136 +			    const unsigned char *input, unsigned int inputLen);
   1.137 +
   1.138 + SECStatus (* p_AES_Decrypt)(AESContext *cx, unsigned char *output,
   1.139 +			    unsigned int *outputLen, unsigned int maxOutputLen,
   1.140 +			    const unsigned char *input, unsigned int inputLen);
   1.141 +
   1.142 + SECStatus (* p_MD5_Hash)(unsigned char *dest, const char *src);
   1.143 +
   1.144 + SECStatus (* p_MD5_HashBuf)(unsigned char *dest, const unsigned char *src,
   1.145 +			     PRUint32 src_length);
   1.146 +
   1.147 + MD5Context *(* p_MD5_NewContext)(void);
   1.148 +
   1.149 + void (* p_MD5_DestroyContext)(MD5Context *cx, PRBool freeit);
   1.150 +
   1.151 + void (* p_MD5_Begin)(MD5Context *cx);
   1.152 +
   1.153 + void (* p_MD5_Update)(MD5Context *cx,
   1.154 +		       const unsigned char *input, unsigned int inputLen);
   1.155 +
   1.156 + void (* p_MD5_End)(MD5Context *cx, unsigned char *digest,
   1.157 +		    unsigned int *digestLen, unsigned int maxDigestLen);
   1.158 +
   1.159 + unsigned int (* p_MD5_FlattenSize)(MD5Context *cx);
   1.160 +
   1.161 + SECStatus (* p_MD5_Flatten)(MD5Context *cx,unsigned char *space);
   1.162 +
   1.163 + MD5Context * (* p_MD5_Resurrect)(unsigned char *space, void *arg);
   1.164 +
   1.165 + void (* p_MD5_TraceState)(MD5Context *cx);
   1.166 +
   1.167 + SECStatus (* p_MD2_Hash)(unsigned char *dest, const char *src);
   1.168 +
   1.169 + MD2Context *(* p_MD2_NewContext)(void);
   1.170 +
   1.171 + void (* p_MD2_DestroyContext)(MD2Context *cx, PRBool freeit);
   1.172 +
   1.173 + void (* p_MD2_Begin)(MD2Context *cx);
   1.174 +
   1.175 + void (* p_MD2_Update)(MD2Context *cx,
   1.176 +		       const unsigned char *input, unsigned int inputLen);
   1.177 +
   1.178 + void (* p_MD2_End)(MD2Context *cx, unsigned char *digest,
   1.179 +		    unsigned int *digestLen, unsigned int maxDigestLen);
   1.180 +
   1.181 + unsigned int (* p_MD2_FlattenSize)(MD2Context *cx);
   1.182 +
   1.183 + SECStatus (* p_MD2_Flatten)(MD2Context *cx,unsigned char *space);
   1.184 +
   1.185 + MD2Context * (* p_MD2_Resurrect)(unsigned char *space, void *arg);
   1.186 +
   1.187 + SECStatus (* p_SHA1_Hash)(unsigned char *dest, const char *src);
   1.188 +
   1.189 + SECStatus (* p_SHA1_HashBuf)(unsigned char *dest, const unsigned char *src,
   1.190 +			      PRUint32 src_length);
   1.191 +
   1.192 + SHA1Context *(* p_SHA1_NewContext)(void);
   1.193 +
   1.194 + void (* p_SHA1_DestroyContext)(SHA1Context *cx, PRBool freeit);
   1.195 +
   1.196 + void (* p_SHA1_Begin)(SHA1Context *cx);
   1.197 +
   1.198 + void (* p_SHA1_Update)(SHA1Context *cx, const unsigned char *input,
   1.199 +			unsigned int inputLen);
   1.200 +
   1.201 + void (* p_SHA1_End)(SHA1Context *cx, unsigned char *digest,
   1.202 +		     unsigned int *digestLen, unsigned int maxDigestLen);
   1.203 +
   1.204 + void (* p_SHA1_TraceState)(SHA1Context *cx);
   1.205 +
   1.206 + unsigned int (* p_SHA1_FlattenSize)(SHA1Context *cx);
   1.207 +
   1.208 + SECStatus (* p_SHA1_Flatten)(SHA1Context *cx,unsigned char *space);
   1.209 +
   1.210 + SHA1Context * (* p_SHA1_Resurrect)(unsigned char *space, void *arg);
   1.211 +
   1.212 + SECStatus (* p_RNG_RNGInit)(void);
   1.213 +
   1.214 + SECStatus (* p_RNG_RandomUpdate)(const void *data, size_t bytes);
   1.215 +
   1.216 + SECStatus (* p_RNG_GenerateGlobalRandomBytes)(void *dest, size_t len);
   1.217 +
   1.218 + void  (* p_RNG_RNGShutdown)(void);
   1.219 +
   1.220 + SECStatus (* p_PQG_ParamGen)(unsigned int j, PQGParams **pParams,  
   1.221 +	                      PQGVerify **pVfy);    
   1.222 +
   1.223 + SECStatus (* p_PQG_ParamGenSeedLen)( unsigned int j, unsigned int seedBytes, 
   1.224 +                                     PQGParams **pParams, PQGVerify **pVfy); 
   1.225 +
   1.226 + SECStatus (* p_PQG_VerifyParams)(const PQGParams *params, 
   1.227 +                                  const PQGVerify *vfy, SECStatus *result);
   1.228 +
   1.229 +  /* Version 3.001 came to here */
   1.230 +
   1.231 +  SECStatus (* p_RSA_PrivateKeyOpDoubleChecked)(RSAPrivateKey *key,
   1.232 +                              unsigned char *output,
   1.233 +                              const unsigned char *input);
   1.234 +
   1.235 +  SECStatus (* p_RSA_PrivateKeyCheck)(const RSAPrivateKey *key);
   1.236 +
   1.237 +  void (* p_BL_Cleanup)(void);
   1.238 +
   1.239 +  /* Version 3.002 came to here */
   1.240 +
   1.241 + SHA256Context *(* p_SHA256_NewContext)(void);
   1.242 + void (* p_SHA256_DestroyContext)(SHA256Context *cx, PRBool freeit);
   1.243 + void (* p_SHA256_Begin)(SHA256Context *cx);
   1.244 + void (* p_SHA256_Update)(SHA256Context *cx, const unsigned char *input,
   1.245 +			unsigned int inputLen);
   1.246 + void (* p_SHA256_End)(SHA256Context *cx, unsigned char *digest,
   1.247 +		     unsigned int *digestLen, unsigned int maxDigestLen);
   1.248 + SECStatus (* p_SHA256_HashBuf)(unsigned char *dest, const unsigned char *src,
   1.249 +				PRUint32 src_length);
   1.250 + SECStatus (* p_SHA256_Hash)(unsigned char *dest, const char *src);
   1.251 + void (* p_SHA256_TraceState)(SHA256Context *cx);
   1.252 + unsigned int (* p_SHA256_FlattenSize)(SHA256Context *cx);
   1.253 + SECStatus (* p_SHA256_Flatten)(SHA256Context *cx,unsigned char *space);
   1.254 + SHA256Context * (* p_SHA256_Resurrect)(unsigned char *space, void *arg);
   1.255 +
   1.256 + SHA512Context *(* p_SHA512_NewContext)(void);
   1.257 + void (* p_SHA512_DestroyContext)(SHA512Context *cx, PRBool freeit);
   1.258 + void (* p_SHA512_Begin)(SHA512Context *cx);
   1.259 + void (* p_SHA512_Update)(SHA512Context *cx, const unsigned char *input,
   1.260 +			unsigned int inputLen);
   1.261 + void (* p_SHA512_End)(SHA512Context *cx, unsigned char *digest,
   1.262 +		     unsigned int *digestLen, unsigned int maxDigestLen);
   1.263 + SECStatus (* p_SHA512_HashBuf)(unsigned char *dest, const unsigned char *src,
   1.264 +				PRUint32 src_length);
   1.265 + SECStatus (* p_SHA512_Hash)(unsigned char *dest, const char *src);
   1.266 + void (* p_SHA512_TraceState)(SHA512Context *cx);
   1.267 + unsigned int (* p_SHA512_FlattenSize)(SHA512Context *cx);
   1.268 + SECStatus (* p_SHA512_Flatten)(SHA512Context *cx,unsigned char *space);
   1.269 + SHA512Context * (* p_SHA512_Resurrect)(unsigned char *space, void *arg);
   1.270 +
   1.271 + SHA384Context *(* p_SHA384_NewContext)(void);
   1.272 + void (* p_SHA384_DestroyContext)(SHA384Context *cx, PRBool freeit);
   1.273 + void (* p_SHA384_Begin)(SHA384Context *cx);
   1.274 + void (* p_SHA384_Update)(SHA384Context *cx, const unsigned char *input,
   1.275 +			unsigned int inputLen);
   1.276 + void (* p_SHA384_End)(SHA384Context *cx, unsigned char *digest,
   1.277 +		     unsigned int *digestLen, unsigned int maxDigestLen);
   1.278 + SECStatus (* p_SHA384_HashBuf)(unsigned char *dest, const unsigned char *src,
   1.279 +				PRUint32 src_length);
   1.280 + SECStatus (* p_SHA384_Hash)(unsigned char *dest, const char *src);
   1.281 + void (* p_SHA384_TraceState)(SHA384Context *cx);
   1.282 + unsigned int (* p_SHA384_FlattenSize)(SHA384Context *cx);
   1.283 + SECStatus (* p_SHA384_Flatten)(SHA384Context *cx,unsigned char *space);
   1.284 + SHA384Context * (* p_SHA384_Resurrect)(unsigned char *space, void *arg);
   1.285 +
   1.286 +  /* Version 3.003 came to here */
   1.287 +
   1.288 + AESKeyWrapContext * (* p_AESKeyWrap_CreateContext)(const unsigned char *key, 
   1.289 +                   const unsigned char *iv, int encrypt, unsigned int keylen);
   1.290 +
   1.291 + void (* p_AESKeyWrap_DestroyContext)(AESKeyWrapContext *cx, PRBool freeit);
   1.292 +
   1.293 + SECStatus (* p_AESKeyWrap_Encrypt)(AESKeyWrapContext *cx, 
   1.294 +            unsigned char *output,
   1.295 +            unsigned int *outputLen, unsigned int maxOutputLen,
   1.296 +            const unsigned char *input, unsigned int inputLen);
   1.297 +
   1.298 + SECStatus (* p_AESKeyWrap_Decrypt)(AESKeyWrapContext *cx, 
   1.299 +            unsigned char *output,
   1.300 +            unsigned int *outputLen, unsigned int maxOutputLen,
   1.301 +            const unsigned char *input, unsigned int inputLen);
   1.302 +
   1.303 +  /* Version 3.004 came to here */
   1.304 +
   1.305 + PRBool (*p_BLAPI_SHVerify)(const char *name, PRFuncPtr addr);
   1.306 + PRBool (*p_BLAPI_VerifySelf)(const char *name);
   1.307 +
   1.308 +  /* Version 3.005 came to here */
   1.309 +
   1.310 + SECStatus (* p_EC_NewKey)(ECParams *           params, 
   1.311 +                           ECPrivateKey **	privKey);
   1.312 +
   1.313 + SECStatus (* p_EC_NewKeyFromSeed)(ECParams *   params, 
   1.314 +                             ECPrivateKey **	privKey,
   1.315 +                             const unsigned char * seed,
   1.316 +                             int                seedlen);
   1.317 +
   1.318 + SECStatus (* p_EC_ValidatePublicKey)(ECParams *   params, 
   1.319 +			     SECItem *	        publicValue);
   1.320 +
   1.321 + SECStatus (* p_ECDH_Derive)(SECItem *          publicValue, 
   1.322 +                             ECParams *         params,
   1.323 +                             SECItem *          privateValue,
   1.324 +                             PRBool             withCofactor,
   1.325 +                             SECItem *          derivedSecret);
   1.326 +
   1.327 + SECStatus (* p_ECDSA_SignDigest)(ECPrivateKey * key,
   1.328 +                             SECItem *          signature,
   1.329 +                             const SECItem *    digest);
   1.330 +
   1.331 + SECStatus (* p_ECDSA_VerifyDigest)(ECPublicKey * key,
   1.332 +                             const SECItem *    signature,
   1.333 +                             const SECItem *    digest);
   1.334 +
   1.335 + SECStatus (* p_ECDSA_SignDigestWithSeed)(ECPrivateKey * key,
   1.336 +                             SECItem *          signature,
   1.337 +                             const SECItem *    digest,
   1.338 +                             const unsigned char * seed,
   1.339 +                             const int          seedlen);
   1.340 +
   1.341 +  /* Version 3.006 came to here */
   1.342 +
   1.343 +  /* no modification to FREEBLVectorStr itself 
   1.344 +   * but ECParamStr was modified 
   1.345 +   */
   1.346 +
   1.347 +  /* Version 3.007 came to here */
   1.348 +
   1.349 + SECStatus (* p_AES_InitContext)(AESContext *cx,
   1.350 +				 const unsigned char *key, 
   1.351 +				 unsigned int keylen, 
   1.352 +				 const unsigned char *iv, 
   1.353 +				 int mode, 
   1.354 +				 unsigned int encrypt,
   1.355 +				 unsigned int blocklen);
   1.356 + SECStatus (* p_AESKeyWrap_InitContext)(AESKeyWrapContext *cx,
   1.357 +				 const unsigned char *key, 
   1.358 +				 unsigned int keylen, 
   1.359 +				 const unsigned char *iv, 
   1.360 +				 int mode, 
   1.361 +				 unsigned int encrypt,
   1.362 +				 unsigned int blocklen);
   1.363 + SECStatus (* p_DES_InitContext)(DESContext *cx,
   1.364 +				 const unsigned char *key, 
   1.365 +				 unsigned int keylen,
   1.366 +				 const unsigned char *iv, 
   1.367 +				 int mode,
   1.368 +				 unsigned int encrypt,
   1.369 +				 unsigned int );
   1.370 + SECStatus (* p_RC2_InitContext)(RC2Context *cx,
   1.371 +				 const unsigned char *key, 
   1.372 +				 unsigned int keylen,
   1.373 +				 const unsigned char *iv, 
   1.374 +				 int mode, 
   1.375 +				 unsigned int effectiveKeyLen,
   1.376 +				 unsigned int );
   1.377 + SECStatus (* p_RC4_InitContext)(RC4Context *cx, 
   1.378 +				 const unsigned char *key, 
   1.379 +				 unsigned int keylen,
   1.380 +				 const unsigned char *, 
   1.381 +				 int, 
   1.382 +				 unsigned int ,
   1.383 +				 unsigned int );
   1.384 +
   1.385 + AESContext *(*p_AES_AllocateContext)(void);
   1.386 + AESKeyWrapContext *(*p_AESKeyWrap_AllocateContext)(void);
   1.387 + DESContext *(*p_DES_AllocateContext)(void);
   1.388 + RC2Context *(*p_RC2_AllocateContext)(void);
   1.389 + RC4Context *(*p_RC4_AllocateContext)(void);
   1.390 +
   1.391 + void (* p_MD2_Clone)(MD2Context *dest, MD2Context *src);
   1.392 + void (* p_MD5_Clone)(MD5Context *dest, MD5Context *src);
   1.393 + void (* p_SHA1_Clone)(SHA1Context *dest, SHA1Context *src);
   1.394 + void (* p_SHA256_Clone)(SHA256Context *dest, SHA256Context *src);
   1.395 + void (* p_SHA384_Clone)(SHA384Context *dest, SHA384Context *src);
   1.396 + void (* p_SHA512_Clone)(SHA512Context *dest, SHA512Context *src);
   1.397 +
   1.398 + SECStatus (* p_TLS_PRF)(const SECItem *secret, const char *label, 
   1.399 +		         SECItem *seed, SECItem *result, PRBool isFIPS);
   1.400 +
   1.401 + const SECHashObject *(* p_HASH_GetRawHashObject)(HASH_HashType hashType);
   1.402 +
   1.403 + HMACContext * (* p_HMAC_Create)(const SECHashObject *hashObj, 
   1.404 +				 const unsigned char *secret, 
   1.405 +				 unsigned int secret_len, PRBool isFIPS);
   1.406 + SECStatus (* p_HMAC_Init)(HMACContext *cx, const SECHashObject *hash_obj, 
   1.407 +			   const unsigned char *secret, 
   1.408 +			   unsigned int secret_len, PRBool isFIPS);
   1.409 + void (* p_HMAC_Begin)(HMACContext *cx);
   1.410 + void  (* p_HMAC_Update)(HMACContext *cx, const unsigned char *data, 
   1.411 +			 unsigned int data_len);
   1.412 + HMACContext * (* p_HMAC_Clone)(HMACContext *cx);
   1.413 + SECStatus (* p_HMAC_Finish)(HMACContext *cx, unsigned char *result, 
   1.414 +			     unsigned int *result_len, 
   1.415 +			     unsigned int max_result_len);
   1.416 + void (* p_HMAC_Destroy)(HMACContext *cx, PRBool freeit);
   1.417 +
   1.418 + void (* p_RNG_SystemInfoForRNG)(void);
   1.419 +
   1.420 +  /* Version 3.008 came to here */
   1.421 +
   1.422 + SECStatus (* p_FIPS186Change_GenerateX)(unsigned char *XKEY,
   1.423 +                                         const unsigned char *XSEEDj,
   1.424 +                                         unsigned char *x_j);
   1.425 + SECStatus (* p_FIPS186Change_ReduceModQForDSA)(const unsigned char *w,
   1.426 +                                                const unsigned char *q,
   1.427 +                                                unsigned char *xj);
   1.428 +
   1.429 +  /* Version 3.009 came to here */
   1.430 +
   1.431 + SECStatus (* p_Camellia_InitContext)(CamelliaContext *cx,
   1.432 +				 const unsigned char *key, 
   1.433 +				 unsigned int keylen, 
   1.434 +				 const unsigned char *iv, 
   1.435 +				 int mode, 
   1.436 +				 unsigned int encrypt,
   1.437 +				 unsigned int unused);
   1.438 +
   1.439 + CamelliaContext *(*p_Camellia_AllocateContext)(void);
   1.440 + CamelliaContext * (* p_Camellia_CreateContext)(const unsigned char *key, 
   1.441 +						const unsigned char *iv, 
   1.442 +						int mode, int encrypt,
   1.443 +						unsigned int keylen);
   1.444 + void (* p_Camellia_DestroyContext)(CamelliaContext *cx, PRBool freeit);
   1.445 +
   1.446 + SECStatus (* p_Camellia_Encrypt)(CamelliaContext *cx, unsigned char *output,
   1.447 +				  unsigned int *outputLen,
   1.448 +				  unsigned int maxOutputLen,
   1.449 +				  const unsigned char *input,
   1.450 +				  unsigned int inputLen);
   1.451 +
   1.452 + SECStatus (* p_Camellia_Decrypt)(CamelliaContext *cx, unsigned char *output,
   1.453 +				  unsigned int *outputLen,
   1.454 +				  unsigned int maxOutputLen,
   1.455 +				  const unsigned char *input,
   1.456 +				  unsigned int inputLen);
   1.457 +
   1.458 + void (* p_PQG_DestroyParams)(PQGParams *params);
   1.459 +
   1.460 + void (* p_PQG_DestroyVerify)(PQGVerify *vfy);
   1.461 +
   1.462 +  /* Version 3.010 came to here */
   1.463 +
   1.464 + SECStatus (* p_SEED_InitContext)(SEEDContext *cx,
   1.465 +                                 const unsigned char *key,
   1.466 +                                 unsigned int keylen,
   1.467 +                                 const unsigned char *iv,
   1.468 +                                 int mode,
   1.469 +                                 unsigned int encrypt,
   1.470 +                                 unsigned int );
   1.471 +
   1.472 + SEEDContext *(*p_SEED_AllocateContext)(void);
   1.473 +
   1.474 + SEEDContext *(* p_SEED_CreateContext)(const unsigned char *key,
   1.475 +                                     const unsigned char *iv,
   1.476 +                                     int mode, PRBool encrypt);
   1.477 +
   1.478 + void (* p_SEED_DestroyContext)(SEEDContext *cx, PRBool freeit);
   1.479 +
   1.480 + SECStatus (* p_SEED_Encrypt)(SEEDContext *cx, unsigned char *output,
   1.481 +                            unsigned int *outputLen, unsigned int maxOutputLen,
   1.482 +                            const unsigned char *input, unsigned int inputLen);
   1.483 +
   1.484 + SECStatus (* p_SEED_Decrypt)(SEEDContext *cx, unsigned char *output,
   1.485 +                            unsigned int *outputLen, unsigned int maxOutputLen,
   1.486 +                            const unsigned char *input, unsigned int inputLen);
   1.487 +
   1.488 +
   1.489 +
   1.490 + SECStatus (* p_BL_Init)(void);
   1.491 + void ( * p_BL_SetForkState)(PRBool);
   1.492 +
   1.493 + SECStatus (* p_PRNGTEST_Instantiate)(const PRUint8 *entropy, 
   1.494 +				      unsigned int entropy_len, 
   1.495 +				      const PRUint8 *nonce, 
   1.496 +				      unsigned int nonce_len,
   1.497 +				      const PRUint8 *personal_string, 
   1.498 +				      unsigned int ps_len);
   1.499 +
   1.500 + SECStatus (* p_PRNGTEST_Reseed)(const PRUint8 *entropy, 
   1.501 +				 unsigned int entropy_len, 
   1.502 +				 const PRUint8 *additional, 
   1.503 +				 unsigned int additional_len);
   1.504 +
   1.505 + SECStatus (* p_PRNGTEST_Generate)(PRUint8 *bytes, 
   1.506 +				   unsigned int bytes_len, 
   1.507 +				   const PRUint8 *additional, 
   1.508 +				   unsigned int additional_len);
   1.509 +
   1.510 + SECStatus (* p_PRNGTEST_Uninstantiate)(void);
   1.511 +   /* Version 3.011 came to here */
   1.512 +
   1.513 + SECStatus (*p_RSA_PopulatePrivateKey)(RSAPrivateKey *key);
   1.514 +
   1.515 + SECStatus (*p_DSA_NewRandom)(PLArenaPool * arena, const SECItem * q,
   1.516 +                              SECItem * seed);
   1.517 +
   1.518 + SECStatus (*p_JPAKE_Sign)(PLArenaPool * arena, const PQGParams * pqg,
   1.519 +                           HASH_HashType hashType, const SECItem * signerID,
   1.520 +                           const SECItem * x, const SECItem * testRandom,
   1.521 +                           const SECItem * gxIn, SECItem * gxOut,
   1.522 +                           SECItem * gv, SECItem * r);
   1.523 +
   1.524 + SECStatus (*p_JPAKE_Verify)(PLArenaPool * arena, const PQGParams * pqg,
   1.525 +                             HASH_HashType hashType, const SECItem * signerID,
   1.526 +                             const SECItem * peerID, const SECItem * gx,
   1.527 +                             const SECItem * gv, const SECItem * r);
   1.528 +
   1.529 + SECStatus (*p_JPAKE_Round2)(PLArenaPool * arena, const SECItem * p,
   1.530 +                             const SECItem  *q, const SECItem * gx1,
   1.531 +                             const SECItem * gx3, const SECItem * gx4,
   1.532 +                             SECItem * base, const SECItem * x2,
   1.533 +                             const SECItem * s, SECItem * x2s);
   1.534 +
   1.535 + SECStatus (*p_JPAKE_Final)(PLArenaPool * arena, const SECItem * p,
   1.536 +                            const SECItem  *q, const SECItem * x2,
   1.537 +                            const SECItem * gx4, const SECItem * x2s,
   1.538 +                            const SECItem * B, SECItem * K);
   1.539 +
   1.540 +  /* Version 3.012 came to here */
   1.541 +
   1.542 + SECStatus (* p_TLS_P_hash)(HASH_HashType hashAlg,
   1.543 +                            const SECItem *secret,
   1.544 +                            const char *label,
   1.545 +                            SECItem *seed,
   1.546 +                            SECItem *result,
   1.547 +                            PRBool isFIPS);
   1.548 +
   1.549 + SHA224Context *(*p_SHA224_NewContext)(void);
   1.550 + void (* p_SHA224_DestroyContext)(SHA224Context *cx, PRBool freeit);
   1.551 + void (* p_SHA224_Begin)(SHA224Context *cx);
   1.552 + void (* p_SHA224_Update)(SHA224Context *cx, const unsigned char *input,
   1.553 +			unsigned int inputLen);
   1.554 + void (* p_SHA224_End)(SHA224Context *cx, unsigned char *digest,
   1.555 +		     unsigned int *digestLen, unsigned int maxDigestLen);
   1.556 + SECStatus (*p_SHA224_HashBuf)(unsigned char *dest, const unsigned char *src,
   1.557 +			       PRUint32 src_length);
   1.558 + SECStatus (*p_SHA224_Hash)(unsigned char *dest, const char *src);
   1.559 + void (*p_SHA224_TraceState)(SHA224Context *cx);
   1.560 + unsigned int (* p_SHA224_FlattenSize)(SHA224Context *cx);
   1.561 + SECStatus (* p_SHA224_Flatten)(SHA224Context *cx,unsigned char *space);
   1.562 + SHA224Context * (* p_SHA224_Resurrect)(unsigned char *space, void *arg);
   1.563 + void (* p_SHA224_Clone)(SHA224Context *dest, SHA224Context *src);
   1.564 + PRBool (*p_BLAPI_SHVerifyFile)(const char *name);
   1.565 +
   1.566 +  /* Version 3.013 came to here */
   1.567 +
   1.568 + SECStatus (* p_PQG_ParamGenV2)( unsigned int L, unsigned int N,
   1.569 +                                unsigned int seedBytes, 
   1.570 +                                PQGParams **pParams, PQGVerify **pVfy); 
   1.571 + SECStatus (*p_PRNGTEST_RunHealthTests)(void);
   1.572 +
   1.573 +  /* Version 3.014 came to here */
   1.574 +
   1.575 + SECStatus (* p_HMAC_ConstantTime)(
   1.576 +     unsigned char *result,
   1.577 +     unsigned int *resultLen,
   1.578 +     unsigned int maxResultLen,
   1.579 +     const SECHashObject *hashObj,
   1.580 +     const unsigned char *secret,
   1.581 +     unsigned int secretLen,
   1.582 +     const unsigned char *header,
   1.583 +     unsigned int headerLen,
   1.584 +     const unsigned char *body,
   1.585 +     unsigned int bodyLen,
   1.586 +     unsigned int bodyTotalLen);
   1.587 +
   1.588 + SECStatus (* p_SSLv3_MAC_ConstantTime)(
   1.589 +     unsigned char *result,
   1.590 +     unsigned int *resultLen,
   1.591 +     unsigned int maxResultLen,
   1.592 +     const SECHashObject *hashObj,
   1.593 +     const unsigned char *secret,
   1.594 +     unsigned int secretLen,
   1.595 +     const unsigned char *header,
   1.596 +     unsigned int headerLen,
   1.597 +     const unsigned char *body,
   1.598 +     unsigned int bodyLen,
   1.599 +     unsigned int bodyTotalLen);
   1.600 +
   1.601 +  /* Version 3.015 came to here */
   1.602 +
   1.603 + SECStatus (* p_RSA_SignRaw)(RSAPrivateKey *key,
   1.604 +                             unsigned char *output,
   1.605 +                             unsigned int *outputLen,
   1.606 +                             unsigned int maxOutputLen,
   1.607 +                             const unsigned char *input,
   1.608 +                             unsigned int inputLen);
   1.609 + SECStatus (* p_RSA_CheckSignRaw)(RSAPublicKey *key,
   1.610 +                                  const unsigned char *sig,
   1.611 +                                  unsigned int sigLen,
   1.612 +                                  const unsigned char *hash,
   1.613 +                                  unsigned int hashLen);
   1.614 + SECStatus (* p_RSA_CheckSignRecoverRaw)(RSAPublicKey *key,
   1.615 +                                         unsigned char *data,
   1.616 +                                         unsigned int *dataLen,
   1.617 +                                         unsigned int maxDataLen,
   1.618 +                                         const unsigned char *sig,
   1.619 +                                         unsigned int sigLen);
   1.620 + SECStatus (* p_RSA_EncryptRaw)(RSAPublicKey *key,
   1.621 +                                unsigned char *output,
   1.622 +                                unsigned int *outputLen,
   1.623 +                                unsigned int maxOutputLen,
   1.624 +                                const unsigned char *input,
   1.625 +                                unsigned int inputLen);
   1.626 + SECStatus (* p_RSA_DecryptRaw)(RSAPrivateKey *key,
   1.627 +                                unsigned char *output,
   1.628 +                                unsigned int *outputLen,
   1.629 +                                unsigned int maxOutputLen,
   1.630 +                                const unsigned char *input,
   1.631 +                                unsigned int inputLen);
   1.632 + SECStatus (* p_RSA_EncryptOAEP)(RSAPublicKey *key,
   1.633 +                                 HASH_HashType hashAlg,
   1.634 +                                 HASH_HashType maskHashAlg,
   1.635 +                                 const unsigned char *label,
   1.636 +                                 unsigned int labelLen,
   1.637 +                                 const unsigned char *seed,
   1.638 +                                 unsigned int seedLen,
   1.639 +                                 unsigned char *output,
   1.640 +                                 unsigned int *outputLen,
   1.641 +                                 unsigned int maxOutputLen,
   1.642 +                                 const unsigned char *input,
   1.643 +                                 unsigned int inputLen);
   1.644 + SECStatus (* p_RSA_DecryptOAEP)(RSAPrivateKey *key,
   1.645 +                                 HASH_HashType hashAlg,
   1.646 +                                 HASH_HashType maskHashAlg,
   1.647 +                                 const unsigned char *label,
   1.648 +                                 unsigned int labelLen,
   1.649 +                                 unsigned char *output,
   1.650 +                                 unsigned int *outputLen,
   1.651 +                                 unsigned int maxOutputLen,
   1.652 +                                 const unsigned char *input,
   1.653 +                                 unsigned int inputLen);
   1.654 + SECStatus (* p_RSA_EncryptBlock)(RSAPublicKey *key,
   1.655 +                                  unsigned char *output,
   1.656 +                                  unsigned int *outputLen,
   1.657 +                                  unsigned int maxOutputLen,
   1.658 +                                  const unsigned char *input,
   1.659 +                                  unsigned int inputLen);
   1.660 + SECStatus (* p_RSA_DecryptBlock)(RSAPrivateKey *key,
   1.661 +                                  unsigned char *output,
   1.662 +                                  unsigned int *outputLen,
   1.663 +                                  unsigned int maxOutputLen,
   1.664 +                                  const unsigned char *input,
   1.665 +                                  unsigned int inputLen);
   1.666 + SECStatus (* p_RSA_SignPSS)(RSAPrivateKey *key,
   1.667 +                             HASH_HashType hashAlg,
   1.668 +                             HASH_HashType maskHashAlg,
   1.669 +                             const unsigned char *salt,
   1.670 +                             unsigned int saltLen,
   1.671 +                             unsigned char *output,
   1.672 +                             unsigned int *outputLen,
   1.673 +                             unsigned int maxOutputLen,
   1.674 +                             const unsigned char *input,
   1.675 +                             unsigned int inputLen);
   1.676 + SECStatus (* p_RSA_CheckSignPSS)(RSAPublicKey *key,
   1.677 +                                  HASH_HashType hashAlg,
   1.678 +                                  HASH_HashType maskHashAlg,
   1.679 +                                  unsigned int saltLen,
   1.680 +                                  const unsigned char *sig,
   1.681 +                                  unsigned int sigLen,
   1.682 +                                  const unsigned char *hash,
   1.683 +                                  unsigned int hashLen);
   1.684 + SECStatus (* p_RSA_Sign)(RSAPrivateKey *key,
   1.685 +                          unsigned char *output,
   1.686 +                          unsigned int *outputLen,
   1.687 +                          unsigned int maxOutputLen,
   1.688 +                          const unsigned char *input,
   1.689 +                          unsigned int inputLen);
   1.690 + SECStatus (* p_RSA_CheckSign)(RSAPublicKey *key,
   1.691 +                               const unsigned char *sig,
   1.692 +                               unsigned int sigLen,
   1.693 +                               const unsigned char *data,
   1.694 +                               unsigned int dataLen);
   1.695 + SECStatus (* p_RSA_CheckSignRecover)(RSAPublicKey *key,
   1.696 +                                      unsigned char *output,
   1.697 +                                      unsigned int *outputLen,
   1.698 +                                      unsigned int maxOutputLen,
   1.699 +                                      const unsigned char *sig,
   1.700 +                                      unsigned int sigLen);
   1.701 +
   1.702 +  /* Version 3.016 came to here */
   1.703 +
   1.704 + SECStatus (* p_EC_FillParams)(PLArenaPool *arena,
   1.705 +                               const SECItem *encodedParams, ECParams *params);
   1.706 + SECStatus (* p_EC_DecodeParams)(const SECItem *encodedParams,
   1.707 +                               ECParams **ecparams);
   1.708 + SECStatus (* p_EC_CopyParams)(PLArenaPool *arena, ECParams *dstParams,
   1.709 +                               const ECParams *srcParams);
   1.710 +
   1.711 +  /* Version 3.017 came to here */
   1.712 +
   1.713 +  /* Add new function pointers at the end of this struct and bump
   1.714 +   * FREEBL_VERSION at the beginning of this file. */
   1.715 + };
   1.716 +
   1.717 +typedef struct FREEBLVectorStr FREEBLVector;
   1.718 +
   1.719 +SEC_BEGIN_PROTOS
   1.720 +
   1.721 +typedef const FREEBLVector * FREEBLGetVectorFn(void);
   1.722 +
   1.723 +extern FREEBLGetVectorFn FREEBL_GetVector;
   1.724 +
   1.725 +SEC_END_PROTOS
   1.726 +
   1.727 +#endif

mercurial