| /optee_os/lib/libmbedtls/mbedtls/library/ |
| H A D | rsa_alt_helpers.c | 52 mbedtls_mpi *P, mbedtls_mpi *Q) in mbedtls_rsa_deduce_primes() argument 75 if (P == NULL || Q == NULL || P->p != NULL || Q->p != NULL) { in mbedtls_rsa_deduce_primes() 128 Q /* temporarily use Q for storing Montgomery in mbedtls_rsa_deduce_primes() 148 MBEDTLS_MPI_CHK(mbedtls_mpi_div_mpi(Q, NULL, N, P)); in mbedtls_rsa_deduce_primes() 183 mbedtls_mpi const *Q, in mbedtls_rsa_deduce_private_exponent() argument 195 mbedtls_mpi_cmp_int(Q, 1) <= 0 || in mbedtls_rsa_deduce_private_exponent() 205 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&L, Q, 1)); in mbedtls_rsa_deduce_private_exponent() 225 int mbedtls_rsa_deduce_crt(const mbedtls_mpi *P, const mbedtls_mpi *Q, in mbedtls_rsa_deduce_crt() argument 241 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&K, Q, 1)); in mbedtls_rsa_deduce_crt() 247 MBEDTLS_MPI_CHK(mbedtls_mpi_inv_mod(QP, Q, P)); in mbedtls_rsa_deduce_crt() [all …]
|
| H A D | rsa_alt_helpers.h | 79 mbedtls_mpi *P, mbedtls_mpi *Q); 103 mbedtls_mpi const *Q, 128 int mbedtls_rsa_deduce_crt(const mbedtls_mpi *P, const mbedtls_mpi *Q, 164 const mbedtls_mpi *Q, const mbedtls_mpi *D, 198 int mbedtls_rsa_validate_crt(const mbedtls_mpi *P, const mbedtls_mpi *Q,
|
| H A D | ecdh.c | 55 mbedtls_mpi *d, mbedtls_ecp_point *Q, in ecdh_gen_public_restartable() argument 71 MBEDTLS_MPI_CHK(mbedtls_ecp_mul_restartable(grp, Q, d, &grp->G, in ecdh_gen_public_restartable() 81 int mbedtls_ecdh_gen_public(mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q, in mbedtls_ecdh_gen_public() argument 85 return ecdh_gen_public_restartable(grp, d, Q, f_rng, p_rng, NULL); in mbedtls_ecdh_gen_public() 95 const mbedtls_ecp_point *Q, const mbedtls_mpi *d, in ecdh_compute_shared_restartable() argument 105 MBEDTLS_MPI_CHK(mbedtls_ecp_mul_restartable(grp, &P, d, Q, in ecdh_compute_shared_restartable() 125 const mbedtls_ecp_point *Q, const mbedtls_mpi *d, in mbedtls_ecdh_compute_shared() argument 129 return ecdh_compute_shared_restartable(grp, z, Q, d, in mbedtls_ecdh_compute_shared() 138 mbedtls_ecp_point_init(&ctx->Q); in ecdh_init_internal() 220 mbedtls_ecp_point_free(&ctx->Q); in ecdh_free_internal() [all …]
|
| H A D | ecp.c | 542 mbedtls_ecp_point_init(&key->Q); in mbedtls_ecp_keypair_init() 615 mbedtls_ecp_point_free(&key->Q); in mbedtls_ecp_keypair_free() 621 int mbedtls_ecp_copy(mbedtls_ecp_point *P, const mbedtls_ecp_point *Q) in mbedtls_ecp_copy() argument 624 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&P->X, &Q->X)); in mbedtls_ecp_copy() 625 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&P->Y, &Q->Y)); in mbedtls_ecp_copy() 626 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&P->Z, &Q->Z)); in mbedtls_ecp_copy() 666 const mbedtls_ecp_point *Q) in mbedtls_ecp_point_cmp() argument 668 if (mbedtls_mpi_cmp_mpi(&P->X, &Q->X) == 0 && in mbedtls_ecp_point_cmp() 669 mbedtls_mpi_cmp_mpi(&P->Y, &Q->Y) == 0 && in mbedtls_ecp_point_cmp() 670 mbedtls_mpi_cmp_mpi(&P->Z, &Q->Z) == 0) { in mbedtls_ecp_point_cmp() [all …]
|
| H A D | pk_ecc.c | 132 return mbedtls_ecp_point_read_binary(&eck->grp, &eck->Q, pub, pub_len); in mbedtls_pk_ecc_set_pubkey_from_prv() 140 return mbedtls_ecp_mul(&eck->grp, &eck->Q, &eck->d, &eck->grp.G, f_rng, p_rng); in mbedtls_pk_ecc_set_pubkey_from_prv() 187 ret = mbedtls_ecp_point_read_binary(&(ecp_key.grp), &ecp_key.Q, in pk_ecc_set_pubkey_psa_ecp_fallback() 192 ret = mbedtls_ecp_point_write_binary(&(ecp_key.grp), &ecp_key.Q, in pk_ecc_set_pubkey_psa_ecp_fallback() 246 ret = mbedtls_ecp_point_read_binary(&ec_key->grp, &ec_key->Q, pub, pub_len); in mbedtls_pk_ecc_set_pubkey() 250 return mbedtls_ecp_check_pubkey(&ec_key->grp, &ec_key->Q); in mbedtls_pk_ecc_set_pubkey()
|
| H A D | rsa.c | 576 const mbedtls_mpi *P, const mbedtls_mpi *Q, in mbedtls_rsa_import() argument 583 (Q != NULL && (ret = mbedtls_mpi_copy(&ctx->Q, Q)) != 0) || in mbedtls_rsa_import() 599 unsigned char const *Q, size_t Q_len, in mbedtls_rsa_import_raw() argument 614 if (Q != NULL) { in mbedtls_rsa_import_raw() 615 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&ctx->Q, Q, Q_len)); in mbedtls_rsa_import_raw() 672 mbedtls_mpi_cmp_int(&ctx->Q, 0) <= 0 || in rsa_check_context() 673 mbedtls_mpi_get_bit(&ctx->Q, 0) == 0)) { in rsa_check_context() 707 mbedtls_mpi_cmp_int(&ctx->Q, 0) <= 0)) { in rsa_check_context() 735 have_Q = (mbedtls_mpi_cmp_int(&ctx->Q, 0) != 0); in mbedtls_rsa_complete() 773 &ctx->Q)) != 0) { in mbedtls_rsa_complete() [all …]
|
| H A D | ecp_internal_alt.h | 157 const mbedtls_ecp_point *Q); 241 const mbedtls_ecp_point *Q,
|
| H A D | psa_crypto_ecp.c | 163 mbedtls_ecp_point_read_binary(&ecp->grp, &ecp->Q, in mbedtls_psa_ecp_load_representation() 172 mbedtls_ecp_check_pubkey(&ecp->grp, &ecp->Q)); in mbedtls_psa_ecp_load_representation() 261 if (mbedtls_ecp_is_zero(&ecp->Q)) { in mbedtls_psa_ecp_export_key() 264 mbedtls_ecp_mul(&ecp->grp, &ecp->Q, &ecp->d, &ecp->grp.G, in mbedtls_psa_ecp_export_key() 273 mbedtls_ecp_point_write_binary(&ecp->grp, &ecp->Q, in mbedtls_psa_ecp_export_key() 439 if (mbedtls_ecp_is_zero(&ecp->Q)) { in mbedtls_psa_ecp_load_public_part() 440 ret = mbedtls_ecp_mul(&ecp->grp, &ecp->Q, in mbedtls_psa_ecp_load_public_part() 500 hash_length, &ecp->Q, in mbedtls_psa_ecdsa_verify_hash()
|
| H A D | ecdsa.c | 490 const mbedtls_ecp_point *Q, in mbedtls_ecdsa_verify_restartable() argument 562 &R, pu1, &grp->G, pu2, Q, ECDSA_RS_ECP)); in mbedtls_ecdsa_verify_restartable() 598 const mbedtls_ecp_point *Q, in mbedtls_ecdsa_verify() argument 602 return mbedtls_ecdsa_verify_restartable(grp, buf, blen, Q, r, s, NULL); in mbedtls_ecdsa_verify() 748 &ctx->Q, &r, &s)) != 0) { in mbedtls_ecdsa_read_signature_restartable() 753 &ctx->Q, &r, &s, rs_ctx)) != 0) { in mbedtls_ecdsa_read_signature_restartable() 786 &ctx->Q, f_rng, p_rng); in mbedtls_ecdsa_genkey() 798 (ret = mbedtls_ecp_copy(&ctx->Q, &key->Q)) != 0) { in mbedtls_ecdsa_from_keypair()
|
| H A D | bignum.c | 1444 int mbedtls_mpi_div_mpi(mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A, in mbedtls_mpi_div_mpi() argument 1470 if (Q != NULL) { in mbedtls_mpi_div_mpi() 1471 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(Q, 0)); in mbedtls_mpi_div_mpi() 1540 if (Q != NULL) { in mbedtls_mpi_div_mpi() 1541 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(Q, &Z)); in mbedtls_mpi_div_mpi() 1542 Q->s = A->s * B->s; in mbedtls_mpi_div_mpi() 1567 int mbedtls_mpi_div_int(mbedtls_mpi *Q, mbedtls_mpi *R, in mbedtls_mpi_div_int() argument 1579 return mbedtls_mpi_div_mpi(Q, R, A, &B); in mbedtls_mpi_div_int()
|
| H A D | pk_wrap.c | 659 ret = mbedtls_ecp_point_write_binary(&ctx->grp, &ctx->Q, in ecdsa_verify_wrap() 1003 &mbedtls_pk_ec_rw(*pub)->Q, in eckey_check_pair_psa() 1065 &(mbedtls_pk_ec_ro(*pub)->Q), in ecdsa_opaque_check_pair_wrap() 1109 items->value = &(ecp->Q); in eckey_debug()
|
| H A D | ecp_curves_new.c | 5525 mbedtls_mpi_uint *Q = NULL; in mbedtls_ecp_mod_p448_raw() local 5533 Q = mbedtls_calloc(Q_limbs, ciL); in mbedtls_ecp_mod_p448_raw() 5535 if (Q == NULL) { in mbedtls_ecp_mod_p448_raw() 5555 memcpy(Q, (char *) M + P224_SIZE, P224_SIZE); in mbedtls_ecp_mod_p448_raw() 5556 memset((char *) Q + P224_SIZE, 0, P224_SIZE); in mbedtls_ecp_mod_p448_raw() 5561 (void) mbedtls_mpi_core_add(X, X, Q, Q_limbs); in mbedtls_ecp_mod_p448_raw() 5570 (void) mbedtls_mpi_core_add(M, M, Q, Q_limbs); in mbedtls_ecp_mod_p448_raw() 5612 mbedtls_free(Q); in mbedtls_ecp_mod_p448_raw()
|
| /optee_os/core/lib/libtomcrypt/src/pk/ecc/ |
| H A D | ltc_ecc_projective_add_point.c | 23 int ltc_ecc_projective_add_point(const ecc_point *P, const ecc_point *Q, ecc_point *R, void *ma, vo… in ltc_ecc_projective_add_point() argument 29 LTC_ARGCHK(Q != NULL); in ltc_ecc_projective_add_point() 41 err = ltc_ecc_copy_point(Q, R); in ltc_ecc_projective_add_point() 45 if ((err = ltc_ecc_is_point_at_infinity(Q, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_projective_add_point() 52 if ((mp_cmp(P->x, Q->x) == LTC_MP_EQ) && (mp_cmp(P->z, Q->z) == LTC_MP_EQ)) { in ltc_ecc_projective_add_point() 53 if (mp_cmp(P->y, Q->y) == LTC_MP_EQ) { in ltc_ecc_projective_add_point() 58 if ((err = mp_sub(modulus, Q->y, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 71 if (Q->z != NULL) { in ltc_ecc_projective_add_point() 73 if ((err = mp_sqr(Q->z, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 79 if ((err = mp_mul(Q->z, t1, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() [all …]
|
| /optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ |
| H A D | ecp.h | 433 mbedtls_ecp_point MBEDTLS_PRIVATE(Q); /*!< our public value */ 682 int mbedtls_ecp_copy(mbedtls_ecp_point *P, const mbedtls_ecp_point *Q); 733 const mbedtls_ecp_point *Q); 1066 const mbedtls_mpi *n, const mbedtls_ecp_point *Q); 1111 const mbedtls_mpi *n, const mbedtls_ecp_point *Q, 1216 mbedtls_mpi *d, mbedtls_ecp_point *Q, 1244 mbedtls_ecp_point *Q, 1295 const mbedtls_ecp_point *Q); 1512 mbedtls_mpi *d, mbedtls_ecp_point *Q);
|
| H A D | ecdh.h | 89 mbedtls_ecp_point MBEDTLS_PRIVATE(Q); /*!< The public key. */ 109 mbedtls_ecp_point MBEDTLS_PRIVATE(Q); /*!< The public key. */ 191 int mbedtls_ecdh_gen_public(mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q, 227 const mbedtls_ecp_point *Q, const mbedtls_mpi *d,
|
| H A D | rsa.h | 97 mbedtls_mpi MBEDTLS_PRIVATE(Q); /*!< The second prime factor. */ 231 const mbedtls_mpi *P, const mbedtls_mpi *Q, 271 unsigned char const *Q, size_t Q_len, 350 mbedtls_mpi *N, mbedtls_mpi *P, mbedtls_mpi *Q, 403 unsigned char *Q, size_t Q_len,
|
| H A D | ecdsa.h | 377 const mbedtls_ecp_point *Q, const mbedtls_mpi *r, 418 const mbedtls_ecp_point *Q,
|
| H A D | bignum.h | 826 int mbedtls_mpi_div_mpi(mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A, 847 int mbedtls_mpi_div_int(mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A,
|
| /optee_os/lib/libmbedtls/core/ |
| H A D | ecc.c | 138 if ((mbedtls_mpi_bitlen(&ecdsa.Q.X) > key_size_bits) || in ecc_generate_keypair() 139 (mbedtls_mpi_bitlen(&ecdsa.Q.Y) > key_size_bits) || in ecc_generate_keypair() 147 if (mbedtls_mpi_bitlen(&ecdsa.Q.Z) != 1) { in ecc_generate_keypair() 155 crypto_bignum_copy(key->x, (void *)&ecdsa.Q.X); in ecc_generate_keypair() 156 crypto_bignum_copy(key->y, (void *)&ecdsa.Q.Y); in ecc_generate_keypair() 276 ecdsa.Q.X = *(mbedtls_mpi *)key->x; in ecc_verify() 277 ecdsa.Q.Y = *(mbedtls_mpi *)key->y; in ecc_verify() 278 mbedtls_mpi_read_binary(&ecdsa.Q.Z, one, sizeof(one)); in ecc_verify() 296 lmd_res = mbedtls_ecdsa_verify(&ecdsa.grp, msg, msg_len, &ecdsa.Q, in ecc_verify() 306 mbedtls_mpi_init(&ecdsa.Q.X); in ecc_verify() [all …]
|
| H A D | rsa.c | 112 rsa->Q = *(mbedtls_mpi *)key->q; in rsa_complete_from_key_pair() 118 mbedtls_mpi_init_mempool(&rsa->Q); in rsa_complete_from_key_pair() 124 &rsa->P, &rsa->Q); in rsa_complete_from_key_pair() 131 lmd_res = mbedtls_rsa_deduce_crt(&rsa->P, &rsa->Q, &rsa->D, in rsa_complete_from_key_pair() 143 mbedtls_mpi_free(&rsa->Q); in rsa_complete_from_key_pair() 172 mbedtls_mpi_init(&rsa->Q); in mbd_rsa_free() 318 crypto_bignum_copy(key->q, (void *)&rsa.Q); in sw_crypto_acipher_gen_rsa_key()
|
| /optee_os/core/lib/libtomcrypt/src/math/ |
| H A D | gmp_desc.c | 287 mpz_t t1, C, Q, S, Z, M, T, R, two; in sqrtmod_prime() local 302 mpz_init(t1); mpz_init(C); mpz_init(Q); in sqrtmod_prime() 322 mpz_set(Q, prime); in sqrtmod_prime() 323 mpz_sub_ui(Q, Q, 1); in sqrtmod_prime() 327 while (mpz_even_p(Q)) { in sqrtmod_prime() 328 mpz_fdiv_q_2exp(Q, Q, 1); in sqrtmod_prime() 344 mpz_powm(C, Z, Q, prime); in sqrtmod_prime() 346 mpz_add_ui(t1, Q, 1); in sqrtmod_prime() 351 mpz_powm(T, n, Q, prime); in sqrtmod_prime() 390 mpz_clear(t1); mpz_clear(C); mpz_clear(Q); in sqrtmod_prime()
|
| H A D | tfm_desc.c | 578 static int tfm_ecc_projective_add_point(const ecc_point *P, const ecc_point *Q, ecc_point *R, void … in tfm_ecc_projective_add_point() argument 585 LTC_ARGCHK(Q != NULL); in tfm_ecc_projective_add_point() 601 ltc_mp.copy(Q->x, R->x); in tfm_ecc_projective_add_point() 602 ltc_mp.copy(Q->y, R->y); in tfm_ecc_projective_add_point() 603 ltc_mp.copy(Q->z, R->z); in tfm_ecc_projective_add_point() 607 if ((err = ltc_ecc_is_point_at_infinity(Q, modulus, &inf)) != CRYPT_OK) return err; in tfm_ecc_projective_add_point() 617 fp_sub(modulus, Q->y, &t1); in tfm_ecc_projective_add_point() 618 if ( (fp_cmp(P->x, Q->x) == FP_EQ) && in tfm_ecc_projective_add_point() 619 (Q->z != NULL && fp_cmp(P->z, Q->z) == FP_EQ) && in tfm_ecc_projective_add_point() 620 (fp_cmp(P->y, Q->y) == FP_EQ || fp_cmp(P->y, &t1) == FP_EQ)) { in tfm_ecc_projective_add_point() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/headers/ |
| H A D | tomcrypt_math.h | 401 const ecc_point *Q,
|
| /optee_os/core/arch/arm/dts/ |
| H A D | stm32mp135f-dk.dts | 452 /* VCO = 1066.0 MHz => P = 266 (AXI), Q = 266, R = 533 (DDR) */ 465 /* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */ 478 /* VCO = 600.0 MHz => P = 50, Q = 10, R = 50 */
|
| /optee_os/lib/libutils/compiler-rt/lib/builtins/ |
| H A D | int_types.h | 210 #define TF_C(x) x##Q
|