/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/ecc/ |
A D | ltc_ecc_projective_dbl_point.c | 47 LTC_ARGCHK(modulus != NULL); in ltc_ecc_projective_dbl_point() 58 if ((err = ltc_ecc_is_point_at_infinity(P, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_projective_dbl_point() 67 if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 73 if (mp_cmp(R->z, modulus) != LTC_MP_LT) { in ltc_ecc_projective_dbl_point() 85 if (mp_cmp(t1, modulus) != LTC_MP_LT) { in ltc_ecc_projective_dbl_point() 93 if (mp_cmp(t1, modulus) != LTC_MP_LT) { in ltc_ecc_projective_dbl_point() 98 if (mp_cmp(t1, modulus) != LTC_MP_LT) { in ltc_ecc_projective_dbl_point() 114 if (mp_cmp(t1, modulus) != LTC_MP_LT) { in ltc_ecc_projective_dbl_point() 119 if (mp_cmp(t1, modulus) != LTC_MP_LT) { in ltc_ecc_projective_dbl_point() 124 if (mp_cmp(t1, modulus) != LTC_MP_LT) { in ltc_ecc_projective_dbl_point() [all …]
|
A D | ltc_ecc_projective_add_point.c | 31 LTC_ARGCHK(modulus != NULL); in ltc_ecc_projective_add_point() 38 if ((err = ltc_ecc_is_point_at_infinity(P, modulus, &inf)) != CRYPT_OK) return err; 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() 56 return ltc_ecc_projective_dbl_point(P, R, ma, modulus, mp); 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() 74 if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 77 if ((err = mp_montgomery_reduce(x, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 106 if (mp_cmp(t1, modulus) != LTC_MP_LT) { in ltc_ecc_projective_add_point() 111 if (mp_cmp(t1, modulus) != LTC_MP_LT) { in ltc_ecc_projective_add_point() 121 if (mp_cmp(t2, modulus) != LTC_MP_LT) { in ltc_ecc_projective_add_point() [all …]
|
A D | ltc_ecc_mulmod_timing.c | 25 int ltc_ecc_mulmod(void *k, const ecc_point *G, ecc_point *R, void *a, void *modulus, int map) in ltc_ecc_mulmod() argument 36 LTC_ARGCHK(modulus != NULL); in ltc_ecc_mulmod() 38 if ((err = ltc_ecc_is_point_at_infinity(G, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_mulmod() 45 if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 47 if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 52 if (mp_cmp(a_plus3, modulus) != LTC_MP_EQ) { in ltc_ecc_mulmod() 54 if ((err = mp_mulmod(a, mu, modulus, ma)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 75 if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 76 if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 77 if ((err = mp_mulmod(G->z, mu, modulus, tG->z)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() [all …]
|
A D | ltc_ecc_mul2add.c | 29 void *modulus) in ltc_ecc_mul2add() argument 44 LTC_ARGCHK(modulus != NULL); in ltc_ecc_mul2add() 87 if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { in ltc_ecc_mul2add() 93 if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { in ltc_ecc_mul2add() 98 …if ((err = mp_mulmod(A->x, mu, modulus, precomp[1]->x)) != CRYPT_OK) … in ltc_ecc_mul2add() 99 …if ((err = mp_mulmod(A->y, mu, modulus, precomp[1]->y)) != CRYPT_OK) … in ltc_ecc_mul2add() 100 …if ((err = mp_mulmod(A->z, mu, modulus, precomp[1]->z)) != CRYPT_OK) … in ltc_ecc_mul2add() 151 … if ((err = ltc_mp.ecc_ptdbl(C, C, ma, modulus, mp)) != CRYPT_OK) { goto ERR_MU; } in ltc_ecc_mul2add() 152 … if ((err = ltc_mp.ecc_ptdbl(C, C, ma, modulus, mp)) != CRYPT_OK) { goto ERR_MU; } in ltc_ecc_mul2add() 163 …if ((err = ltc_mp.ecc_ptadd(C, precomp[nA + (nB<<2)], C, ma, modulus, mp)) != CRYPT_OK) { goto ERR… in ltc_ecc_mul2add() [all …]
|
A D | ltc_ecc_mulmod.c | 26 int ltc_ecc_mulmod(void *k, const ecc_point *G, ecc_point *R, void *a, void *modulus, int map) in ltc_ecc_mulmod() argument 37 LTC_ARGCHK(modulus != NULL); in ltc_ecc_mulmod() 39 if ((err = ltc_ecc_is_point_at_infinity(G, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_mulmod() 46 if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 48 if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 53 if (mp_cmp(a_plus3, modulus) != LTC_MP_EQ) { in ltc_ecc_mulmod() 55 if ((err = mp_mulmod(a, mu, modulus, ma)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 78 if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 79 if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 80 if ((err = mp_mulmod(G->z, mu, modulus, tG->z)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() [all …]
|
A D | ltc_ecc_map.c | 20 int ltc_ecc_map(ecc_point *P, void *modulus, void *mp) in ltc_ecc_map() argument 26 LTC_ARGCHK(modulus != NULL); in ltc_ecc_map() 38 if ((err = mp_montgomery_reduce(P->z, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 41 if ((err = mp_invmod(P->z, modulus, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 45 if ((err = mp_mod(t2, modulus, t2)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 47 if ((err = mp_mod(t1, modulus, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 51 if ((err = mp_montgomery_reduce(P->x, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 53 if ((err = mp_montgomery_reduce(P->y, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
|
A D | ltc_ecc_is_point_at_infinity.c | 12 int ltc_ecc_is_point_at_infinity(const ecc_point *P, void *modulus, int *retval) in ltc_ecc_is_point_at_infinity() argument 33 if ((err = mp_mulmod(P->y, P->y, modulus, y2)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point_at_infinity() 36 if ((err = mp_mulmod(P->x, P->x, modulus, x3)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point_at_infinity() 37 if ((err = mp_mulmod(P->x, x3, modulus, x3)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point_at_infinity()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/math/ |
A D | tfm_desc.c | 431 LTC_ARGCHK(modulus != NULL); in tfm_ecc_projective_dbl_point() 531 fp_add(&t2, modulus, &t2); in tfm_ecc_projective_dbl_point() 587 LTC_ARGCHK(modulus != NULL); in tfm_ecc_projective_add_point() 617 fp_sub(modulus, Q->y, &t1); in tfm_ecc_projective_add_point() 660 fp_add(&y, modulus, &y); in tfm_ecc_projective_add_point() 665 fp_sub(&t1, modulus, &t1); in tfm_ecc_projective_add_point() 670 fp_sub(&t1, modulus, &t1); in tfm_ecc_projective_add_point() 675 fp_add(&x, modulus, &x); in tfm_ecc_projective_add_point() 718 fp_add(&x, modulus, &x); in tfm_ecc_projective_add_point() 737 fp_add(&y, modulus, &y); in tfm_ecc_projective_add_point() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/math/fp/ |
A D | ltc_ecc_fp_mulmod.c | 679 bitlen = mp_unsigned_bin_size(modulus) << 3; in s_build_lut() 782 y = mp_unsigned_bin_size(modulus); in s_accel_fp_mul() 818 bitlen = mp_unsigned_bin_size(modulus) << 3; in s_accel_fp_mul() 886 err = ltc_ecc_map(R, modulus, mp); in s_accel_fp_mul() 907 y = mp_unsigned_bin_size(modulus); in ss_accel_fp_mul2add() 945 y = mp_unsigned_bin_size(modulus); in ss_accel_fp_mul2add() 981 bitlen = mp_unsigned_bin_size(modulus) << 3; in ss_accel_fp_mul2add() 1092 return ltc_ecc_map(R, modulus, mp); in ss_accel_fp_mul2add() 1109 void *modulus) in ltc_ecc_fp_mul2add() argument 1276 err = ltc_ecc_mulmod(k, G, R, a, modulus, map); in ltc_ecc_fp_mulmod() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_math.h | 388 void *modulus, 404 void *modulus, 418 void *modulus, 431 int (*ecc_map)(ecc_point *P, void *modulus, void *mp); 447 void *modulus);
|
A D | tomcrypt_private.h | 298 int ltc_ecc_is_point_at_infinity(const ecc_point *P, void *modulus, int *retval); 306 int ltc_ecc_projective_dbl_point(const ecc_point *P, ecc_point *R, void *ma, void *modulus, void *m… 309 …add_point(const ecc_point *P, const ecc_point *Q, ecc_point *R, void *ma, void *modulus, void *mp); 314 int ltc_ecc_fp_mulmod(void *k, ecc_point *G, ecc_point *R, void *a, void *modulus, int map); 320 int ltc_ecc_fp_add_point(ecc_point *g, void *modulus, int lock); 327 int ltc_ecc_mulmod(void *k, const ecc_point *G, ecc_point *R, void *a, void *modulus, int map); 335 void *modulus); 343 void *modulus); 350 int ltc_ecc_map(ecc_point *P, void *modulus, void *mp);
|
/optee_os-3.20.0/core/drivers/crypto/crypto_api/math/ |
A D | sub.mk | 1 srcs-y += modulus.c
|
/optee_os-3.20.0/core/crypto/ |
A D | signed_hdr.c | 132 const struct shdr_subkey_attr *modulus = NULL; in load_rsa_key() local 139 modulus = find_attr(subkey, TEE_ATTR_RSA_MODULUS); in load_rsa_key() 140 if (!modulus) in load_rsa_key() 146 res = crypto_acipher_alloc_rsa_public_key(key, modulus->size * 8); in load_rsa_key() 153 res = crypto_bignum_bin2bn(base + modulus->offs, modulus->size, key->n); in load_rsa_key()
|
/optee_os-3.20.0/lib/libutee/include/ |
A D | tee_internal_api.h | 355 const TEE_BigInt *modulus);
|
/optee_os-3.20.0/lib/libutee/ |
A D | tee_api_arith_mpi.c | 795 const TEE_BigInt *modulus __unused) in TEE_BigIntInitFMMContext()
|
/optee_os-3.20.0/lib/libmbedtls/mbedtls/ |
A D | ChangeLog | 2406 modulus 1 and therefore to hang. Found by blaufish. #641.
|