[331] | 1 | /*
|
---|
| 2 | * Copyright 1995-2016 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 |
|
---|
| 10 | #ifndef HEADER_DH_H
|
---|
| 11 | # define HEADER_DH_H
|
---|
| 12 |
|
---|
| 13 | # include <openssl/opensslconf.h>
|
---|
| 14 |
|
---|
| 15 | # ifndef OPENSSL_NO_DH
|
---|
| 16 | # include <openssl/e_os2.h>
|
---|
| 17 | # include <openssl/bio.h>
|
---|
| 18 | # include <openssl/asn1.h>
|
---|
| 19 | # include <openssl/ossl_typ.h>
|
---|
| 20 | # if OPENSSL_API_COMPAT < 0x10100000L
|
---|
| 21 | # include <openssl/bn.h>
|
---|
| 22 | # endif
|
---|
| 23 |
|
---|
| 24 | # ifdef __cplusplus
|
---|
| 25 | extern "C" {
|
---|
| 26 | # endif
|
---|
| 27 |
|
---|
| 28 | # ifndef OPENSSL_DH_MAX_MODULUS_BITS
|
---|
| 29 | # define OPENSSL_DH_MAX_MODULUS_BITS 10000
|
---|
| 30 | # endif
|
---|
| 31 |
|
---|
| 32 | # define OPENSSL_DH_FIPS_MIN_MODULUS_BITS 1024
|
---|
| 33 |
|
---|
| 34 | # define DH_FLAG_CACHE_MONT_P 0x01
|
---|
| 35 |
|
---|
| 36 | # if OPENSSL_API_COMPAT < 0x10100000L
|
---|
| 37 | /*
|
---|
| 38 | * Does nothing. Previously this switched off constant time behaviour.
|
---|
| 39 | */
|
---|
| 40 | # define DH_FLAG_NO_EXP_CONSTTIME 0x00
|
---|
| 41 | # endif
|
---|
| 42 |
|
---|
| 43 | /*
|
---|
| 44 | * If this flag is set the DH method is FIPS compliant and can be used in
|
---|
| 45 | * FIPS mode. This is set in the validated module method. If an application
|
---|
| 46 | * sets this flag in its own methods it is its responsibility to ensure the
|
---|
| 47 | * result is compliant.
|
---|
| 48 | */
|
---|
| 49 |
|
---|
| 50 | # define DH_FLAG_FIPS_METHOD 0x0400
|
---|
| 51 |
|
---|
| 52 | /*
|
---|
| 53 | * If this flag is set the operations normally disabled in FIPS mode are
|
---|
| 54 | * permitted it is then the applications responsibility to ensure that the
|
---|
| 55 | * usage is compliant.
|
---|
| 56 | */
|
---|
| 57 |
|
---|
| 58 | # define DH_FLAG_NON_FIPS_ALLOW 0x0400
|
---|
| 59 |
|
---|
| 60 | /* Already defined in ossl_typ.h */
|
---|
| 61 | /* typedef struct dh_st DH; */
|
---|
| 62 | /* typedef struct dh_method DH_METHOD; */
|
---|
| 63 |
|
---|
| 64 | DECLARE_ASN1_ITEM(DHparams)
|
---|
| 65 |
|
---|
| 66 | # define DH_GENERATOR_2 2
|
---|
| 67 | /* #define DH_GENERATOR_3 3 */
|
---|
| 68 | # define DH_GENERATOR_5 5
|
---|
| 69 |
|
---|
| 70 | /* DH_check error codes */
|
---|
| 71 | # define DH_CHECK_P_NOT_PRIME 0x01
|
---|
| 72 | # define DH_CHECK_P_NOT_SAFE_PRIME 0x02
|
---|
| 73 | # define DH_UNABLE_TO_CHECK_GENERATOR 0x04
|
---|
| 74 | # define DH_NOT_SUITABLE_GENERATOR 0x08
|
---|
| 75 | # define DH_CHECK_Q_NOT_PRIME 0x10
|
---|
| 76 | # define DH_CHECK_INVALID_Q_VALUE 0x20
|
---|
| 77 | # define DH_CHECK_INVALID_J_VALUE 0x40
|
---|
| 78 |
|
---|
| 79 | /* DH_check_pub_key error codes */
|
---|
| 80 | # define DH_CHECK_PUBKEY_TOO_SMALL 0x01
|
---|
| 81 | # define DH_CHECK_PUBKEY_TOO_LARGE 0x02
|
---|
| 82 | # define DH_CHECK_PUBKEY_INVALID 0x04
|
---|
| 83 |
|
---|
| 84 | /*
|
---|
| 85 | * primes p where (p-1)/2 is prime too are called "safe"; we define this for
|
---|
| 86 | * backward compatibility:
|
---|
| 87 | */
|
---|
| 88 | # define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME
|
---|
| 89 |
|
---|
| 90 | # define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \
|
---|
| 91 | (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x))
|
---|
| 92 | # define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \
|
---|
| 93 | (unsigned char *)(x))
|
---|
| 94 | # define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x)
|
---|
| 95 | # define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x)
|
---|
| 96 |
|
---|
| 97 | DH *DHparams_dup(DH *);
|
---|
| 98 |
|
---|
| 99 | const DH_METHOD *DH_OpenSSL(void);
|
---|
| 100 |
|
---|
| 101 | void DH_set_default_method(const DH_METHOD *meth);
|
---|
| 102 | const DH_METHOD *DH_get_default_method(void);
|
---|
| 103 | int DH_set_method(DH *dh, const DH_METHOD *meth);
|
---|
| 104 | DH *DH_new_method(ENGINE *engine);
|
---|
| 105 |
|
---|
| 106 | DH *DH_new(void);
|
---|
| 107 | void DH_free(DH *dh);
|
---|
| 108 | int DH_up_ref(DH *dh);
|
---|
| 109 | int DH_bits(const DH *dh);
|
---|
| 110 | int DH_size(const DH *dh);
|
---|
| 111 | int DH_security_bits(const DH *dh);
|
---|
| 112 | #define DH_get_ex_new_index(l, p, newf, dupf, freef) \
|
---|
| 113 | CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DH, l, p, newf, dupf, freef)
|
---|
| 114 | int DH_set_ex_data(DH *d, int idx, void *arg);
|
---|
| 115 | void *DH_get_ex_data(DH *d, int idx);
|
---|
| 116 |
|
---|
| 117 | /* Deprecated version */
|
---|
| 118 | DEPRECATEDIN_0_9_8(DH *DH_generate_parameters(int prime_len, int generator,
|
---|
| 119 | void (*callback) (int, int,
|
---|
| 120 | void *),
|
---|
| 121 | void *cb_arg))
|
---|
| 122 |
|
---|
| 123 | /* New version */
|
---|
| 124 | int DH_generate_parameters_ex(DH *dh, int prime_len, int generator,
|
---|
| 125 | BN_GENCB *cb);
|
---|
| 126 |
|
---|
| 127 | int DH_check_params(const DH *dh, int *ret);
|
---|
| 128 | int DH_check(const DH *dh, int *codes);
|
---|
| 129 | int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes);
|
---|
| 130 | int DH_generate_key(DH *dh);
|
---|
| 131 | int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
|
---|
| 132 | int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh);
|
---|
| 133 | DH *d2i_DHparams(DH **a, const unsigned char **pp, long length);
|
---|
| 134 | int i2d_DHparams(const DH *a, unsigned char **pp);
|
---|
| 135 | DH *d2i_DHxparams(DH **a, const unsigned char **pp, long length);
|
---|
| 136 | int i2d_DHxparams(const DH *a, unsigned char **pp);
|
---|
| 137 | # ifndef OPENSSL_NO_STDIO
|
---|
| 138 | int DHparams_print_fp(FILE *fp, const DH *x);
|
---|
| 139 | # endif
|
---|
| 140 | int DHparams_print(BIO *bp, const DH *x);
|
---|
| 141 |
|
---|
| 142 | /* RFC 5114 parameters */
|
---|
| 143 | DH *DH_get_1024_160(void);
|
---|
| 144 | DH *DH_get_2048_224(void);
|
---|
| 145 | DH *DH_get_2048_256(void);
|
---|
| 146 |
|
---|
| 147 | # ifndef OPENSSL_NO_CMS
|
---|
| 148 | /* RFC2631 KDF */
|
---|
| 149 | int DH_KDF_X9_42(unsigned char *out, size_t outlen,
|
---|
| 150 | const unsigned char *Z, size_t Zlen,
|
---|
| 151 | ASN1_OBJECT *key_oid,
|
---|
| 152 | const unsigned char *ukm, size_t ukmlen, const EVP_MD *md);
|
---|
| 153 | # endif
|
---|
| 154 |
|
---|
| 155 | void DH_get0_pqg(const DH *dh,
|
---|
| 156 | const BIGNUM **p, const BIGNUM **q, const BIGNUM **g);
|
---|
| 157 | int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g);
|
---|
| 158 | void DH_get0_key(const DH *dh,
|
---|
| 159 | const BIGNUM **pub_key, const BIGNUM **priv_key);
|
---|
| 160 | int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
|
---|
| 161 | void DH_clear_flags(DH *dh, int flags);
|
---|
| 162 | int DH_test_flags(const DH *dh, int flags);
|
---|
| 163 | void DH_set_flags(DH *dh, int flags);
|
---|
| 164 | ENGINE *DH_get0_engine(DH *d);
|
---|
| 165 | long DH_get_length(const DH *dh);
|
---|
| 166 | int DH_set_length(DH *dh, long length);
|
---|
| 167 |
|
---|
| 168 | DH_METHOD *DH_meth_new(const char *name, int flags);
|
---|
| 169 | void DH_meth_free(DH_METHOD *dhm);
|
---|
| 170 | DH_METHOD *DH_meth_dup(const DH_METHOD *dhm);
|
---|
| 171 | const char *DH_meth_get0_name(const DH_METHOD *dhm);
|
---|
| 172 | int DH_meth_set1_name(DH_METHOD *dhm, const char *name);
|
---|
| 173 | int DH_meth_get_flags(DH_METHOD *dhm);
|
---|
| 174 | int DH_meth_set_flags(DH_METHOD *dhm, int flags);
|
---|
| 175 | void *DH_meth_get0_app_data(const DH_METHOD *dhm);
|
---|
| 176 | int DH_meth_set0_app_data(DH_METHOD *dhm, void *app_data);
|
---|
| 177 | int (*DH_meth_get_generate_key(const DH_METHOD *dhm)) (DH *);
|
---|
| 178 | int DH_meth_set_generate_key(DH_METHOD *dhm, int (*generate_key) (DH *));
|
---|
| 179 | int (*DH_meth_get_compute_key(const DH_METHOD *dhm))
|
---|
| 180 | (unsigned char *key, const BIGNUM *pub_key, DH *dh);
|
---|
| 181 | int DH_meth_set_compute_key(DH_METHOD *dhm,
|
---|
| 182 | int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh));
|
---|
| 183 | int (*DH_meth_get_bn_mod_exp(const DH_METHOD *dhm))
|
---|
| 184 | (const DH *, BIGNUM *, const BIGNUM *, const BIGNUM *, const BIGNUM *,
|
---|
| 185 | BN_CTX *, BN_MONT_CTX *);
|
---|
| 186 | int DH_meth_set_bn_mod_exp(DH_METHOD *dhm,
|
---|
| 187 | int (*bn_mod_exp) (const DH *, BIGNUM *, const BIGNUM *, const BIGNUM *,
|
---|
| 188 | const BIGNUM *, BN_CTX *, BN_MONT_CTX *));
|
---|
| 189 | int (*DH_meth_get_init(const DH_METHOD *dhm))(DH *);
|
---|
| 190 | int DH_meth_set_init(DH_METHOD *dhm, int (*init)(DH *));
|
---|
| 191 | int (*DH_meth_get_finish(const DH_METHOD *dhm)) (DH *);
|
---|
| 192 | int DH_meth_set_finish(DH_METHOD *dhm, int (*finish) (DH *));
|
---|
| 193 | int (*DH_meth_get_generate_params(const DH_METHOD *dhm))
|
---|
| 194 | (DH *, int, int, BN_GENCB *);
|
---|
| 195 | int DH_meth_set_generate_params(DH_METHOD *dhm,
|
---|
| 196 | int (*generate_params) (DH *, int, int, BN_GENCB *));
|
---|
| 197 |
|
---|
| 198 |
|
---|
| 199 | # define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \
|
---|
| 200 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
|
---|
| 201 | EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL)
|
---|
| 202 |
|
---|
| 203 | # define EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len) \
|
---|
| 204 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
|
---|
| 205 | EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN, len, NULL)
|
---|
| 206 |
|
---|
| 207 | # define EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ) \
|
---|
| 208 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
|
---|
| 209 | EVP_PKEY_CTRL_DH_PARAMGEN_TYPE, typ, NULL)
|
---|
| 210 |
|
---|
| 211 | # define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \
|
---|
| 212 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
|
---|
| 213 | EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL)
|
---|
| 214 |
|
---|
| 215 | # define EVP_PKEY_CTX_set_dh_rfc5114(ctx, gen) \
|
---|
| 216 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \
|
---|
| 217 | EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)
|
---|
| 218 |
|
---|
| 219 | # define EVP_PKEY_CTX_set_dhx_rfc5114(ctx, gen) \
|
---|
| 220 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \
|
---|
| 221 | EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)
|
---|
| 222 |
|
---|
| 223 | # define EVP_PKEY_CTX_set_dh_kdf_type(ctx, kdf) \
|
---|
| 224 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
---|
| 225 | EVP_PKEY_OP_DERIVE, \
|
---|
| 226 | EVP_PKEY_CTRL_DH_KDF_TYPE, kdf, NULL)
|
---|
| 227 |
|
---|
| 228 | # define EVP_PKEY_CTX_get_dh_kdf_type(ctx) \
|
---|
| 229 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
---|
| 230 | EVP_PKEY_OP_DERIVE, \
|
---|
| 231 | EVP_PKEY_CTRL_DH_KDF_TYPE, -2, NULL)
|
---|
| 232 |
|
---|
| 233 | # define EVP_PKEY_CTX_set0_dh_kdf_oid(ctx, oid) \
|
---|
| 234 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
---|
| 235 | EVP_PKEY_OP_DERIVE, \
|
---|
| 236 | EVP_PKEY_CTRL_DH_KDF_OID, 0, (void *)oid)
|
---|
| 237 |
|
---|
| 238 | # define EVP_PKEY_CTX_get0_dh_kdf_oid(ctx, poid) \
|
---|
| 239 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
---|
| 240 | EVP_PKEY_OP_DERIVE, \
|
---|
| 241 | EVP_PKEY_CTRL_GET_DH_KDF_OID, 0, (void *)poid)
|
---|
| 242 |
|
---|
| 243 | # define EVP_PKEY_CTX_set_dh_kdf_md(ctx, md) \
|
---|
| 244 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
---|
| 245 | EVP_PKEY_OP_DERIVE, \
|
---|
| 246 | EVP_PKEY_CTRL_DH_KDF_MD, 0, (void *)md)
|
---|
| 247 |
|
---|
| 248 | # define EVP_PKEY_CTX_get_dh_kdf_md(ctx, pmd) \
|
---|
| 249 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
---|
| 250 | EVP_PKEY_OP_DERIVE, \
|
---|
| 251 | EVP_PKEY_CTRL_GET_DH_KDF_MD, 0, (void *)pmd)
|
---|
| 252 |
|
---|
| 253 | # define EVP_PKEY_CTX_set_dh_kdf_outlen(ctx, len) \
|
---|
| 254 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
---|
| 255 | EVP_PKEY_OP_DERIVE, \
|
---|
| 256 | EVP_PKEY_CTRL_DH_KDF_OUTLEN, len, NULL)
|
---|
| 257 |
|
---|
| 258 | # define EVP_PKEY_CTX_get_dh_kdf_outlen(ctx, plen) \
|
---|
| 259 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
---|
| 260 | EVP_PKEY_OP_DERIVE, \
|
---|
| 261 | EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN, 0, (void *)plen)
|
---|
| 262 |
|
---|
| 263 | # define EVP_PKEY_CTX_set0_dh_kdf_ukm(ctx, p, plen) \
|
---|
| 264 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
---|
| 265 | EVP_PKEY_OP_DERIVE, \
|
---|
| 266 | EVP_PKEY_CTRL_DH_KDF_UKM, plen, (void *)p)
|
---|
| 267 |
|
---|
| 268 | # define EVP_PKEY_CTX_get0_dh_kdf_ukm(ctx, p) \
|
---|
| 269 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
---|
| 270 | EVP_PKEY_OP_DERIVE, \
|
---|
| 271 | EVP_PKEY_CTRL_GET_DH_KDF_UKM, 0, (void *)p)
|
---|
| 272 |
|
---|
| 273 | # define EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN (EVP_PKEY_ALG_CTRL + 1)
|
---|
| 274 | # define EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR (EVP_PKEY_ALG_CTRL + 2)
|
---|
| 275 | # define EVP_PKEY_CTRL_DH_RFC5114 (EVP_PKEY_ALG_CTRL + 3)
|
---|
| 276 | # define EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN (EVP_PKEY_ALG_CTRL + 4)
|
---|
| 277 | # define EVP_PKEY_CTRL_DH_PARAMGEN_TYPE (EVP_PKEY_ALG_CTRL + 5)
|
---|
| 278 | # define EVP_PKEY_CTRL_DH_KDF_TYPE (EVP_PKEY_ALG_CTRL + 6)
|
---|
| 279 | # define EVP_PKEY_CTRL_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 7)
|
---|
| 280 | # define EVP_PKEY_CTRL_GET_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 8)
|
---|
| 281 | # define EVP_PKEY_CTRL_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 9)
|
---|
| 282 | # define EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 10)
|
---|
| 283 | # define EVP_PKEY_CTRL_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 11)
|
---|
| 284 | # define EVP_PKEY_CTRL_GET_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 12)
|
---|
| 285 | # define EVP_PKEY_CTRL_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 13)
|
---|
| 286 | # define EVP_PKEY_CTRL_GET_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 14)
|
---|
| 287 |
|
---|
| 288 | /* KDF types */
|
---|
| 289 | # define EVP_PKEY_DH_KDF_NONE 1
|
---|
| 290 | # ifndef OPENSSL_NO_CMS
|
---|
| 291 | # define EVP_PKEY_DH_KDF_X9_42 2
|
---|
| 292 | # endif
|
---|
| 293 |
|
---|
| 294 | /* BEGIN ERROR CODES */
|
---|
| 295 | /*
|
---|
| 296 | * The following lines are auto generated by the script mkerr.pl. Any changes
|
---|
| 297 | * made after this point may be overwritten when the script is next run.
|
---|
| 298 | */
|
---|
| 299 |
|
---|
| 300 | int ERR_load_DH_strings(void);
|
---|
| 301 |
|
---|
| 302 | /* Error codes for the DH functions. */
|
---|
| 303 |
|
---|
| 304 | /* Function codes. */
|
---|
| 305 | # define DH_F_COMPUTE_KEY 102
|
---|
| 306 | # define DH_F_DHPARAMS_PRINT_FP 101
|
---|
| 307 | # define DH_F_DH_BUILTIN_GENPARAMS 106
|
---|
| 308 | # define DH_F_DH_CMS_DECRYPT 114
|
---|
| 309 | # define DH_F_DH_CMS_SET_PEERKEY 115
|
---|
| 310 | # define DH_F_DH_CMS_SET_SHARED_INFO 116
|
---|
| 311 | # define DH_F_DH_METH_DUP 117
|
---|
| 312 | # define DH_F_DH_METH_NEW 118
|
---|
| 313 | # define DH_F_DH_METH_SET1_NAME 119
|
---|
| 314 | # define DH_F_DH_NEW_METHOD 105
|
---|
| 315 | # define DH_F_DH_PARAM_DECODE 107
|
---|
| 316 | # define DH_F_DH_PRIV_DECODE 110
|
---|
| 317 | # define DH_F_DH_PRIV_ENCODE 111
|
---|
| 318 | # define DH_F_DH_PUB_DECODE 108
|
---|
| 319 | # define DH_F_DH_PUB_ENCODE 109
|
---|
| 320 | # define DH_F_DO_DH_PRINT 100
|
---|
| 321 | # define DH_F_GENERATE_KEY 103
|
---|
| 322 | # define DH_F_PKEY_DH_DERIVE 112
|
---|
| 323 | # define DH_F_PKEY_DH_KEYGEN 113
|
---|
| 324 |
|
---|
| 325 | /* Reason codes. */
|
---|
| 326 | # define DH_R_BAD_GENERATOR 101
|
---|
| 327 | # define DH_R_BN_DECODE_ERROR 109
|
---|
| 328 | # define DH_R_BN_ERROR 106
|
---|
| 329 | # define DH_R_DECODE_ERROR 104
|
---|
| 330 | # define DH_R_INVALID_PUBKEY 102
|
---|
| 331 | # define DH_R_KDF_PARAMETER_ERROR 112
|
---|
| 332 | # define DH_R_KEYS_NOT_SET 108
|
---|
| 333 | # define DH_R_MODULUS_TOO_LARGE 103
|
---|
| 334 | # define DH_R_NO_PARAMETERS_SET 107
|
---|
| 335 | # define DH_R_NO_PRIVATE_VALUE 100
|
---|
| 336 | # define DH_R_PARAMETER_ENCODING_ERROR 105
|
---|
| 337 | # define DH_R_PEER_KEY_ERROR 111
|
---|
| 338 | # define DH_R_SHARED_INFO_ERROR 113
|
---|
| 339 |
|
---|
| 340 | # ifdef __cplusplus
|
---|
| 341 | }
|
---|
| 342 | # endif
|
---|
| 343 | # endif
|
---|
| 344 | #endif
|
---|