Home
last modified time | relevance | path

Searched refs:ndigits (Results 1 – 12 of 12) sorted by relevance

/openbmc/linux/crypto/
H A Decc.c99 p->ndigits = ndigits; in ecc_alloc_point()
539 vli_umult(t, r + ndigits, c, ndigits); in vli_mmod_special()
540 vli_clear(r + ndigits, ndigits); in vli_mmod_special()
544 vli_clear(t + ndigits, ndigits); in vli_mmod_special()
575 vli_clear(m + ndigits, ndigits); in vli_mmod_special2()
580 vli_clear(r + ndigits, ndigits); in vli_mmod_special2()
590 vli_set(q, qc + ndigits, ndigits); in vli_mmod_special2()
591 vli_clear(qc + ndigits, ndigits); in vli_mmod_special2()
672 vli_add(q + ndigits, q + ndigits, product + ndigits, ndigits); in vli_mmod_barrett()
680 vli_usub(r + ndigits, r + ndigits, carry, ndigits); in vli_mmod_barrett()
[all …]
H A Decrdsa.c98 ctx->pub_key.ndigits != ctx->curve->g.ndigits || in ecrdsa_verify()
111 vli_from_be64(s, sig, ndigits); in ecrdsa_verify()
112 vli_from_be64(r, sig + ndigits * sizeof(u64), ndigits); in ecrdsa_verify()
115 if (vli_is_zero(r, ndigits) || in ecrdsa_verify()
117 vli_is_zero(s, ndigits) || in ecrdsa_verify()
123 vli_from_le64(e, digest, ndigits); in ecrdsa_verify()
125 vli_sub(e, e, ctx->curve->n, ndigits); in ecrdsa_verify()
126 if (vli_is_zero(e, ndigits)) in ecrdsa_verify()
144 if (!vli_cmp(cc.x, r, ndigits)) in ecrdsa_verify()
195 unsigned int ndigits; in ecrdsa_set_pub_key() local
[all …]
H A Decdsa.c82 sig->curve->g.ndigits); in ecdsa_get_signature_r()
91 sig->curve->g.ndigits); in ecdsa_get_signature_s()
97 unsigned int ndigits = curve->g.ndigits; in _ecdsa_verify() local
106 if (vli_is_zero(r, ndigits) || vli_cmp(r, curve->n, ndigits) >= 0 || in _ecdsa_verify()
107 vli_is_zero(s, ndigits) || vli_cmp(s, curve->n, ndigits) >= 0) in _ecdsa_verify()
112 hash[ndigits - 1], hash[ndigits - 2], hash[0]); in _ecdsa_verify()
128 if (!vli_cmp(res.x, r, ndigits)) in _ecdsa_verify()
213 ctx->curve->g.ndigits); in ecdsa_ecc_ctx_reset()
227 unsigned int ndigits; in ecdsa_set_pub_key() local
242 if (ndigits != ctx->curve->g.ndigits) in ecdsa_set_pub_key()
[all …]
H A Decdh.c17 unsigned int ndigits; member
33 params.key_size > sizeof(u64) * ctx->ndigits) in ecdh_set_secret()
39 return ecc_gen_privkey(ctx->curve_id, ctx->ndigits, in ecdh_set_secret()
44 if (ecc_is_key_valid(ctx->curve_id, ctx->ndigits, in ecdh_set_secret()
62 nbytes = ctx->ndigits << ECC_DIGITS_TO_BYTES_SHIFT; in ecdh_compute_value()
89 ret = crypto_ecdh_shared_secret(ctx->curve_id, ctx->ndigits, in ecdh_compute_value()
95 ret = ecc_make_pub_key(ctx->curve_id, ctx->ndigits, in ecdh_compute_value()
125 return ctx->ndigits << (ECC_DIGITS_TO_BYTES_SHIFT + 1); in ecdh_max_size()
133 ctx->ndigits = ECC_CURVE_NIST_P192_DIGITS; in ecdh_nist_p192_init_tfm()
158 ctx->ndigits = ECC_CURVE_NIST_P256_DIGITS; in ecdh_nist_p256_init_tfm()
[all …]
H A Decrdsa_defs.h53 .ndigits = 256 / 64,
86 .ndigits = 256 / 64,
123 .ndigits = 256 / 64,
172 .ndigits = 512 / 64,
217 .ndigits = 512 / 64,
H A Decc_curve_defs.h23 .ndigits = 3,
49 .ndigits = 4,
81 .ndigits = 6,
100 .ndigits = 4,
/openbmc/linux/include/crypto/internal/
H A Decc.h42 #define ECC_POINT_INIT(x, y, ndigits) (struct ecc_point) { x, y, ndigits } argument
55 for (i = 0; i < ndigits; i++) in ecc_swap_digits()
56 out[i] = get_unaligned_be64(&src[ndigits - 1 - i]); in ecc_swap_digits()
69 int ecc_is_key_valid(unsigned int curve_id, unsigned int ndigits,
156 bool vli_is_zero(const u64 *vli, unsigned int ndigits);
168 int vli_cmp(const u64 *left, const u64 *right, unsigned int ndigits);
183 unsigned int ndigits);
212 unsigned int ndigits);
226 const u64 *mod, unsigned int ndigits);
236 unsigned int vli_num_bits(const u64 *vli, unsigned int ndigits);
[all …]
/openbmc/linux/drivers/crypto/intel/keembay/
H A Dkeembay-ocs-ecc.c342 if (vli_is_zero(scalar_out, ndigits)) in kmb_ecc_do_scalar_op()
358 if (WARN_ON(pk->ndigits != curve->g.ndigits)) in kmb_ocs_ecc_is_pubkey_valid_partial()
392 pk->ndigits, in kmb_ocs_ecc_is_pubkey_valid_partial()
399 pk->ndigits, in kmb_ocs_ecc_is_pubkey_valid_partial()
411 rc = vli_cmp(yy, w, pk->ndigits); in kmb_ocs_ecc_is_pubkey_valid_partial()
437 nQ = ecc_alloc_point(pk->ndigits); in kmb_ocs_ecc_is_pubkey_valid_full()
457 size_t ndigits = curve->g.ndigits; in kmb_ecc_is_key_valid() local
472 vli_sub(res, res, one, ndigits); in kmb_ecc_is_key_valid()
564 tctx->curve->g.ndigits); in kmb_ocs_ecdh_set_secret()
604 ecc_swap_digits(&pubk_buf[curve->g.ndigits], pk->y, curve->g.ndigits); in kmb_ecc_do_shared_secret()
[all …]
/openbmc/linux/net/bluetooth/
H A Decdh_helper.c28 static inline void swap_digits(u64 *in, u64 *out, unsigned int ndigits) in swap_digits() argument
32 for (i = 0; i < ndigits; i++) in swap_digits()
33 out[i] = __swab64(in[ndigits - 1 - i]); in swap_digits()
/openbmc/linux/include/crypto/
H A Decc_curve.h19 u8 ndigits; member
/openbmc/linux/scripts/mod/
H A Dfile2alias.c280 int ndigits; in do_usb_entry_multi() local
297 for (ndigits = 0 ; ndigits < sizeof(bcdDevice_lo) * 2 ; ndigits++) { in do_usb_entry_multi()
298 clo = (devlo >> (ndigits << 2)) & 0xf; in do_usb_entry_multi()
299 chi = ((devhi > 0x9999 ? 0x9999 : devhi) >> (ndigits << 2)) & 0xf; in do_usb_entry_multi()
314 for (ndigits = sizeof(bcdDevice_lo) * 2 - 1; devlo <= devhi; ndigits--) { in do_usb_entry_multi()
322 if (devlo == devhi || !ndigits) { in do_usb_entry_multi()
323 do_usb_entry(symval, devlo, ndigits, clo, chi, max, mod); in do_usb_entry_multi()
331 ndigits, clo, max, max, mod); in do_usb_entry_multi()
337 ndigits, 0x0, chi, max, mod); in do_usb_entry_multi()
/openbmc/linux/drivers/crypto/hisilicon/hpre/
H A Dhpre_crypto.c1258 unsigned int sz = cur_sz - (ndigits - 1) * sizeof(u64); in fill_curve_param()
1261 while (i < ndigits - 1) { in fill_curve_param()
1266 memcpy(addr + sizeof(u64) * i, &param[ndigits - 1], sz); in fill_curve_param()
1290 fill_curve_param(p, curve->p, cur_sz, curve->g.ndigits); in hpre_ecdh_fill_curve()
1291 fill_curve_param(a, curve->a, cur_sz, curve->g.ndigits); in hpre_ecdh_fill_curve()
1292 fill_curve_param(b, curve->b, cur_sz, curve->g.ndigits); in hpre_ecdh_fill_curve()
1293 fill_curve_param(x, curve->g.x, cur_sz, curve->g.ndigits); in hpre_ecdh_fill_curve()
1294 fill_curve_param(y, curve->g.y, cur_sz, curve->g.ndigits); in hpre_ecdh_fill_curve()
1295 fill_curve_param(n, curve->n, cur_sz, curve->g.ndigits); in hpre_ecdh_fill_curve()
1699 fill_curve_param(p, curve->p, len, curve->g.ndigits); in hpre_curve25519_fill_curve()
[all …]