Home
last modified time | relevance | path

Searched refs:T (Results 1 – 25 of 37) sorted by relevance

12

/optee_os/core/lib/libtomcrypt/src/ciphers/
H A Dcamellia.c204 unsigned char T[48], kA[16], kB[16], kR[16], kL[16]; in camellia_setup() local
226 T[x] = key[x]; in camellia_setup()
227 T[x + 16] = 0; in camellia_setup()
231 T[x] = key[x]; in camellia_setup()
234 T[x] = key[x-8] ^ 0xFF; in camellia_setup()
238 T[x] = key[x]; in camellia_setup()
243 kL[x] = T[x]; in camellia_setup()
244 kR[x] = T[x + 16]; in camellia_setup()
248 T[x] = T[x - 32] ^ T[x - 16]; in camellia_setup()
252 LOAD64H(A, T+32); LOAD64H(B, T+40); in camellia_setup()
[all …]
H A Dkseed.c182 T = G( G(T2 + (R1 ^ K1)) + T2); \
183 L2 ^= T; \
184 L1 ^= (T + G(T2 + (R1 ^ K1))); \
235 ulong32 T, T2; in rounds() local
/optee_os/lib/libmbedtls/mbedtls/library/
H A Ddes.c216 T = (((X) >> 4) ^ (Y)) & 0x0F0F0F0F; (Y) ^= T; (X) ^= (T << 4); \
217 T = (((X) >> 16) ^ (Y)) & 0x0000FFFF; (Y) ^= T; (X) ^= (T << 16); \
218 T = (((Y) >> 2) ^ (X)) & 0x33333333; (X) ^= T; (Y) ^= (T << 2); \
219 T = (((Y) >> 8) ^ (X)) & 0x00FF00FF; (X) ^= T; (Y) ^= (T << 8); \
221 T = ((X) ^ (Y)) & 0xAAAAAAAA; (Y) ^= T; (X) ^= T; \
232 T = ((X) ^ (Y)) & 0xAAAAAAAA; (X) ^= T; (Y) ^= T; \
234 T = (((Y) >> 8) ^ (X)) & 0x00FF00FF; (X) ^= T; (Y) ^= (T << 8); \
235 T = (((Y) >> 2) ^ (X)) & 0x33333333; (X) ^= T; (Y) ^= (T << 2); \
236 T = (((X) >> 16) ^ (Y)) & 0x0000FFFF; (Y) ^= T; (X) ^= (T << 16); \
237 T = (((X) >> 4) ^ (Y)) & 0x0F0F0F0F; (Y) ^= T; (X) ^= (T << 4); \
[all …]
H A Dbignum_mod_raw.c119 mbedtls_mpi_uint *T) in mbedtls_mpi_mod_raw_mul() argument
130 N->rep.mont.mm, T); in mbedtls_mpi_mod_raw_mul()
133 mbedtls_mpi_core_mul(T, A, N->limbs, B, N->limbs); in mbedtls_mpi_mod_raw_mul()
136 (*N->rep.ored.modp)(T, T_limbs); in mbedtls_mpi_mod_raw_mul()
139 mbedtls_mpi_mod_raw_fix_quasi_reduction(T, N); in mbedtls_mpi_mod_raw_mul()
140 memcpy(X, T, N->limbs * sizeof(mbedtls_mpi_uint)); in mbedtls_mpi_mod_raw_mul()
162 mbedtls_mpi_uint *T) in mbedtls_mpi_mod_raw_inv_prime() argument
170 mbedtls_mpi_uint *Nminus2 = T; in mbedtls_mpi_mod_raw_inv_prime()
176 RR, T + AN_limbs); in mbedtls_mpi_mod_raw_inv_prime()
234 mbedtls_mpi_uint *T; in mbedtls_mpi_mod_raw_to_mont_rep() local
[all …]
H A Decp.c127 mbedtls_ecp_point *T; /* table for precomputed points */ member
147 ctx->T = NULL; in ecp_restart_rsm_init()
165 if (ctx->T != NULL) { in ecp_restart_rsm_free()
167 mbedtls_ecp_point_free(ctx->T + i); in ecp_restart_rsm_free()
169 mbedtls_free(ctx->T); in ecp_restart_rsm_free()
531 grp->T = NULL; in mbedtls_ecp_group_init()
565 return grp->T != NULL && grp->T_size == 0; in ecp_group_is_static_comb_table()
594 if (!ecp_group_is_static_comb_table(grp) && grp->T != NULL) { in mbedtls_ecp_group_free()
596 mbedtls_ecp_point_free(&grp->T[i]); in mbedtls_ecp_group_free()
598 mbedtls_free(grp->T); in mbedtls_ecp_group_free()
[all …]
H A Drsa.c87 mbedtls_mpi T; in mbedtls_rsa_parse_key() local
88 mbedtls_mpi_init(&T); in mbedtls_rsa_parse_key()
127 if ((ret = asn1_get_nonzero_mpi(&p, end, &T)) != 0 || in mbedtls_rsa_parse_key()
128 (ret = mbedtls_rsa_import(rsa, &T, NULL, NULL, in mbedtls_rsa_parse_key()
134 if ((ret = asn1_get_nonzero_mpi(&p, end, &T)) != 0 || in mbedtls_rsa_parse_key()
136 NULL, &T)) != 0) { in mbedtls_rsa_parse_key()
141 if ((ret = asn1_get_nonzero_mpi(&p, end, &T)) != 0 || in mbedtls_rsa_parse_key()
143 &T, NULL)) != 0) { in mbedtls_rsa_parse_key()
148 if ((ret = asn1_get_nonzero_mpi(&p, end, &T)) != 0 || in mbedtls_rsa_parse_key()
149 (ret = mbedtls_rsa_import(rsa, NULL, &T, NULL, in mbedtls_rsa_parse_key()
[all …]
H A Drsa_alt_helpers.c61 mbedtls_mpi T; /* Holds largest odd divisor of DE - 1 */ in mbedtls_rsa_deduce_primes() local
92 mbedtls_mpi_init(&T); in mbedtls_rsa_deduce_primes()
95 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&T, D, E)); in mbedtls_rsa_deduce_primes()
96 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&T, &T, 1)); in mbedtls_rsa_deduce_primes()
98 if ((order = (uint16_t) mbedtls_mpi_lsb(&T)) == 0) { in mbedtls_rsa_deduce_primes()
104 MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&T, order)); in mbedtls_rsa_deduce_primes()
127 MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod(&K, &K, &T, N, in mbedtls_rsa_deduce_primes()
174 mbedtls_mpi_free(&T); in mbedtls_rsa_deduce_primes()
H A Dbignum_core.c533 mbedtls_mpi_uint *T) in mbedtls_mpi_core_montmul() argument
535 memset(T, 0, (2 * AN_limbs + 1) * ciL); in mbedtls_mpi_core_montmul()
540 mbedtls_mpi_uint u1 = (T[0] + u0 * B[0]) * mm; in mbedtls_mpi_core_montmul()
542 (void) mbedtls_mpi_core_mla(T, AN_limbs + 2, B, B_limbs, u0); in mbedtls_mpi_core_montmul()
543 (void) mbedtls_mpi_core_mla(T, AN_limbs + 2, N, AN_limbs, u1); in mbedtls_mpi_core_montmul()
545 T++; in mbedtls_mpi_core_montmul()
558 mbedtls_mpi_uint carry = T[AN_limbs]; in mbedtls_mpi_core_montmul()
559 mbedtls_mpi_uint borrow = mbedtls_mpi_core_sub(X, T, N, AN_limbs); in mbedtls_mpi_core_montmul()
577 (unsigned char *) T, in mbedtls_mpi_core_montmul()
857 mbedtls_mpi_uint *T) in mbedtls_mpi_core_exp_mod_optionally_safe() argument
[all …]
H A Dbignum_core.h513 mbedtls_mpi_uint mm, mbedtls_mpi_uint *T);
667 mbedtls_mpi_uint *T);
701 mbedtls_mpi_uint *T);
787 mbedtls_mpi_uint *T);
823 mbedtls_mpi_uint *T);
H A Dbignum.c402 mbedtls_mpi T; in mbedtls_mpi_swap() local
404 memcpy(&T, X, sizeof(mbedtls_mpi)); in mbedtls_mpi_swap()
406 memcpy(Y, &T, sizeof(mbedtls_mpi)); in mbedtls_mpi_swap()
570 mbedtls_mpi T; in mbedtls_mpi_read_string() local
576 mbedtls_mpi_init_mempool(&T); in mbedtls_mpi_read_string()
609 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_int(&T, X, radix)); in mbedtls_mpi_read_string()
610 MBEDTLS_MPI_CHK(mbedtls_mpi_add_int(X, &T, d)); in mbedtls_mpi_read_string()
620 mbedtls_mpi_free(&T); in mbedtls_mpi_read_string()
672 mbedtls_mpi T; in mbedtls_mpi_write_string() local
703 mbedtls_mpi_init_mempool(&T); in mbedtls_mpi_write_string()
[all …]
H A Dbignum_mod_raw.h233 mbedtls_mpi_uint *T);
282 mbedtls_mpi_uint *T);
/optee_os/core/lib/libtomcrypt/src/modes/xts/
H A Dxts_decrypt.c11 static int s_tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char *T, const symmet… in s_tweak_uncrypt() argument
19 …C_FAST_TYPE_PTR_CAST(&P[x])) = *(LTC_FAST_TYPE_PTR_CAST(&C[x])) ^ *(LTC_FAST_TYPE_PTR_CAST(&T[x])); in s_tweak_uncrypt()
23 P[x] = C[x] ^ T[x]; in s_tweak_uncrypt()
31 *(LTC_FAST_TYPE_PTR_CAST(&P[x])) ^= *(LTC_FAST_TYPE_PTR_CAST(&T[x])); in s_tweak_uncrypt()
35 P[x] = P[x] ^ T[x]; in s_tweak_uncrypt()
40 xts_mult_x(T); in s_tweak_uncrypt()
56 unsigned char PP[16], CC[16], T[16]; in xts_decrypt() local
97 XMEMCPY(T, tweak, sizeof(T)); in xts_decrypt()
100 if ((err = cipher_descriptor[xts->cipher]->ecb_encrypt(tweak, T, &xts->key2)) != CRYPT_OK) { in xts_decrypt()
105 if ((err = s_tweak_uncrypt(ct, pt, T, xts)) != CRYPT_OK) { in xts_decrypt()
[all …]
H A Dxts_encrypt.c11 static int s_tweak_crypt(const unsigned char *P, unsigned char *C, unsigned char *T, const symmetri… in s_tweak_crypt() argument
19 …C_FAST_TYPE_PTR_CAST(&C[x])) = *(LTC_FAST_TYPE_PTR_CAST(&P[x])) ^ *(LTC_FAST_TYPE_PTR_CAST(&T[x])); in s_tweak_crypt()
23 C[x] = P[x] ^ T[x]; in s_tweak_crypt()
33 *(LTC_FAST_TYPE_PTR_CAST(&C[x])) ^= *(LTC_FAST_TYPE_PTR_CAST(&T[x])); in s_tweak_crypt()
37 C[x] = C[x] ^ T[x]; in s_tweak_crypt()
42 xts_mult_x(T); in s_tweak_crypt()
58 unsigned char PP[16], CC[16], T[16]; in xts_encrypt() local
99 XMEMCPY(T, tweak, sizeof(T)); in xts_encrypt()
103 if ((err = cipher_descriptor[xts->cipher]->ecb_encrypt(tweak, T, &xts->key2)) != CRYPT_OK) { in xts_encrypt()
108 if ((err = s_tweak_crypt(pt, ct, T, xts)) != CRYPT_OK) { in xts_encrypt()
[all …]
H A Dxts_test.c195 unsigned char OUT[512], Torg[16], T[16]; in xts_test()
239 XMEMCPY(T, Torg, sizeof(T)); in xts_test()
241 err = xts_encrypt(tests[i].PTX, tests[i].PTLEN, OUT, T, &xts); in xts_test()
247 err = xts_encrypt(tests[i].PTX, len, OUT, T, &xts); in xts_test()
252 err = xts_encrypt(&tests[i].PTX[len], len, &OUT[len], T, &xts); in xts_test()
264 XMEMCPY(T, Torg, sizeof(T)); in xts_test()
266 err = xts_decrypt(tests[i].CTX, tests[i].PTLEN, OUT, T, &xts); in xts_test()
272 err = xts_decrypt(tests[i].CTX, len, OUT, T, &xts); in xts_test()
277 err = xts_decrypt(&tests[i].CTX[len], len, &OUT[len], T, &xts); in xts_test()
/optee_os/core/lib/libtomcrypt/src/encauth/gcm/
H A Dgcm_test.c31 unsigned char T[16]; in gcm_test()
321 unsigned char out[2][128], T[2][16]; in gcm_test()
334 y = sizeof(T[0]); in gcm_test()
338 if ((err = gcm_done(&gcm, T[0], &y)) != CRYPT_OK) return err; in gcm_test()
339 …if (compare_testvector(T[0], y, tests[0].T, 16, "GCM Encrypt Tag-special", 0)) return CRYPT_F… in gcm_test()
342 y = sizeof(T[0]); in gcm_test()
347 out[0], T[0], &y, GCM_ENCRYPT)) != CRYPT_OK) { in gcm_test()
355 if (compare_testvector(T[0], y, tests[x].T, 16, "GCM Encrypt Tag", x)) { in gcm_test()
359 y = sizeof(T[1]); in gcm_test()
360 XMEMCPY(T[1], tests[x].T, 16); in gcm_test()
[all …]
H A Dgcm_mult_h.c18 unsigned char T[16]; in gcm_mult_h() local
26 asm("movdqa %%xmm0,(%0)"::"r"(&T)); in gcm_mult_h()
29 XMEMCPY(T, &gcm->PC[0][I[0]][0], 16); in gcm_mult_h()
33 *(LTC_FAST_TYPE_PTR_CAST(T + y)) ^= *(LTC_FAST_TYPE_PTR_CAST(&gcm->PC[x][I[x]][y])); in gcm_mult_h()
37 T[y] ^= gcm->PC[x][I[x]][y]; in gcm_mult_h()
43 gcm_gf_mult(gcm->H, I, T); in gcm_mult_h()
45 XMEMCPY(I, T, 16); in gcm_mult_h()
/optee_os/core/lib/libtomcrypt/src/misc/hkdf/
H A Dhkdf.c40 unsigned char *T, *dat; in hkdf_expand() local
60 T = XMALLOC(Tlen); /* Replace with static buffer? */ in hkdf_expand()
61 if (T == NULL) { in hkdf_expand()
65 XMEMCPY(T + hashsize, info, infolen); in hkdf_expand()
69 dat = T + hashsize; in hkdf_expand()
76 T[Tlen - 1] = ++N; in hkdf_expand()
79 zeromem(T, Tlen); in hkdf_expand()
80 XFREE(T); in hkdf_expand()
90 XMEMCPY(T, out + hashsize * (N-1), hashsize); in hkdf_expand()
92 dat = T; in hkdf_expand()
[all …]
/optee_os/core/lib/libtomcrypt/src/mac/f9/
H A Df9_test.c22 unsigned char K[16], M[128], T[4]; in f9_test()
42 unsigned char T[16]; in f9_test()
53 … if ((err = f9_memory(idx, tests[x].K, 16, tests[x].M, tests[x].msglen, T, &taglen)) != CRYPT_OK) { in f9_test()
56 if (compare_testvector(T, taglen, tests[x].T, 4, "F9", x)) { in f9_test()
/optee_os/core/lib/libtomcrypt/src/mac/xcbc/
H A Dxcbc_test.c22 unsigned char K[16], M[34], T[16]; in xcbc_test()
90 unsigned char T[16]; in xcbc_test()
103 …if ((err = xcbc_memory(idx, tests[x].K, 16, tests[x].M, tests[x].msglen, T, &taglen)) != CRYPT_OK)… in xcbc_test()
106 if (compare_testvector(T, taglen, tests[x].T, 16, "XCBC", x)) { in xcbc_test()
/optee_os/core/lib/libtomcrypt/src/hashes/whirl/
H A Dwhirl.c55 ulong64 K[2][8], T[3][8]; in ss_whirlpool_compress() local
62 LOAD64H(T[0][x], buf + (8 * x)); in ss_whirlpool_compress()
63 T[2][x] = T[0][x]; in ss_whirlpool_compress()
64 T[0][x] ^= K[0][x]; in ss_whirlpool_compress()
79 T[1][y] = theta_pi_gamma(T[0], y) ^ K[1][y]; in ss_whirlpool_compress()
92 T[0][y] = theta_pi_gamma(T[1], y) ^ K[0][y]; in ss_whirlpool_compress()
98 md->whirlpool.state[x] ^= T[0][x] ^ T[2][x]; in ss_whirlpool_compress()
/optee_os/core/lib/libtomcrypt/src/modes/lrw/
H A Dlrw_setiv.c23 unsigned char T[16]; in lrw_setiv() local
47 XMEMCPY(T, &lrw->PC[0][IV[0]][0], 16); in lrw_setiv()
51 *(LTC_FAST_TYPE_PTR_CAST(T + y)) ^= *(LTC_FAST_TYPE_PTR_CAST(&lrw->PC[x][IV[x]][y])); in lrw_setiv()
55 T[y] ^= lrw->PC[x][IV[x]][y]; in lrw_setiv()
59 XMEMCPY(lrw->pad, T, 16); in lrw_setiv()
/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/
H A Docb3_test.c196 const unsigned char T[] = { 0xD0,0xC5,0x15,0xF4,0xD1,0xCD,0xD4,0xFD, in ocb3_test()
256 if (compare_testvector(outtag, len, T, sizeof(T), "OCB3 Tag", x) || in ocb3_test()
266 outct, T, sizeof(T), &res)) != CRYPT_OK) { in ocb3_test()
285 …if (compare_testvector(outtag, len, T, sizeof(T), "OCB3 Tag.enc", x)) return CRYPT_FAIL_T… in ocb3_test()
293 …if (compare_testvector(outtag, len, T, sizeof(T), "OCB3 Tag.dec", x)) return CRYPT_FAIL_T… in ocb3_test()
/optee_os/core/lib/libtomcrypt/src/hashes/chc/
H A Dchc.c126 unsigned char T[2][MAXBLOCKSIZE]; in s_chc_compress() local
137 XMEMCPY(T[1], buf, cipher_blocksize); in s_chc_compress()
138 cipher_descriptor[cipher_idx]->ecb_encrypt(buf, T[0], key); in s_chc_compress()
140 md->chc.state[x] ^= T[0][x] ^ T[1][x]; in s_chc_compress()
143 zeromem(T, sizeof(T)); in s_chc_compress()
/optee_os/core/lib/libtomcrypt/src/mac/pelican/
H A Dpelican_test.c18 unsigned char K[32], MSG[64], T[16]; in pelican_test()
94 if (compare_testvector(out, 16, tests[x].T, 16, "PELICAN", x)) { in pelican_test()
/optee_os/core/lib/libtomcrypt/src/math/
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()
351 mpz_powm(T, n, Q, prime); in sqrtmod_prime()
358 mpz_set(t1, T); in sqrtmod_prime()
382 mpz_mul(T, T, C); in sqrtmod_prime()
383 mpz_mod(T, T, prime); in sqrtmod_prime()
392 mpz_clear(T); mpz_clear(R); mpz_clear(two); in sqrtmod_prime()

12