Home
last modified time | relevance | path

Searched refs:R (Results 1 – 25 of 46) sorted by relevance

12

/optee_os/core/lib/libtomcrypt/src/pk/ecc/
H A Dltc_ecc_projective_dbl_point.c40 int ltc_ecc_projective_dbl_point(const ecc_point *P, ecc_point *R, void *ma, void *modulus, void *m… in ltc_ecc_projective_dbl_point() argument
46 LTC_ARGCHK(R != NULL); in ltc_ecc_projective_dbl_point()
54 if (P != R) { in ltc_ecc_projective_dbl_point()
55 if ((err = ltc_ecc_copy_point(P, R)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
61 err = ltc_ecc_set_point_xyz(1, 1, 0, R); in ltc_ecc_projective_dbl_point()
66 if ((err = mp_sqr(R->z, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
69 if ((err = mp_mul(R->z, R->y, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
70 if ((err = mp_montgomery_reduce(R->z, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
72 if ((err = mp_add(R->z, R->z, R->z)) != 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()
[all …]
H A Dltc_ecc_mulmod.c26 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(R != NULL); in ltc_ecc_mulmod()
42 return ltc_ecc_set_point_xyz(1, 1, 0, R); in ltc_ecc_mulmod()
127 if ((err = ltc_mp.ecc_ptdbl(R, R, ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
139 if ((err = ltc_ecc_copy_point(M[bitbuf-8], R)) != 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()
171 if ((err = ltc_ecc_copy_point(tG, R)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
175 if ((err = ltc_mp.ecc_ptadd(R, tG, R, ma, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
[all …]
H A Dltc_ecc_projective_add_point.c23 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
30 LTC_ARGCHK(R != NULL); in ltc_ecc_projective_add_point()
41 err = ltc_ecc_copy_point(Q, R); in ltc_ecc_projective_add_point()
48 err = ltc_ecc_copy_point(P, R); in ltc_ecc_projective_add_point()
56 return ltc_ecc_projective_dbl_point(P, R, ma, modulus, mp); in ltc_ecc_projective_add_point()
61 err = ltc_ecc_set_point_xyz(1, 1, 0, R); in ltc_ecc_projective_add_point()
187 if ((err = mp_copy(x, R->x)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
188 if ((err = mp_copy(y, R->y)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
189 if ((err = mp_copy(z, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
H A Dltc_ecc_mulmod_timing.c25 int ltc_ecc_mulmod(void *k, const ecc_point *G, ecc_point *R, void *a, void *modulus, int map) in ltc_ecc_mulmod() argument
35 LTC_ARGCHK(R != NULL); in ltc_ecc_mulmod()
41 return ltc_ecc_set_point_xyz(1, 1, 0, R); in ltc_ecc_mulmod()
129 if ((err = ltc_ecc_copy_point(M[0], R)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
133 err = ltc_ecc_map(R, modulus, mp); in ltc_ecc_mulmod()
/optee_os/core/lib/libtomcrypt/src/stream/sober128/
H A Dsober128_stream.c44 #define STEP(R,z) \ argument
45R[OFF(z,0)] = R[OFF(z,15)] ^ R[OFF(z,4)] ^ (R[OFF(z,0)] << 8) ^ Multab[(R[OFF(z,0)] >> 24) & 0xFF];
47 static void cycle(ulong32 *R) in cycle() argument
52 STEP(R,0); in cycle()
53 t = R[0]; in cycle()
55 R[i-1] = R[i]; in cycle()
57 R[N-1] = t; in cycle()
64 t = st->R[OFF(z,0)] + st->R[OFF(z,16)]; \
67 t = ((t + st->R[OFF(z,1)]) ^ st->konst) + st->R[OFF(z,6)]; \
69 t = t + st->R[OFF(z,13)]; \
[all …]
/optee_os/core/lib/libtomcrypt/src/ciphers/
H A Dcamellia.c217 skey->camellia.R = (keylen == 16) ? 18 : 24; in camellia_setup()
219 if (num_rounds != 0 && num_rounds != skey->camellia.R) { in camellia_setup()
435 ulong64 L, R; in camellia_ecb_encrypt() local
438 LOAD64H(L, pt+0); LOAD64H(R, pt+8); in camellia_ecb_encrypt()
440 R ^= skey->camellia.kw[1]; in camellia_ecb_encrypt()
443 R ^= F(L ^ skey->camellia.k[0]); in camellia_ecb_encrypt()
444 L ^= F(R ^ skey->camellia.k[1]); in camellia_ecb_encrypt()
445 R ^= F(L ^ skey->camellia.k[2]); in camellia_ecb_encrypt()
446 L ^= F(R ^ skey->camellia.k[3]); in camellia_ecb_encrypt()
447 R ^= F(L ^ skey->camellia.k[4]); in camellia_ecb_encrypt()
[all …]
H A Dcast5.c494 LTC_INLINE static ulong32 FI(ulong32 R, ulong32 Km, ulong32 Kr) in FI() argument
497 I = (Km + R); in FI()
502 LTC_INLINE static ulong32 FII(ulong32 R, ulong32 Km, ulong32 Kr) in FII() argument
505 I = (Km ^ R); in FII()
510 LTC_INLINE static ulong32 FIII(ulong32 R, ulong32 Km, ulong32 Kr) in FIII() argument
513 I = (Km - R); in FIII()
530 ulong32 R, L; in s_cast5_ecb_encrypt() local
537 LOAD32H(R,&pt[4]); in s_cast5_ecb_encrypt()
538 L ^= FI(R, skey->cast5.K[0], skey->cast5.K[16]); in s_cast5_ecb_encrypt()
539 R ^= FII(L, skey->cast5.K[1], skey->cast5.K[17]); in s_cast5_ecb_encrypt()
[all …]
H A Danubis.c884 int N, R, i, pos, r; in s_anubis_setup() local
907 skey->anubis.R = R = 8 + N; in s_anubis_setup()
909 if (num_rounds != 0 && num_rounds != skey->anubis.R) { in s_anubis_setup()
927 for (r = 0; r <= R; r++) { in s_anubis_setup()
975 if (r == R) { in s_anubis_setup()
995 skey->anubis.roundKeyDec[0][i] = skey->anubis.roundKeyEnc[R][i]; in s_anubis_setup()
996 skey->anubis.roundKeyDec[R][i] = skey->anubis.roundKeyEnc[0][i]; in s_anubis_setup()
998 for (r = 1; r < R; r++) { in s_anubis_setup()
1000 v = skey->anubis.roundKeyEnc[R - r][i]; in s_anubis_setup()
1024 const ulong32 roundKey[18 + 1][4], int R) { in anubis_crypt() argument
[all …]
H A Dblowfish.c298 static void s_blowfish_encipher(ulong32 *L, ulong32 *R, const symmetric_key *skey) in s_blowfish_encipher() argument
313 r = *R; in s_blowfish_encipher()
328 *R = l; in s_blowfish_encipher()
480 ulong32 L, R; in s_blowfish_ecb_encrypt() local
488 LOAD32H(R, &pt[4]); in s_blowfish_ecb_encrypt()
490 s_blowfish_encipher(&L, &R, skey); in s_blowfish_ecb_encrypt()
494 STORE32H(R, &ct[4]); in s_blowfish_ecb_encrypt()
521 ulong32 L, R; in s_blowfish_ecb_decrypt() local
539 LOAD32H(R, &ct[0]); in s_blowfish_ecb_decrypt()
543 R ^= skey->blowfish.K[17]; in s_blowfish_ecb_decrypt()
[all …]
/optee_os/core/lib/libtomcrypt/src/math/
H A Dtfm_desc.c423 static int tfm_ecc_projective_dbl_point(const ecc_point *P, ecc_point *R, void *ma, void *modulus, … in tfm_ecc_projective_dbl_point() argument
430 LTC_ARGCHK(R != NULL); in tfm_ecc_projective_dbl_point()
439 if (P != R) { in tfm_ecc_projective_dbl_point()
440 fp_copy(P->x, R->x); in tfm_ecc_projective_dbl_point()
441 fp_copy(P->y, R->y); in tfm_ecc_projective_dbl_point()
442 fp_copy(P->z, R->z); in tfm_ecc_projective_dbl_point()
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()
455 fp_sqr(R->z, &t1); in tfm_ecc_projective_dbl_point()
[all …]
H A Dgmp_desc.c287 mpz_t t1, C, Q, S, Z, M, T, R, two; in sqrtmod_prime() local
304 mpz_init(T); mpz_init(R); mpz_init(two); in sqrtmod_prime()
349 mpz_powm(R, n, t1, prime); in sqrtmod_prime()
366 mpz_set(ret, R); in sqrtmod_prime()
379 mpz_mul(R, R, t1); in sqrtmod_prime()
380 mpz_mod(R, R, prime); in sqrtmod_prime()
392 mpz_clear(T); mpz_clear(R); mpz_clear(two); in sqrtmod_prime()
/optee_os/lib/libmbedtls/mbedtls/library/
H A Dsha1.c91 #define R(t) \ in mbedtls_internal_sha1_process() macro
132 P(local.E, local.A, local.B, local.C, local.D, R(16)); in mbedtls_internal_sha1_process()
133 P(local.D, local.E, local.A, local.B, local.C, R(17)); in mbedtls_internal_sha1_process()
134 P(local.C, local.D, local.E, local.A, local.B, R(18)); in mbedtls_internal_sha1_process()
135 P(local.B, local.C, local.D, local.E, local.A, R(19)); in mbedtls_internal_sha1_process()
143 P(local.A, local.B, local.C, local.D, local.E, R(20)); in mbedtls_internal_sha1_process()
144 P(local.E, local.A, local.B, local.C, local.D, R(21)); in mbedtls_internal_sha1_process()
145 P(local.D, local.E, local.A, local.B, local.C, R(22)); in mbedtls_internal_sha1_process()
146 P(local.C, local.D, local.E, local.A, local.B, R(23)); in mbedtls_internal_sha1_process()
147 P(local.B, local.C, local.D, local.E, local.A, R(24)); in mbedtls_internal_sha1_process()
[all …]
H A Decp.c125 mbedtls_ecp_point R; /* current intermediate result */ member
145 mbedtls_ecp_point_init(&ctx->R); in ecp_restart_rsm_init()
163 mbedtls_ecp_point_free(&ctx->R); in ecp_restart_rsm_free()
180 mbedtls_ecp_point R; /* R intermediate result */ member
195 mbedtls_ecp_point_init(&ctx->R); in ecp_restart_ma_init()
209 mbedtls_ecp_point_free(&ctx->R); in ecp_restart_ma_free()
1490 static int ecp_double_jac(const mbedtls_ecp_group *grp, mbedtls_ecp_point *R, in ecp_double_jac() argument
1500 return mbedtls_internal_ecp_double_jac(grp, R, P); in ecp_double_jac()
1557 MPI_ECP_MOV(&R->X, &tmp[2]); in ecp_double_jac()
1558 MPI_ECP_MOV(&R->Y, &tmp[1]); in ecp_double_jac()
[all …]
H A Decp_internal_alt.h156 mbedtls_ecp_point *R, const mbedtls_ecp_point *P,
181 mbedtls_ecp_point *R, const mbedtls_ecp_point *P);
238 mbedtls_ecp_point *R,
H A Ddhm.c168 static int dhm_random_below(mbedtls_mpi *R, const mbedtls_mpi *M, in dhm_random_below() argument
173 MBEDTLS_MPI_CHK(mbedtls_mpi_random(R, 3, M, f_rng, p_rng)); in dhm_random_below()
174 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(R, R, 1)); in dhm_random_below()
347 mbedtls_mpi R; in dhm_update_blinding() local
349 mbedtls_mpi_init(&R); in dhm_update_blinding()
387 MBEDTLS_MPI_CHK(dhm_random_below(&R, &ctx->P, f_rng, p_rng)); in dhm_update_blinding()
388 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&ctx->Vf, &ctx->Vi, &R)); in dhm_update_blinding()
391 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&ctx->Vf, &ctx->Vf, &R)); in dhm_update_blinding()
397 mbedtls_mpi_free(&R); in dhm_update_blinding()
H A Decdsa.c253 mbedtls_ecp_point R; in mbedtls_ecdsa_sign_restartable() local
267 mbedtls_ecp_point_init(&R); in mbedtls_ecdsa_sign_restartable()
317 MBEDTLS_MPI_CHK(mbedtls_ecp_mul_restartable(grp, &R, pk, &grp->G, in mbedtls_ecdsa_sign_restartable()
321 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_mpi(pr, &R.X, &grp->N)); in mbedtls_ecdsa_sign_restartable()
369 mbedtls_ecp_point_free(&R); in mbedtls_ecdsa_sign_restartable()
497 mbedtls_ecp_point R; in mbedtls_ecdsa_verify_restartable() local
500 mbedtls_ecp_point_init(&R); in mbedtls_ecdsa_verify_restartable()
562 &R, pu1, &grp->G, pu2, Q, ECDSA_RS_ECP)); in mbedtls_ecdsa_verify_restartable()
564 if (mbedtls_ecp_is_zero(&R)) { in mbedtls_ecdsa_verify_restartable()
573 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_mpi(&R.X, &R.X, &grp->N)); in mbedtls_ecdsa_verify_restartable()
[all …]
H A Dnist_kw.c271 unsigned char *R = NULL; in unwrap() local
280 R = output + (semiblocks - 2) * KW_SEMIBLOCK_LENGTH; in unwrap()
287 memcpy(inbuff + KW_SEMIBLOCK_LENGTH, R, KW_SEMIBLOCK_LENGTH); in unwrap()
298 memcpy(R, outbuff + KW_SEMIBLOCK_LENGTH, KW_SEMIBLOCK_LENGTH); in unwrap()
300 if (R == output) { in unwrap()
301 R = output + (semiblocks - 2) * KW_SEMIBLOCK_LENGTH; in unwrap()
303 R -= KW_SEMIBLOCK_LENGTH; in unwrap()
H A Dbignum.c1444 int mbedtls_mpi_div_mpi(mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A, in mbedtls_mpi_div_mpi() argument
1473 if (R != NULL) { in mbedtls_mpi_div_mpi()
1474 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(R, A)); in mbedtls_mpi_div_mpi()
1545 if (R != NULL) { in mbedtls_mpi_div_mpi()
1548 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(R, &X)); in mbedtls_mpi_div_mpi()
1550 if (mbedtls_mpi_cmp_int(R, 0) == 0) { in mbedtls_mpi_div_mpi()
1551 R->s = 1; 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()
1585 int mbedtls_mpi_mod_mpi(mbedtls_mpi *R, const mbedtls_mpi *A, const mbedtls_mpi *B) in mbedtls_mpi_mod_mpi() argument
[all …]
/optee_os/
H A DMAINTAINERS28 basis (R:).
36 R: Tadd Kao <tadd.kao@mediatek.com> [@taddk]
41 R: Jens Wiklander <jens.wiklander@linaro.org> [@jenswi-linaro]
46 R: Jens Wiklander <jens.wiklander@linaro.org> [@jenswi-linaro]
51 R: Emekcan.Aras@arm.com <emekcan.aras@arm.com> [@ememarar]
56 R: Ahmed Tiba <ahmed.tiba@arm.com> [@ahmedtiba]
61 R: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> [@grandpaul]
70 R: Michal Simek <michal.simek@amd.com> [@michalsimek]
71 R: Akshay Belsare <akshay.belsare@amd.com> [@Akshay-Belsare]
77 R: Carlo Caione <ccaione@baylibre.com> [@carlocaione]
[all …]
/optee_os/lib/libmbedtls/core/
H A Dsm2-dsa.c160 mbedtls_mpi R = { }; in sm2_mbedtls_dsa_verify() local
172 mbedtls_mpi_init(&R); in sm2_mbedtls_dsa_verify()
246 mres = mbedtls_mpi_add_mpi(&R, &eprime, &x1y1p.X); in sm2_mbedtls_dsa_verify()
249 mres = mbedtls_mpi_mod_mpi(&R, &R, &grp.N); in sm2_mbedtls_dsa_verify()
252 if (mbedtls_mpi_cmp_mpi(&R, &rprime)) { in sm2_mbedtls_dsa_verify()
265 mbedtls_mpi_free(&R); in sm2_mbedtls_dsa_verify()
/optee_os/core/lib/libtomcrypt/src/math/fp/
H A Dltc_ecc_fp_mulmod.c772 static int s_accel_fp_mul(int idx, void *k, ecc_point *R, void *a, void *modulus, void *mp, int map) in s_accel_fp_mul() argument
865 if ((err = ltc_mp.ecc_ptdbl(R, R, a, modulus, mp)) != CRYPT_OK) { in s_accel_fp_mul()
872 if ((err = ltc_mp.ecc_ptadd(R, fp_cache[idx].LUT[z], R, a, modulus, mp)) != CRYPT_OK) { in s_accel_fp_mul()
876 if ((mp_copy(fp_cache[idx].LUT[z]->x, R->x) != CRYPT_OK) || in s_accel_fp_mul()
877 (mp_copy(fp_cache[idx].LUT[z]->y, R->y) != CRYPT_OK) || in s_accel_fp_mul()
878 (mp_copy(fp_cache[idx].mu, R->z) != CRYPT_OK)) { return CRYPT_MEM; } in s_accel_fp_mul()
886 err = ltc_ecc_map(R, modulus, mp); in s_accel_fp_mul()
897 ecc_point *R, void *a, void *modulus, void *mp) in ss_accel_fp_mul2add() argument
1053 if ((err = ltc_mp.ecc_ptdbl(R, R, a, modulus, mp)) != CRYPT_OK) { in ss_accel_fp_mul2add()
1061 … if ((err = ltc_mp.ecc_ptadd(R, fp_cache[idx1].LUT[zA], R, a, modulus, mp)) != CRYPT_OK) { in ss_accel_fp_mul2add()
[all …]
/optee_os/core/lib/libtomcrypt/
H A Dsm2-dsa.c153 void *R = NULL; in sm2_ltc_dsa_verify() local
159 ltc_res = mp_init_multi(&rprime, &sprime, &t, &mu, &ma, &eprime, &R, in sm2_ltc_dsa_verify()
236 ltc_res = mp_addmod(eprime, x1y1p->x, ltc_key.dp.order, R); in sm2_ltc_dsa_verify()
241 if (mp_cmp(R, rprime) != LTC_MP_EQ) in sm2_ltc_dsa_verify()
247 mp_clear_multi(rprime, sprime, t, mu, ma, eprime, R, NULL); in sm2_ltc_dsa_verify()
/optee_os/core/lib/libtomcrypt/src/encauth/ocb/
H A Docb_init.c81 ocb->R[x] = ocb->L[x] ^ nonce[x]; in ocb_init()
83 if ((err = cipher_descriptor[cipher]->ecb_encrypt(ocb->R, ocb->R, &ocb->key)) != CRYPT_OK) { in ocb_init()
H A Docb_shift_xor.c23 Z[x] = ocb->Li[x] ^ ocb->R[x]; in ocb_shift_xor()
/optee_os/core/lib/libtomcrypt/src/headers/
H A Dtomcrypt_math.h386 ecc_point *R,
402 ecc_point *R,
416 ecc_point *R,

12