Lines Matching defs:pctx

22     EVP_PKEY_CTX *pctx;
26 if ((pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_TLS1_PRF, NULL)) == NULL) {
30 if (EVP_PKEY_derive_init(pctx) <= 0) {
34 if (EVP_PKEY_CTX_set_tls1_prf_md(pctx, EVP_sha256()) <= 0) {
38 if (EVP_PKEY_CTX_set1_tls1_prf_secret(pctx,
44 if (EVP_PKEY_CTX_add1_tls1_prf_seed(pctx,
50 if (EVP_PKEY_CTX_add1_tls1_prf_seed(pctx,
55 if (EVP_PKEY_CTX_add1_tls1_prf_seed(pctx,
61 if (EVP_PKEY_derive(pctx, out, &outlen) <= 0) {
77 EVP_PKEY_CTX_free(pctx);
84 EVP_PKEY_CTX *pctx;
88 if ((pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL)) == NULL) {
92 if (EVP_PKEY_derive_init(pctx) <= 0) {
96 if (EVP_PKEY_CTX_set_hkdf_md(pctx, EVP_sha256()) <= 0) {
100 if (EVP_PKEY_CTX_set1_hkdf_salt(pctx, (const unsigned char *)"salt", 4)
105 if (EVP_PKEY_CTX_set1_hkdf_key(pctx, (const unsigned char *)"secret", 6)
111 if (EVP_PKEY_CTX_add1_hkdf_info(pctx, (const unsigned char *)"label", 5)
117 if (EVP_PKEY_CTX_add1_hkdf_info(pctx, (const unsigned char *)"lab", 3)
122 if (EVP_PKEY_CTX_add1_hkdf_info(pctx, (const unsigned char *)"el", 2)
128 if (EVP_PKEY_derive(pctx, out, &outlen) <= 0) {
143 EVP_PKEY_CTX_free(pctx);
151 EVP_PKEY_CTX *pctx;
155 if ((pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_SCRYPT, NULL)) == NULL) {
159 if (EVP_PKEY_derive_init(pctx) <= 0) {
163 if (EVP_PKEY_CTX_set1_pbe_pass(pctx, "password", 8) <= 0) {
167 if (EVP_PKEY_CTX_set1_scrypt_salt(pctx, (unsigned char *)"NaCl", 4) <= 0) {
171 if (EVP_PKEY_CTX_set_scrypt_N(pctx, 1024) <= 0) {
175 if (EVP_PKEY_CTX_set_scrypt_r(pctx, 8) <= 0) {
179 if (EVP_PKEY_CTX_set_scrypt_p(pctx, 16) <= 0) {
183 if (EVP_PKEY_CTX_set_scrypt_maxmem_bytes(pctx, 16) <= 0) {
187 if (EVP_PKEY_derive(pctx, out, &outlen) > 0) {
191 if (EVP_PKEY_CTX_set_scrypt_maxmem_bytes(pctx, 10 * 1024 * 1024) <= 0) {
195 if (EVP_PKEY_derive(pctx, out, &outlen) <= 0) {
217 EVP_PKEY_CTX_free(pctx);