/optee_os-3.20.0/core/lib/libtomcrypt/src/misc/crypt/ |
A D | crypt_inits.c | 16 ltc_mp = ltm_desc; in init_LTM() 23 ltc_mp = tfm_desc; in init_TFM() 30 ltc_mp = gmp_desc; in init_GMP() 41 ltc_mp = ltm_desc; in crypt_mp_init() 47 ltc_mp = tfm_desc; in crypt_mp_init() 53 ltc_mp = gmp_desc; in crypt_mp_init() 61 ltc_mp = EXT_MATH_LIB; in crypt_mp_init()
|
A D | crypt_fsa.c | 19 XMEMCPY(<c_mp, mp, sizeof(ltc_mp)); in crypt_fsa()
|
A D | crypt_ltc_mp_descriptor.c | 6 ltc_math_descriptor ltc_mp = { 0 }; variable
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_private.h | 166 #define mp_init(a) ltc_mp.init(a) 170 #define mp_clear(a) ltc_mp.deinit(a) 175 #define mp_neg(a, b) ltc_mp.neg(a, b) 176 #define mp_copy(a, b) ltc_mp.copy(a, b) 180 #define mp_get_int(a) ltc_mp.get_int(a) 195 #define mp_add(a, b, c) ltc_mp.add(a, b, c) 197 #define mp_sub(a, b, c) ltc_mp.sub(a, b, c) 199 #define mp_mul(a, b, c) ltc_mp.mul(a, b, c) 201 #define mp_sqr(a, b) ltc_mp.sqr(a, b) 204 #define mp_div_2(a, b) ltc_mp.div_2(a, b) [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/ecc/ |
A D | ltc_ecc_points.c | 47 if ((err = ltc_mp.set_int(p->x, x)) != CRYPT_OK) return err; in ltc_ecc_set_point_xyz() 48 if ((err = ltc_mp.set_int(p->y, y)) != CRYPT_OK) return err; in ltc_ecc_set_point_xyz() 49 if ((err = ltc_mp.set_int(p->z, z)) != CRYPT_OK) return err; in ltc_ecc_set_point_xyz() 56 if ((err = ltc_mp.copy(src->x, dst->x)) != CRYPT_OK) return err; in ltc_ecc_copy_point() 57 if ((err = ltc_mp.copy(src->y, dst->y)) != CRYPT_OK) return err; in ltc_ecc_copy_point() 58 if ((err = ltc_mp.copy(src->z, dst->z)) != CRYPT_OK) return err; in ltc_ecc_copy_point()
|
A D | ltc_ecc_verify_key.c | 25 if (ltc_mp.compare_d(key->pubkey.z, 1) == LTC_MP_EQ) { in ltc_ecc_verify_key() 26 if ((ltc_mp.compare(key->pubkey.x, prime) != LTC_MP_LT) || in ltc_ecc_verify_key() 27 (ltc_mp.compare(key->pubkey.y, prime) != LTC_MP_LT) || in ltc_ecc_verify_key() 28 (ltc_mp.compare_d(key->pubkey.x, 0) == LTC_MP_LT) || in ltc_ecc_verify_key() 29 (ltc_mp.compare_d(key->pubkey.y, 0) == LTC_MP_LT) || in ltc_ecc_verify_key()
|
A D | ltc_ecc_mulmod.c | 87 if ((err = ltc_mp.ecc_ptdbl(tG, M[0], ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 88 if ((err = ltc_mp.ecc_ptdbl(M[0], M[0], ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 89 if ((err = ltc_mp.ecc_ptdbl(M[0], M[0], ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 93 if ((err = ltc_mp.ecc_ptadd(M[j-9], tG, M[j-8], ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 112 bitcnt = (int) ltc_mp.bits_per_digit; in ltc_ecc_mulmod() 117 i = (buf >> (ltc_mp.bits_per_digit - 1)) & 1; in ltc_ecc_mulmod() 127 if ((err = ltc_mp.ecc_ptdbl(R, R, ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 146 if ((err = ltc_mp.ecc_ptdbl(R, R, ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 150 … if ((err = ltc_mp.ecc_ptadd(R, M[bitbuf-8], R, ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 164 if ((err = ltc_mp.ecc_ptdbl(R, R, ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() [all …]
|
A D | ltc_ecc_mulmod_timing.c | 85 if ((err = ltc_mp.ecc_ptdbl(tG, M[1], ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 111 if ((err = ltc_mp.ecc_ptadd(M[0], M[1], M[2], ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 112 if ((err = ltc_mp.ecc_ptdbl(M[1], M[2], ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 119 if ((err = ltc_mp.ecc_ptadd(M[0], M[1], M[2], ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 120 if ((err = ltc_mp.ecc_ptdbl(M[1], M[2], ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 124 if ((err = ltc_mp.ecc_ptadd(M[0], M[1], M[i^1], ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 125 if ((err = ltc_mp.ecc_ptdbl(M[i], M[i], ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
|
A D | ltc_ecc_mul2add.c | 107 …if ((err = ltc_mp.ecc_ptdbl(precomp[1], precomp[2], ma, modulus, mp)) != CRYPT_OK) … in ltc_ecc_mul2add() 108 …if ((err = ltc_mp.ecc_ptadd(precomp[1], precomp[2], precomp[3], ma, modulus, mp)) != CRYPT_OK) … in ltc_ecc_mul2add() 111 …if ((err = ltc_mp.ecc_ptdbl(precomp[1<<2], precomp[2<<2], ma, modulus, mp)) != CRYPT_OK) … in ltc_ecc_mul2add() 112 …if ((err = ltc_mp.ecc_ptadd(precomp[1<<2], precomp[2<<2], precomp[3<<2], ma, modulus, mp)) != CRYP… in ltc_ecc_mul2add() 117 …if ((err = ltc_mp.ecc_ptadd(precomp[x], precomp[(y<<2)], precomp[x+(y<<2)], ma, modulus, mp)) != C… 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()
|
A D | ecc_verify_hash.c | 172 if (ltc_mp.ecc_mul2add == NULL) { in ecc_verify_hash_ex() 173 …if ((err = ltc_mp.ecc_ptmul(u1, mG, mG, a, m, 0)) != CRYPT_OK) … in ecc_verify_hash_ex() 174 …if ((err = ltc_mp.ecc_ptmul(u2, mQ, mQ, a, m, 0)) != CRYPT_OK) … in ecc_verify_hash_ex() 177 …if ((err = ltc_mp.ecc_ptadd(mQ, mG, mG, ma, m, mp)) != CRYPT_OK) … in ecc_verify_hash_ex() 180 …if ((err = ltc_mp.ecc_map(mG, m, mp)) != CRYPT_OK) … in ecc_verify_hash_ex() 183 …if ((err = ltc_mp.ecc_mul2add(mG, u1, mQ, u2, mG, ma, m)) != CRYPT_OK) … in ecc_verify_hash_ex()
|
A D | ecc_make_key.c | 42 LTC_ARGCHK(ltc_mp.name != NULL); in ecc_generate_key() 58 …if ((err = ltc_mp.ecc_ptmul(key->k, &key->dp.base, &key->pubkey, key->dp.A, key->dp.prime, 1)) != … in ecc_generate_key()
|
A D | ecc_shared_secret.c | 48 …if ((err = ltc_mp.ecc_ptmul(private_key->k, &public_key->pubkey, result, a, prime, 1)) != CRYPT_OK… in ecc_shared_secret()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/dh/ |
A D | dh_set.c | 27 LTC_ARGCHK(ltc_mp.name != NULL); in dh_set_pg() 55 LTC_ARGCHK(ltc_mp.name != NULL); in dh_set_pg_groupsize() 90 LTC_ARGCHK(ltc_mp.name != NULL); in dh_set_key()
|
A D | dh_set_pg_dhparam.c | 23 LTC_ARGCHK(ltc_mp.name != NULL); in dh_set_pg_dhparam()
|
A D | dh_generate_key.c | 44 LTC_ARGCHK(ltc_mp.name != NULL); in dh_generate_key()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/rsa/ |
A D | rsa_set.c | 30 LTC_ARGCHK(ltc_mp.name != NULL); in rsa_set_key() 71 LTC_ARGCHK(ltc_mp.name != NULL); in rsa_set_factors() 109 LTC_ARGCHK(ltc_mp.name != NULL); in rsa_set_crt_params()
|
A D | rsa_import_x509.c | 34 LTC_ARGCHK(ltc_mp.name != NULL); in rsa_import_x509()
|
A D | rsa_decrypt_key.c | 75 if ((err = ltc_mp.rsa_me(in, inlen, tmp, &x, PK_PRIVATE, key)) != CRYPT_OK) { in rsa_decrypt_key_ex()
|
A D | rsa_encrypt_key.c | 89 return ltc_mp.rsa_me(out, x, out, outlen, PK_PUBLIC, key); in rsa_encrypt_key_ex()
|
/optee_os-3.20.0/core/lib/libtomcrypt/ |
A D | rsa.c | 189 ltc_mp.copy(ltc_tmp_key.d, key->d); in sw_crypto_acipher_gen_rsa_key() 190 ltc_mp.copy(ltc_tmp_key.N, key->n); in sw_crypto_acipher_gen_rsa_key() 191 ltc_mp.copy(ltc_tmp_key.p, key->p); in sw_crypto_acipher_gen_rsa_key() 192 ltc_mp.copy(ltc_tmp_key.q, key->q); in sw_crypto_acipher_gen_rsa_key() 193 ltc_mp.copy(ltc_tmp_key.qP, key->qp); in sw_crypto_acipher_gen_rsa_key() 194 ltc_mp.copy(ltc_tmp_key.dP, key->dp); in sw_crypto_acipher_gen_rsa_key() 195 ltc_mp.copy(ltc_tmp_key.dQ, key->dq); in sw_crypto_acipher_gen_rsa_key() 364 mod_size = ltc_mp.unsigned_size((void *)(ltc_key.N)); in sw_crypto_acipher_rsaes_decrypt() 446 mod_size = ltc_mp.unsigned_size((void *)(ltc_key.N)); in sw_crypto_acipher_rsaes_encrypt() 559 mod_size = ltc_mp.unsigned_size((void *)(ltc_key.N)); in sw_crypto_acipher_rsassa_sign() [all …]
|
A D | dh.c | 60 ltc_mp.copy(ltc_tmp_key.y, key->y); in crypto_acipher_gen_dh_key() 61 ltc_mp.copy(ltc_tmp_key.x, key->x); in crypto_acipher_gen_dh_key()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/dsa/ |
A D | dsa_set.c | 30 LTC_ARGCHK(ltc_mp.name != NULL); in dsa_set_pqg() 77 LTC_ARGCHK(ltc_mp.name != NULL); in dsa_set_key()
|
A D | dsa_generate_key.c | 24 LTC_ARGCHK(ltc_mp.name != NULL); in dsa_generate_key()
|
A D | dsa_set_pqg_dsaparam.c | 25 LTC_ARGCHK(ltc_mp.name != NULL); in dsa_set_pqg_dsaparam()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/math/ |
A D | tfm_desc.c | 448 ltc_mp.set_int(R->x, 1); in tfm_ecc_projective_dbl_point() 449 ltc_mp.set_int(R->y, 1); in tfm_ecc_projective_dbl_point() 450 ltc_mp.set_int(R->z, 0); in tfm_ecc_projective_dbl_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() 610 ltc_mp.copy(P->x, R->x); in tfm_ecc_projective_add_point() 611 ltc_mp.copy(P->y, R->y); in tfm_ecc_projective_add_point() 612 ltc_mp.copy(P->z, R->z); in tfm_ecc_projective_add_point()
|