Lines Matching defs:key
301 const ECX_KEY *key = pkey->pkey.ecx;
308 if (key == NULL
309 || key->privkey == NULL
314 memcpy(priv, key->privkey, *len);
322 const ECX_KEY *key = pkey->pkey.ecx;
329 if (key == NULL
334 memcpy(pub, key->pubkey, *len);
342 * We provide no mechanism to "update" an ECX key once it has been set,
352 const ECX_KEY *key = from->pkey.ecx;
361 /* A key must at least have a public part */
363 key->pubkey, key->keylen))
367 if (key->privkey != NULL) {
370 key->privkey, key->keylen))
724 static int validate_ecx_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
751 static int pkey_ecx_derive25519(EVP_PKEY_CTX *ctx, unsigned char *key,
756 if (!validate_ecx_derive(ctx, key, keylen, &privkey, &pubkey)
757 || (key != NULL
758 && ossl_x25519(key, privkey, pubkey) == 0))
764 static int pkey_ecx_derive448(EVP_PKEY_CTX *ctx, unsigned char *key,
769 if (!validate_ecx_derive(ctx, key, keylen, &privkey, &pubkey)
770 || (key != NULL
771 && ossl_x448(key, privkey, pubkey) == 0))
779 /* Only need to handle peer key for derivation */
943 ECX_KEY *key = ossl_ecx_key_new(ctx->libctx, ECX_KEY_TYPE_X25519, 1,
947 if (key == NULL) {
952 pubkey = key->pubkey;
954 privkey = ossl_ecx_key_allocate_privkey(key);
970 EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, key);
973 ossl_ecx_key_free(key);
986 ECX_KEY *key = ossl_ecx_key_new(ctx->libctx, ECX_KEY_TYPE_X448, 1,
990 if (key == NULL) {
995 pubkey = key->pubkey;
997 privkey = ossl_ecx_key_allocate_privkey(key);
1012 EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, key);
1015 ossl_ecx_key_free(key);
1032 ECX_KEY *key = ossl_ecx_key_new(ctx->libctx, ECX_KEY_TYPE_ED25519, 1,
1039 if (key == NULL) {
1044 pubkey = key->pubkey;
1046 privkey = ossl_ecx_key_allocate_privkey(key);
1074 EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, key);
1077 ossl_ecx_key_free(key);
1098 ECX_KEY *key = ossl_ecx_key_new(ctx->libctx, ECX_KEY_TYPE_ED448, 1,
1105 if (key == NULL) {
1110 pubkey = key->pubkey;
1112 privkey = ossl_ecx_key_allocate_privkey(key);
1149 EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, key);
1153 ossl_ecx_key_free(key);
1158 static int s390x_pkey_ecx_derive25519(EVP_PKEY_CTX *ctx, unsigned char *key,
1163 if (!validate_ecx_derive(ctx, key, keylen, &privkey, &pubkey)
1164 || (key != NULL
1165 && s390x_x25519_mul(key, privkey, pubkey) == 0))
1171 static int s390x_pkey_ecx_derive448(EVP_PKEY_CTX *ctx, unsigned char *key,
1176 if (!validate_ecx_derive(ctx, key, keylen, &privkey, &pubkey)
1177 || (key != NULL
1178 && s390x_x448_mul(key, pubkey, privkey) == 0))