summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/evp_locl.h
diff options
context:
space:
mode:
authorjsing <>2014-05-11 12:05:27 +0000
committerjsing <>2014-05-11 12:05:27 +0000
commit8516b9f21028e479132b3f445f93ee33102aa794 (patch)
tree69cd65e0e5a7509374c6f39412aa54ee8299c551 /src/lib/libcrypto/evp/evp_locl.h
parentdbe5668a4dd59daf353f19ad5303726df6b618ae (diff)
downloadopenbsd-8516b9f21028e479132b3f445f93ee33102aa794.tar.gz
openbsd-8516b9f21028e479132b3f445f93ee33102aa794.tar.bz2
openbsd-8516b9f21028e479132b3f445f93ee33102aa794.zip
KNF.
Diffstat (limited to 'src/lib/libcrypto/evp/evp_locl.h')
-rw-r--r--src/lib/libcrypto/evp/evp_locl.h39
1 files changed, 17 insertions, 22 deletions
diff --git a/src/lib/libcrypto/evp/evp_locl.h b/src/lib/libcrypto/evp/evp_locl.h
index 9e71f39a47..673c85f8bd 100644
--- a/src/lib/libcrypto/evp/evp_locl.h
+++ b/src/lib/libcrypto/evp/evp_locl.h
@@ -10,7 +10,7 @@
10 * are met: 10 * are met:
11 * 11 *
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 14 *
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in 16 * notice, this list of conditions and the following disclaimer in
@@ -65,7 +65,7 @@
65 bl = ctx->cipher->block_size;\ 65 bl = ctx->cipher->block_size;\
66 if(inl < bl) return 1;\ 66 if(inl < bl) return 1;\
67 inl -= bl; \ 67 inl -= bl; \
68 for(i=0; i <= inl; i+=bl) 68 for(i=0; i <= inl; i+=bl)
69 69
70#define BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \ 70#define BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \
71static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \ 71static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
@@ -263,8 +263,7 @@ const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; }
263 EVP_CIPHER_get_asn1_iv, \ 263 EVP_CIPHER_get_asn1_iv, \
264 NULL) 264 NULL)
265 265
266struct evp_pkey_ctx_st 266 struct evp_pkey_ctx_st {
267 {
268 /* Method associated with this operation */ 267 /* Method associated with this operation */
269 const EVP_PKEY_METHOD *pmeth; 268 const EVP_PKEY_METHOD *pmeth;
270 /* Engine that implements this method or NULL if builtin */ 269 /* Engine that implements this method or NULL if builtin */
@@ -284,12 +283,11 @@ struct evp_pkey_ctx_st
284 /* implementation specific keygen data */ 283 /* implementation specific keygen data */
285 int *keygen_info; 284 int *keygen_info;
286 int keygen_info_count; 285 int keygen_info_count;
287 } /* EVP_PKEY_CTX */; 286} /* EVP_PKEY_CTX */;
288 287
289#define EVP_PKEY_FLAG_DYNAMIC 1 288#define EVP_PKEY_FLAG_DYNAMIC 1
290 289
291struct evp_pkey_method_st 290struct evp_pkey_method_st {
292 {
293 int pkey_id; 291 int pkey_id;
294 int flags; 292 int flags;
295 293
@@ -305,45 +303,42 @@ struct evp_pkey_method_st
305 303
306 int (*sign_init)(EVP_PKEY_CTX *ctx); 304 int (*sign_init)(EVP_PKEY_CTX *ctx);
307 int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, 305 int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
308 const unsigned char *tbs, size_t tbslen); 306 const unsigned char *tbs, size_t tbslen);
309 307
310 int (*verify_init)(EVP_PKEY_CTX *ctx); 308 int (*verify_init)(EVP_PKEY_CTX *ctx);
311 int (*verify)(EVP_PKEY_CTX *ctx, 309 int (*verify)(EVP_PKEY_CTX *ctx,
312 const unsigned char *sig, size_t siglen, 310 const unsigned char *sig, size_t siglen,
313 const unsigned char *tbs, size_t tbslen); 311 const unsigned char *tbs, size_t tbslen);
314 312
315 int (*verify_recover_init)(EVP_PKEY_CTX *ctx); 313 int (*verify_recover_init)(EVP_PKEY_CTX *ctx);
316 int (*verify_recover)(EVP_PKEY_CTX *ctx, 314 int (*verify_recover)(EVP_PKEY_CTX *ctx,
317 unsigned char *rout, size_t *routlen, 315 unsigned char *rout, size_t *routlen,
318 const unsigned char *sig, size_t siglen); 316 const unsigned char *sig, size_t siglen);
319 317
320 int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx); 318 int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
321 int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, 319 int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
322 EVP_MD_CTX *mctx); 320 EVP_MD_CTX *mctx);
323 321
324 int (*verifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx); 322 int (*verifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
325 int (*verifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig,int siglen, 323 int (*verifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig,
326 EVP_MD_CTX *mctx); 324 int siglen, EVP_MD_CTX *mctx);
327 325
328 int (*encrypt_init)(EVP_PKEY_CTX *ctx); 326 int (*encrypt_init)(EVP_PKEY_CTX *ctx);
329 int (*encrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, 327 int (*encrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
330 const unsigned char *in, size_t inlen); 328 const unsigned char *in, size_t inlen);
331 329
332 int (*decrypt_init)(EVP_PKEY_CTX *ctx); 330 int (*decrypt_init)(EVP_PKEY_CTX *ctx);
333 int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, 331 int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
334 const unsigned char *in, size_t inlen); 332 const unsigned char *in, size_t inlen);
335 333
336 int (*derive_init)(EVP_PKEY_CTX *ctx); 334 int (*derive_init)(EVP_PKEY_CTX *ctx);
337 int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen); 335 int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
338 336
339 int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2); 337 int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2);
340 int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value); 338 int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value);
341 339} /* EVP_PKEY_METHOD */;
342
343 } /* EVP_PKEY_METHOD */;
344 340
345void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx); 341void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx);
346 342
347int PKCS5_v2_PBKDF2_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, 343int PKCS5_v2_PBKDF2_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
348 ASN1_TYPE *param, 344 ASN1_TYPE *param, const EVP_CIPHER *c, const EVP_MD *md, int en_de);
349 const EVP_CIPHER *c, const EVP_MD *md, int en_de);