Lines Matching refs: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,
43 if (EVP_PKEY_CTX_add1_tls1_prf_seed(pctx,
48 if (EVP_PKEY_derive(pctx, out, &outlen) <= 0) {
64 EVP_PKEY_CTX_free(pctx);
71 EVP_PKEY_CTX *pctx;
75 if ((pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL)) == NULL) {
79 if (EVP_PKEY_derive_init(pctx) <= 0) {
83 if (EVP_PKEY_CTX_set_hkdf_md(pctx, EVP_sha256()) <= 0) {
87 if (EVP_PKEY_CTX_set1_hkdf_salt(pctx, (const unsigned char *)"salt", 4)
92 if (EVP_PKEY_CTX_set1_hkdf_key(pctx, (const unsigned char *)"secret", 6)
97 if (EVP_PKEY_CTX_add1_hkdf_info(pctx, (const unsigned char *)"label", 5)
102 if (EVP_PKEY_derive(pctx, out, &outlen) <= 0) {
117 EVP_PKEY_CTX_free(pctx);
125 EVP_PKEY_CTX *pctx;
129 if ((pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_SCRYPT, NULL)) == NULL) {
133 if (EVP_PKEY_derive_init(pctx) <= 0) {
137 if (EVP_PKEY_CTX_set1_pbe_pass(pctx, "password", 8) <= 0) {
141 if (EVP_PKEY_CTX_set1_scrypt_salt(pctx, (unsigned char *)"NaCl", 4) <= 0) {
145 if (EVP_PKEY_CTX_set_scrypt_N(pctx, 1024) <= 0) {
149 if (EVP_PKEY_CTX_set_scrypt_r(pctx, 8) <= 0) {
153 if (EVP_PKEY_CTX_set_scrypt_p(pctx, 16) <= 0) {
157 if (EVP_PKEY_CTX_set_scrypt_maxmem_bytes(pctx, 16) <= 0) {
161 if (EVP_PKEY_derive(pctx, out, &outlen) > 0) {
165 if (EVP_PKEY_CTX_set_scrypt_maxmem_bytes(pctx, 10 * 1024 * 1024) <= 0) {
169 if (EVP_PKEY_derive(pctx, out, &outlen) <= 0) {
191 EVP_PKEY_CTX_free(pctx);