Home
last modified time | relevance | path

Searched refs:nbits (Results 1 – 20 of 20) sorted by relevance

/mbedtls-3.5.0/programs/pkey/
Ddh_genprime.c66 int nbits = DFL_BITS; in main() local
88 nbits = atoi(q); in main()
89 if (nbits < 0 || nbits > MBEDTLS_MPI_MAX_BITS) { in main()
120 if ((ret = mbedtls_mpi_gen_prime(&P, nbits, 1, in main()
/mbedtls-3.5.0/library/
Dbignum.c1658 size_t bufsize, nbits; in mbedtls_mpi_exp_mod() local
1832 nbits = 0; in mbedtls_mpi_exp_mod()
1871 nbits++; in mbedtls_mpi_exp_mod()
1872 exponent_bits_in_window |= (ei << (window_bitsize - nbits)); in mbedtls_mpi_exp_mod()
1874 if (nbits == window_bitsize) { in mbedtls_mpi_exp_mod()
1892 nbits = 0; in mbedtls_mpi_exp_mod()
1900 for (i = 0; i < nbits; i++) { in mbedtls_mpi_exp_mod()
2398 int mbedtls_mpi_gen_prime(mbedtls_mpi *X, size_t nbits, int flags, in mbedtls_mpi_gen_prime() argument
2418 if (nbits < 3 || nbits > MBEDTLS_MPI_MAX_BITS) { in mbedtls_mpi_gen_prime()
2424 n = BITS_TO_LIMBS(nbits); in mbedtls_mpi_gen_prime()
[all …]
Dpsa_crypto_ecp.c183 *bits = ecp->grp.nbits + 1; in mbedtls_psa_ecp_import_key()
185 *bits = ecp->grp.nbits; in mbedtls_psa_ecp_import_key()
237 if (data_size < PSA_BITS_TO_BYTES(ecp->grp.nbits)) { in mbedtls_psa_ecp_export_key()
244 PSA_BITS_TO_BYTES(ecp->grp.nbits))); in mbedtls_psa_ecp_export_key()
246 *data_length = PSA_BITS_TO_BYTES(ecp->grp.nbits); in mbedtls_psa_ecp_export_key()
Decdsa.c219 size_t n_size = (grp->nbits + 7) / 8; in derive_mpi()
223 if (use_size * 8 > grp->nbits) { in derive_mpi()
224 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(x, use_size * 8 - grp->nbits)); in derive_mpi()
421 size_t grp_len = (grp->nbits + 7) / 8; in mbedtls_ecdsa_sign_det_restartable()
Drsa.c541 unsigned int nbits, int exponent) in mbedtls_rsa_gen_key() argument
552 if (nbits > 1024) { in mbedtls_rsa_gen_key()
560 if (nbits < 128 || exponent < 3 || nbits % 2 != 0) { in mbedtls_rsa_gen_key()
574 MBEDTLS_MPI_CHK(mbedtls_mpi_gen_prime(&ctx->P, nbits >> 1, in mbedtls_rsa_gen_key()
577 MBEDTLS_MPI_CHK(mbedtls_mpi_gen_prime(&ctx->Q, nbits >> 1, in mbedtls_rsa_gen_key()
582 if (mbedtls_mpi_bitlen(&H) <= ((nbits >= 200) ? ((nbits >> 1) - 99) : 0)) { in mbedtls_rsa_gen_key()
607 … if (mbedtls_mpi_bitlen(&ctx->D) <= ((nbits + 1) / 2)) { // (FIPS 186-4 §B.3.1 criterion 3(a)) in mbedtls_rsa_gen_key()
Decp.c526 grp->nbits = 0; in mbedtls_ecp_group_init()
2252 w = grp->nbits >= 384 ? 5 : 4; in ecp_pick_window_size()
2277 if (w >= grp->nbits) { in ecp_pick_window_size()
2322 d = (grp->nbits + w - 1) / w; in ecp_mul_comb()
2588 i = grp->nbits + 1; /* one past the (zero-based) required msb for private keys */ in ecp_mul_mxz()
3014 if (mbedtls_mpi_size(&pt->X) > (grp->nbits + 7) / 8) { in ecp_check_pubkey_mx()
3064 mbedtls_mpi_bitlen(d) - 1 != grp->nbits) { /* mbedtls_mpi_bitlen is one-based! */ in mbedtls_ecp_check_privkey()
3069 if (grp->nbits == 254 && mbedtls_mpi_get_bit(d, 2) != 0) { in mbedtls_ecp_check_privkey()
3149 return mbedtls_ecp_gen_privkey_mx(grp->nbits, d, f_rng, p_rng); in mbedtls_ecp_gen_privkey()
3423 MBEDTLS_MPI_CHK(mbedtls_mpi_set_bit(m, grp->nbits, 1)); in self_test_adjust_exponent()
[all …]
Dpkparse.c361 grp->nbits = mbedtls_mpi_bitlen(&grp->N); in pk_group_from_specified()
388 if (grp->pbits == ref.pbits && grp->nbits == ref.nbits && in pk_group_id_from_group()
Dpk.c886 d_len = PSA_BITS_TO_BYTES(ec->grp.nbits); in mbedtls_pk_wrap_as_opaque()
Decp_curves.c4555 grp->nbits = mbedtls_mpi_bitlen(&grp->N); in ecp_group_load()
4682 grp->nbits = 254; in ecp_use_curve25519()
4743 grp->nbits = 447; in ecp_use_curve448()
Dpk_wrap.c740 const size_t signature_part_size = (ctx->grp.nbits + 7) / 8; in ecdsa_verify_wrap()
Dpsa_crypto.c3591 operation->ctx->grp.nbits);
3808 coordinate_bytes = PSA_BITS_TO_BYTES(operation->ctx->grp.nbits);
5602 size_t m = ecp_group.nbits;
/mbedtls-3.5.0/tests/suites/
Dtest_suite_ecdh.function129 if (grp.nbits % 8 != 0) {
130 unsigned char shift = 8 - (grp.nbits % 8);
147 if (grp.nbits % 8 != 0) {
148 unsigned char shift = 8 - (grp.nbits % 8);
274 TEST_ASSERT(grp.nbits % 8 == 0);
Dtest_suite_ecdsa.function111 if (grp.nbits % 8 != 0) {
112 unsigned char shift = 8 - (grp.nbits % 8);
Dtest_suite_ecp.function47 if (grp1->nbits != grp2->nbits) {
/mbedtls-3.5.0/tests/include/alt-dummy/
Decp_alt.h30 const size_t nbits; member
/mbedtls-3.5.0/include/mbedtls/
Drsa.h466 unsigned int nbits, int exponent);
Dbignum.h1052 int mbedtls_mpi_gen_prime(mbedtls_mpi *X, size_t nbits, int flags,
Decp.h242 size_t nbits; /*!< For Short Weierstrass: The number of bits in \p P. member
/mbedtls-3.5.0/docs/architecture/
Dalternative-implementations.md51 * ECP: `mbedtls_ecp_group` must have the fields `id`, `P`, `A`, `B`, `G`, `N`, `pbits` and `nbits`.
/mbedtls-3.5.0/
DChangeLog5416 * Updated rsa_gen_key() so that ctx->N is always nbits in size