Lines Matching refs:ndigits
26 unsigned int ndigits = curve->g.ndigits; in _ecdsa_verify() local
32 struct ecc_point res = ECC_POINT_INIT(x1, y1, ndigits); in _ecdsa_verify()
35 if (vli_is_zero(r, ndigits) || vli_cmp(r, curve->n, ndigits) >= 0 || in _ecdsa_verify()
36 vli_is_zero(s, ndigits) || vli_cmp(s, curve->n, ndigits) >= 0) in _ecdsa_verify()
41 hash[ndigits - 1], hash[ndigits - 2], hash[0]); in _ecdsa_verify()
44 vli_mod_inv(s1, s, curve->n, ndigits); in _ecdsa_verify()
46 vli_mod_mult_slow(u1, hash, s1, curve->n, ndigits); in _ecdsa_verify()
48 vli_mod_mult_slow(u2, r, s1, curve->n, ndigits); in _ecdsa_verify()
53 if (unlikely(vli_cmp(res.x, curve->n, ndigits) == 1)) in _ecdsa_verify()
55 vli_sub(res.x, res.x, curve->n, ndigits); in _ecdsa_verify()
57 if (!vli_cmp(res.x, r, ndigits)) in _ecdsa_verify()
71 size_t bufsize = ctx->curve->g.ndigits * sizeof(u64); in ecdsa_verify()
84 ecc_digits_from_bytes(digest, bufsize, hash, ctx->curve->g.ndigits); in ecdsa_verify()
114 ctx->curve->g.ndigits); in ecdsa_ecc_ctx_reset()
126 unsigned int digitlen, ndigits; in ecdsa_set_pub_key() local
143 ndigits = DIV_ROUND_UP(digitlen, sizeof(u64)); in ecdsa_set_pub_key()
144 if (ndigits != ctx->curve->g.ndigits) in ecdsa_set_pub_key()
149 ecc_digits_from_bytes(d, digitlen, ctx->pub_key.x, ndigits); in ecdsa_set_pub_key()
150 ecc_digits_from_bytes(&d[digitlen], digitlen, ctx->pub_key.y, ndigits); in ecdsa_set_pub_key()