2 * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
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
17 # define EVP_PKEY_CTRL_TLS_MD (EVP_PKEY_ALG_CTRL)
18 # define EVP_PKEY_CTRL_TLS_SECRET (EVP_PKEY_ALG_CTRL + 1)
19 # define EVP_PKEY_CTRL_TLS_SEED (EVP_PKEY_ALG_CTRL + 2)
20 # define EVP_PKEY_CTRL_HKDF_MD (EVP_PKEY_ALG_CTRL + 3)
21 # define EVP_PKEY_CTRL_HKDF_SALT (EVP_PKEY_ALG_CTRL + 4)
22 # define EVP_PKEY_CTRL_HKDF_KEY (EVP_PKEY_ALG_CTRL + 5)
23 # define EVP_PKEY_CTRL_HKDF_INFO (EVP_PKEY_ALG_CTRL + 6)
25 # define EVP_PKEY_CTX_set_tls1_prf_md(pctx, md) \
26 EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
27 EVP_PKEY_CTRL_TLS_MD, 0, (void *)md)
29 # define EVP_PKEY_CTX_set1_tls1_prf_secret(pctx, sec, seclen) \
30 EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
31 EVP_PKEY_CTRL_TLS_SECRET, seclen, (void *)sec)
33 # define EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, seed, seedlen) \
34 EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
35 EVP_PKEY_CTRL_TLS_SEED, seedlen, (void *)seed)
37 # define EVP_PKEY_CTX_set_hkdf_md(pctx, md) \
38 EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
39 EVP_PKEY_CTRL_HKDF_MD, 0, (void *)md)
41 # define EVP_PKEY_CTX_set1_hkdf_salt(pctx, salt, saltlen) \
42 EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
43 EVP_PKEY_CTRL_HKDF_SALT, saltlen, (void *)salt)
45 # define EVP_PKEY_CTX_set1_hkdf_key(pctx, key, keylen) \
46 EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
47 EVP_PKEY_CTRL_HKDF_KEY, keylen, (void *)key)
49 # define EVP_PKEY_CTX_add1_hkdf_info(pctx, info, infolen) \
50 EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
51 EVP_PKEY_CTRL_HKDF_INFO, infolen, (void *)info)
53 /* BEGIN ERROR CODES */
55 * The following lines are auto generated by the script mkerr.pl. Any changes
56 * made after this point may be overwritten when the script is next run.
58 void ERR_load_KDF_strings(void);
60 /* Error codes for the KDF functions. */
63 # define KDF_F_PKEY_TLS1_PRF_CTRL_STR 100
64 # define KDF_F_PKEY_TLS1_PRF_DERIVE 101
67 # define KDF_R_INVALID_DIGEST 100
68 # define KDF_R_MISSING_PARAMETER 101
69 # define KDF_R_VALUE_MISSING 102