Lines Matching full:curve

3  * Elliptic Curve (Russian) Digital Signature Algorithm for Cryptographic API
38 const struct ecc_curve *curve; /* curve from oid */ member
88 * Digest value, digest algorithm, and curve (modulus) should have the in ecrdsa_verify()
92 if (!ctx->curve || in ecrdsa_verify()
97 req->dst_len != ctx->curve->g.ndigits * sizeof(u64) || in ecrdsa_verify()
98 ctx->pub_key.ndigits != ctx->curve->g.ndigits || in ecrdsa_verify()
116 vli_cmp(r, ctx->curve->n, ndigits) >= 0 || in ecrdsa_verify()
118 vli_cmp(s, ctx->curve->n, ndigits) >= 0) in ecrdsa_verify()
124 if (vli_cmp(e, ctx->curve->n, ndigits) >= 0) in ecrdsa_verify()
125 vli_sub(e, e, ctx->curve->n, ndigits); in ecrdsa_verify()
130 vli_mod_inv(v, e, ctx->curve->n, ndigits); in ecrdsa_verify()
133 vli_mod_mult_slow(z1, s, v, ctx->curve->n, ndigits); in ecrdsa_verify()
134 vli_sub(_r, ctx->curve->n, r, ndigits); in ecrdsa_verify()
135 vli_mod_mult_slow(z2, _r, v, ctx->curve->n, ndigits); in ecrdsa_verify()
138 ecc_point_mult_shamir(&cc, z1, &ctx->curve->g, z2, &ctx->pub_key, in ecrdsa_verify()
139 ctx->curve); in ecrdsa_verify()
140 if (vli_cmp(cc.x, ctx->curve->n, ndigits) >= 0) in ecrdsa_verify()
141 vli_sub(cc.x, cc.x, ctx->curve->n, ndigits); in ecrdsa_verify()
158 ctx->curve = get_curve_by_oid(ctx->curve_oid); in ecrdsa_param_curve()
225 * Sizes of algo (set in digest_len) and curve should match in ecrdsa_set_pub_key()
228 if (!ctx->curve || in ecrdsa_set_pub_key()
229 ctx->curve->g.ndigits * sizeof(u64) != ctx->digest_len) in ecrdsa_set_pub_key()
233 * curve size. in ecrdsa_set_pub_key()
237 ctx->key_len != ctx->curve->g.ndigits * sizeof(u64) * 2) in ecrdsa_set_pub_key()
246 if (ecc_is_pubkey_valid_partial(ctx->curve, &ctx->pub_key)) in ecrdsa_set_pub_key()