Lines Matching refs:ctx
38 struct ecdh_ctx *ctx = ecdh_get_ctx(tfm); in ecdh_set_secret() local
43 params.key_size > sizeof(ctx->private_key)) in ecdh_set_secret()
50 ctx->curve_id = params.curve_id; in ecdh_set_secret()
51 ctx->ndigits = ndigits; in ecdh_set_secret()
54 return ecc_gen_privkey(ctx->curve_id, ctx->ndigits, in ecdh_set_secret()
55 ctx->private_key); in ecdh_set_secret()
57 memcpy(ctx->private_key, params.key, params.key_size); in ecdh_set_secret()
59 if (ecc_is_key_valid(ctx->curve_id, ctx->ndigits, in ecdh_set_secret()
60 ctx->private_key, params.key_size) < 0) { in ecdh_set_secret()
61 memzero_explicit(ctx->private_key, params.key_size); in ecdh_set_secret()
70 struct ecdh_ctx *ctx = ecdh_get_ctx(tfm); in ecdh_compute_value() local
77 nbytes = ctx->ndigits << ECC_DIGITS_TO_BYTES_SHIFT; in ecdh_compute_value()
104 ret = crypto_ecdh_shared_secret(ctx->curve_id, ctx->ndigits, in ecdh_compute_value()
105 ctx->private_key, public_key, in ecdh_compute_value()
110 ret = ecc_make_pub_key(ctx->curve_id, ctx->ndigits, in ecdh_compute_value()
111 ctx->private_key, public_key); in ecdh_compute_value()
137 struct ecdh_ctx *ctx = ecdh_get_ctx(tfm); in ecdh_max_size() local
140 return ctx->ndigits << (ECC_DIGITS_TO_BYTES_SHIFT + 1); in ecdh_max_size()