Lines Matching refs:curve

911 	const struct ecc_curve *curve = ecc_get_curve(curve_id);  in ecc_is_key_valid()  local
925 if (vli_cmp(curve->n, private_key, ndigits) != 1) in ecc_is_key_valid()
945 const struct ecc_curve *curve = ecc_get_curve(curve_id); in ecc_gen_privkey() local
948 unsigned int nbits = vli_num_bits(curve->n, ndigits); in ecc_gen_privkey()
978 if (vli_cmp(curve->n, priv, ndigits) != 1) in ecc_gen_privkey()
992 const struct ecc_curve *curve = ecc_get_curve(curve_id); in ecc_make_pub_key() local
994 if (!private_key || !curve || ndigits > ARRAY_SIZE(priv)) { in ecc_make_pub_key()
1007 ecc_point_mult(pk, &curve->g, priv, NULL, curve->p, ndigits); in ecc_make_pub_key()
1023 static int ecc_is_pubkey_valid_partial(const struct ecc_curve *curve, in ecc_is_pubkey_valid_partial() argument
1033 if (vli_cmp(curve->p, pk->x, pk->ndigits) != 1) in ecc_is_pubkey_valid_partial()
1035 if (vli_cmp(curve->p, pk->y, pk->ndigits) != 1) in ecc_is_pubkey_valid_partial()
1039 vli_mod_square_fast(yy, pk->y, curve->p, pk->ndigits); /* y^2 */ in ecc_is_pubkey_valid_partial()
1040 vli_mod_square_fast(xxx, pk->x, curve->p, pk->ndigits); /* x^2 */ in ecc_is_pubkey_valid_partial()
1041 vli_mod_mult_fast(xxx, xxx, pk->x, curve->p, pk->ndigits); /* x^3 */ in ecc_is_pubkey_valid_partial()
1042 vli_mod_mult_fast(w, curve->a, pk->x, curve->p, pk->ndigits); /* a·x */ in ecc_is_pubkey_valid_partial()
1043 vli_mod_add(w, w, curve->b, curve->p, pk->ndigits); /* a·x + b */ in ecc_is_pubkey_valid_partial()
1044 vli_mod_add(w, w, xxx, curve->p, pk->ndigits); /* x^3 + a·x + b */ in ecc_is_pubkey_valid_partial()
1061 const struct ecc_curve *curve = ecc_get_curve(curve_id); in crypto_ecdh_shared_secret() local
1063 if (!private_key || !public_key || !curve || in crypto_ecdh_shared_secret()
1081 ret = ecc_is_pubkey_valid_partial(curve, pk); in crypto_ecdh_shared_secret()
1093 ecc_point_mult(product, pk, priv, rand_z, curve->p, ndigits); in crypto_ecdh_shared_secret()