evp_int.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. /*
  2. * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the OpenSSL license (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #include <openssl/evp.h>
  10. #include "internal/refcount.h"
  11. struct evp_pkey_ctx_st {
  12. /* Method associated with this operation */
  13. const EVP_PKEY_METHOD *pmeth;
  14. /* Engine that implements this method or NULL if builtin */
  15. ENGINE *engine;
  16. /* Key: may be NULL */
  17. EVP_PKEY *pkey;
  18. /* Peer key for key agreement, may be NULL */
  19. EVP_PKEY *peerkey;
  20. /* Actual operation */
  21. int operation;
  22. /* Algorithm specific data */
  23. void *data;
  24. /* Application specific data */
  25. void *app_data;
  26. /* Keygen callback */
  27. EVP_PKEY_gen_cb *pkey_gencb;
  28. /* implementation specific keygen data */
  29. int *keygen_info;
  30. int keygen_info_count;
  31. } /* EVP_PKEY_CTX */ ;
  32. #define EVP_PKEY_FLAG_DYNAMIC 1
  33. struct evp_pkey_method_st {
  34. int pkey_id;
  35. int flags;
  36. int (*init) (EVP_PKEY_CTX *ctx);
  37. int (*copy) (EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src);
  38. void (*cleanup) (EVP_PKEY_CTX *ctx);
  39. int (*paramgen_init) (EVP_PKEY_CTX *ctx);
  40. int (*paramgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
  41. int (*keygen_init) (EVP_PKEY_CTX *ctx);
  42. int (*keygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
  43. int (*sign_init) (EVP_PKEY_CTX *ctx);
  44. int (*sign) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
  45. const unsigned char *tbs, size_t tbslen);
  46. int (*verify_init) (EVP_PKEY_CTX *ctx);
  47. int (*verify) (EVP_PKEY_CTX *ctx,
  48. const unsigned char *sig, size_t siglen,
  49. const unsigned char *tbs, size_t tbslen);
  50. int (*verify_recover_init) (EVP_PKEY_CTX *ctx);
  51. int (*verify_recover) (EVP_PKEY_CTX *ctx,
  52. unsigned char *rout, size_t *routlen,
  53. const unsigned char *sig, size_t siglen);
  54. int (*signctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
  55. int (*signctx) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
  56. EVP_MD_CTX *mctx);
  57. int (*verifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
  58. int (*verifyctx) (EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen,
  59. EVP_MD_CTX *mctx);
  60. int (*encrypt_init) (EVP_PKEY_CTX *ctx);
  61. int (*encrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
  62. const unsigned char *in, size_t inlen);
  63. int (*decrypt_init) (EVP_PKEY_CTX *ctx);
  64. int (*decrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
  65. const unsigned char *in, size_t inlen);
  66. int (*derive_init) (EVP_PKEY_CTX *ctx);
  67. int (*derive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
  68. int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1, void *p2);
  69. int (*ctrl_str) (EVP_PKEY_CTX *ctx, const char *type, const char *value);
  70. int (*digestsign) (EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen,
  71. const unsigned char *tbs, size_t tbslen);
  72. int (*digestverify) (EVP_MD_CTX *ctx, const unsigned char *sig,
  73. size_t siglen, const unsigned char *tbs,
  74. size_t tbslen);
  75. int (*check) (EVP_PKEY *pkey);
  76. int (*public_check) (EVP_PKEY *pkey);
  77. int (*param_check) (EVP_PKEY *pkey);
  78. } /* EVP_PKEY_METHOD */ ;
  79. DEFINE_STACK_OF_CONST(EVP_PKEY_METHOD)
  80. void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx);
  81. extern const EVP_PKEY_METHOD cmac_pkey_meth;
  82. extern const EVP_PKEY_METHOD dh_pkey_meth;
  83. extern const EVP_PKEY_METHOD dhx_pkey_meth;
  84. extern const EVP_PKEY_METHOD dsa_pkey_meth;
  85. extern const EVP_PKEY_METHOD ec_pkey_meth;
  86. extern const EVP_PKEY_METHOD sm2_pkey_meth;
  87. extern const EVP_PKEY_METHOD ecx25519_pkey_meth;
  88. extern const EVP_PKEY_METHOD ecx448_pkey_meth;
  89. extern const EVP_PKEY_METHOD ed25519_pkey_meth;
  90. extern const EVP_PKEY_METHOD ed448_pkey_meth;
  91. extern const EVP_PKEY_METHOD hmac_pkey_meth;
  92. extern const EVP_PKEY_METHOD rsa_pkey_meth;
  93. extern const EVP_PKEY_METHOD rsa_pss_pkey_meth;
  94. extern const EVP_PKEY_METHOD scrypt_pkey_meth;
  95. extern const EVP_PKEY_METHOD tls1_prf_pkey_meth;
  96. extern const EVP_PKEY_METHOD hkdf_pkey_meth;
  97. extern const EVP_PKEY_METHOD poly1305_pkey_meth;
  98. extern const EVP_PKEY_METHOD siphash_pkey_meth;
  99. struct evp_md_st {
  100. int type;
  101. int pkey_type;
  102. int md_size;
  103. unsigned long flags;
  104. int (*init) (EVP_MD_CTX *ctx);
  105. int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count);
  106. int (*final) (EVP_MD_CTX *ctx, unsigned char *md);
  107. int (*copy) (EVP_MD_CTX *to, const EVP_MD_CTX *from);
  108. int (*cleanup) (EVP_MD_CTX *ctx);
  109. int block_size;
  110. int ctx_size; /* how big does the ctx->md_data need to be */
  111. /* control function */
  112. int (*md_ctrl) (EVP_MD_CTX *ctx, int cmd, int p1, void *p2);
  113. } /* EVP_MD */ ;
  114. struct evp_cipher_st {
  115. int nid;
  116. int block_size;
  117. /* Default value for variable length ciphers */
  118. int key_len;
  119. int iv_len;
  120. /* Various flags */
  121. unsigned long flags;
  122. /* init key */
  123. int (*init) (EVP_CIPHER_CTX *ctx, const unsigned char *key,
  124. const unsigned char *iv, int enc);
  125. /* encrypt/decrypt data */
  126. int (*do_cipher) (EVP_CIPHER_CTX *ctx, unsigned char *out,
  127. const unsigned char *in, size_t inl);
  128. /* cleanup ctx */
  129. int (*cleanup) (EVP_CIPHER_CTX *);
  130. /* how big ctx->cipher_data needs to be */
  131. int ctx_size;
  132. /* Populate a ASN1_TYPE with parameters */
  133. int (*set_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *);
  134. /* Get parameters from a ASN1_TYPE */
  135. int (*get_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *);
  136. /* Miscellaneous operations */
  137. int (*ctrl) (EVP_CIPHER_CTX *, int type, int arg, void *ptr);
  138. /* Application data */
  139. void *app_data;
  140. } /* EVP_CIPHER */ ;
  141. /* Macros to code block cipher wrappers */
  142. /* Wrapper functions for each cipher mode */
  143. #define EVP_C_DATA(kstruct, ctx) \
  144. ((kstruct *)EVP_CIPHER_CTX_get_cipher_data(ctx))
  145. #define BLOCK_CIPHER_ecb_loop() \
  146. size_t i, bl; \
  147. bl = EVP_CIPHER_CTX_cipher(ctx)->block_size; \
  148. if (inl < bl) return 1;\
  149. inl -= bl; \
  150. for (i=0; i <= inl; i+=bl)
  151. #define BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \
  152. static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
  153. {\
  154. BLOCK_CIPHER_ecb_loop() \
  155. cprefix##_ecb_encrypt(in + i, out + i, &EVP_C_DATA(kstruct,ctx)->ksched, EVP_CIPHER_CTX_encrypting(ctx)); \
  156. return 1;\
  157. }
  158. #define EVP_MAXCHUNK ((size_t)1<<(sizeof(long)*8-2))
  159. #define BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched) \
  160. static int cname##_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
  161. {\
  162. while(inl>=EVP_MAXCHUNK) {\
  163. int num = EVP_CIPHER_CTX_num(ctx);\
  164. cprefix##_ofb##cbits##_encrypt(in, out, (long)EVP_MAXCHUNK, &EVP_C_DATA(kstruct,ctx)->ksched, EVP_CIPHER_CTX_iv_noconst(ctx), &num); \
  165. EVP_CIPHER_CTX_set_num(ctx, num);\
  166. inl-=EVP_MAXCHUNK;\
  167. in +=EVP_MAXCHUNK;\
  168. out+=EVP_MAXCHUNK;\
  169. }\
  170. if (inl) {\
  171. int num = EVP_CIPHER_CTX_num(ctx);\
  172. cprefix##_ofb##cbits##_encrypt(in, out, (long)inl, &EVP_C_DATA(kstruct,ctx)->ksched, EVP_CIPHER_CTX_iv_noconst(ctx), &num); \
  173. EVP_CIPHER_CTX_set_num(ctx, num);\
  174. }\
  175. return 1;\
  176. }
  177. #define BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \
  178. static int cname##_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
  179. {\
  180. while(inl>=EVP_MAXCHUNK) \
  181. {\
  182. cprefix##_cbc_encrypt(in, out, (long)EVP_MAXCHUNK, &EVP_C_DATA(kstruct,ctx)->ksched, EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx));\
  183. inl-=EVP_MAXCHUNK;\
  184. in +=EVP_MAXCHUNK;\
  185. out+=EVP_MAXCHUNK;\
  186. }\
  187. if (inl)\
  188. cprefix##_cbc_encrypt(in, out, (long)inl, &EVP_C_DATA(kstruct,ctx)->ksched, EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx));\
  189. return 1;\
  190. }
  191. #define BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \
  192. static int cname##_cfb##cbits##_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
  193. {\
  194. size_t chunk = EVP_MAXCHUNK;\
  195. if (cbits == 1) chunk >>= 3;\
  196. if (inl < chunk) chunk = inl;\
  197. while (inl && inl >= chunk)\
  198. {\
  199. int num = EVP_CIPHER_CTX_num(ctx);\
  200. cprefix##_cfb##cbits##_encrypt(in, out, (long) \
  201. ((cbits == 1) \
  202. && !EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS) \
  203. ? chunk*8 : chunk), \
  204. &EVP_C_DATA(kstruct, ctx)->ksched, EVP_CIPHER_CTX_iv_noconst(ctx),\
  205. &num, EVP_CIPHER_CTX_encrypting(ctx));\
  206. EVP_CIPHER_CTX_set_num(ctx, num);\
  207. inl -= chunk;\
  208. in += chunk;\
  209. out += chunk;\
  210. if (inl < chunk) chunk = inl;\
  211. }\
  212. return 1;\
  213. }
  214. #define BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \
  215. BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \
  216. BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \
  217. BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \
  218. BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched)
  219. #define BLOCK_CIPHER_def1(cname, nmode, mode, MODE, kstruct, nid, block_size, \
  220. key_len, iv_len, flags, init_key, cleanup, \
  221. set_asn1, get_asn1, ctrl) \
  222. static const EVP_CIPHER cname##_##mode = { \
  223. nid##_##nmode, block_size, key_len, iv_len, \
  224. flags | EVP_CIPH_##MODE##_MODE, \
  225. init_key, \
  226. cname##_##mode##_cipher, \
  227. cleanup, \
  228. sizeof(kstruct), \
  229. set_asn1, get_asn1,\
  230. ctrl, \
  231. NULL \
  232. }; \
  233. const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
  234. #define BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, \
  235. iv_len, flags, init_key, cleanup, set_asn1, \
  236. get_asn1, ctrl) \
  237. BLOCK_CIPHER_def1(cname, cbc, cbc, CBC, kstruct, nid, block_size, key_len, \
  238. iv_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
  239. #define BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, \
  240. iv_len, cbits, flags, init_key, cleanup, \
  241. set_asn1, get_asn1, ctrl) \
  242. BLOCK_CIPHER_def1(cname, cfb##cbits, cfb##cbits, CFB, kstruct, nid, 1, \
  243. key_len, iv_len, flags, init_key, cleanup, set_asn1, \
  244. get_asn1, ctrl)
  245. #define BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, \
  246. iv_len, cbits, flags, init_key, cleanup, \
  247. set_asn1, get_asn1, ctrl) \
  248. BLOCK_CIPHER_def1(cname, ofb##cbits, ofb, OFB, kstruct, nid, 1, \
  249. key_len, iv_len, flags, init_key, cleanup, set_asn1, \
  250. get_asn1, ctrl)
  251. #define BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, \
  252. flags, init_key, cleanup, set_asn1, \
  253. get_asn1, ctrl) \
  254. BLOCK_CIPHER_def1(cname, ecb, ecb, ECB, kstruct, nid, block_size, key_len, \
  255. 0, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
  256. #define BLOCK_CIPHER_defs(cname, kstruct, \
  257. nid, block_size, key_len, iv_len, cbits, flags, \
  258. init_key, cleanup, set_asn1, get_asn1, ctrl) \
  259. BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, iv_len, flags, \
  260. init_key, cleanup, set_asn1, get_asn1, ctrl) \
  261. BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, iv_len, cbits, \
  262. flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
  263. BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, iv_len, cbits, \
  264. flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
  265. BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, flags, \
  266. init_key, cleanup, set_asn1, get_asn1, ctrl)
  267. /*-
  268. #define BLOCK_CIPHER_defs(cname, kstruct, \
  269. nid, block_size, key_len, iv_len, flags,\
  270. init_key, cleanup, set_asn1, get_asn1, ctrl)\
  271. static const EVP_CIPHER cname##_cbc = {\
  272. nid##_cbc, block_size, key_len, iv_len, \
  273. flags | EVP_CIPH_CBC_MODE,\
  274. init_key,\
  275. cname##_cbc_cipher,\
  276. cleanup,\
  277. sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
  278. sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
  279. set_asn1, get_asn1,\
  280. ctrl, \
  281. NULL \
  282. };\
  283. const EVP_CIPHER *EVP_##cname##_cbc(void) { return &cname##_cbc; }\
  284. static const EVP_CIPHER cname##_cfb = {\
  285. nid##_cfb64, 1, key_len, iv_len, \
  286. flags | EVP_CIPH_CFB_MODE,\
  287. init_key,\
  288. cname##_cfb_cipher,\
  289. cleanup,\
  290. sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
  291. sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
  292. set_asn1, get_asn1,\
  293. ctrl,\
  294. NULL \
  295. };\
  296. const EVP_CIPHER *EVP_##cname##_cfb(void) { return &cname##_cfb; }\
  297. static const EVP_CIPHER cname##_ofb = {\
  298. nid##_ofb64, 1, key_len, iv_len, \
  299. flags | EVP_CIPH_OFB_MODE,\
  300. init_key,\
  301. cname##_ofb_cipher,\
  302. cleanup,\
  303. sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
  304. sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
  305. set_asn1, get_asn1,\
  306. ctrl,\
  307. NULL \
  308. };\
  309. const EVP_CIPHER *EVP_##cname##_ofb(void) { return &cname##_ofb; }\
  310. static const EVP_CIPHER cname##_ecb = {\
  311. nid##_ecb, block_size, key_len, iv_len, \
  312. flags | EVP_CIPH_ECB_MODE,\
  313. init_key,\
  314. cname##_ecb_cipher,\
  315. cleanup,\
  316. sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
  317. sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
  318. set_asn1, get_asn1,\
  319. ctrl,\
  320. NULL \
  321. };\
  322. const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; }
  323. */
  324. #define IMPLEMENT_BLOCK_CIPHER(cname, ksched, cprefix, kstruct, nid, \
  325. block_size, key_len, iv_len, cbits, \
  326. flags, init_key, \
  327. cleanup, set_asn1, get_asn1, ctrl) \
  328. BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \
  329. BLOCK_CIPHER_defs(cname, kstruct, nid, block_size, key_len, iv_len, \
  330. cbits, flags, init_key, cleanup, set_asn1, \
  331. get_asn1, ctrl)
  332. #define IMPLEMENT_CFBR(cipher,cprefix,kstruct,ksched,keysize,cbits,iv_len,fl) \
  333. BLOCK_CIPHER_func_cfb(cipher##_##keysize,cprefix,cbits,kstruct,ksched) \
  334. BLOCK_CIPHER_def_cfb(cipher##_##keysize,kstruct, \
  335. NID_##cipher##_##keysize, keysize/8, iv_len, cbits, \
  336. (fl)|EVP_CIPH_FLAG_DEFAULT_ASN1, \
  337. cipher##_init_key, NULL, NULL, NULL, NULL)
  338. # ifndef OPENSSL_NO_EC
  339. #define X25519_KEYLEN 32
  340. #define X448_KEYLEN 56
  341. #define ED448_KEYLEN 57
  342. #define MAX_KEYLEN ED448_KEYLEN
  343. typedef struct {
  344. unsigned char pubkey[MAX_KEYLEN];
  345. unsigned char *privkey;
  346. } ECX_KEY;
  347. #endif
  348. /*
  349. * Type needs to be a bit field Sub-type needs to be for variations on the
  350. * method, as in, can it do arbitrary encryption....
  351. */
  352. struct evp_pkey_st {
  353. int type;
  354. int save_type;
  355. CRYPTO_REF_COUNT references;
  356. const EVP_PKEY_ASN1_METHOD *ameth;
  357. ENGINE *engine;
  358. ENGINE *pmeth_engine; /* If not NULL public key ENGINE to use */
  359. union {
  360. void *ptr;
  361. # ifndef OPENSSL_NO_RSA
  362. struct rsa_st *rsa; /* RSA */
  363. # endif
  364. # ifndef OPENSSL_NO_DSA
  365. struct dsa_st *dsa; /* DSA */
  366. # endif
  367. # ifndef OPENSSL_NO_DH
  368. struct dh_st *dh; /* DH */
  369. # endif
  370. # ifndef OPENSSL_NO_EC
  371. struct ec_key_st *ec; /* ECC */
  372. ECX_KEY *ecx; /* X25519, X448, Ed25519, Ed448 */
  373. # endif
  374. } pkey;
  375. int save_parameters;
  376. STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
  377. CRYPTO_RWLOCK *lock;
  378. } /* EVP_PKEY */ ;
  379. void openssl_add_all_ciphers_int(void);
  380. void openssl_add_all_digests_int(void);
  381. void evp_cleanup_int(void);
  382. void evp_app_cleanup_int(void);
  383. /* Pulling defines out of C source files */
  384. #define EVP_RC4_KEY_SIZE 16
  385. #ifndef TLS1_1_VERSION
  386. # define TLS1_1_VERSION 0x0302
  387. #endif
  388. void evp_encode_ctx_set_flags(EVP_ENCODE_CTX *ctx, unsigned int flags);
  389. /* EVP_ENCODE_CTX flags */
  390. /* Don't generate new lines when encoding */
  391. #define EVP_ENCODE_CTX_NO_NEWLINES 1
  392. /* Use the SRP base64 alphabet instead of the standard one */
  393. #define EVP_ENCODE_CTX_USE_SRP_ALPHABET 2