| /optee_os/core/lib/libtomcrypt/src/hashes/ |
| H A D | rmd128.c | 81 ulong32 aa,bb,cc,dd,aaa,bbb,ccc,ddd,X[16]; in ss_rmd128_compress() local 86 LOAD32L(X[i], buf + (4 * i)); in ss_rmd128_compress() 96 FF(aa, bb, cc, dd, X[ 0], 11); in ss_rmd128_compress() 97 FF(dd, aa, bb, cc, X[ 1], 14); in ss_rmd128_compress() 98 FF(cc, dd, aa, bb, X[ 2], 15); in ss_rmd128_compress() 99 FF(bb, cc, dd, aa, X[ 3], 12); in ss_rmd128_compress() 100 FF(aa, bb, cc, dd, X[ 4], 5); in ss_rmd128_compress() 101 FF(dd, aa, bb, cc, X[ 5], 8); in ss_rmd128_compress() 102 FF(cc, dd, aa, bb, X[ 6], 7); in ss_rmd128_compress() 103 FF(bb, cc, dd, aa, X[ 7], 9); in ss_rmd128_compress() [all …]
|
| H A D | rmd256.c | 75 ulong32 aa,bb,cc,dd,aaa,bbb,ccc,ddd,tmp,X[16]; in ss_rmd256_compress() local 80 LOAD32L(X[i], buf + (4 * i)); in ss_rmd256_compress() 94 FF(aa, bb, cc, dd, X[ 0], 11); in ss_rmd256_compress() 95 FF(dd, aa, bb, cc, X[ 1], 14); in ss_rmd256_compress() 96 FF(cc, dd, aa, bb, X[ 2], 15); in ss_rmd256_compress() 97 FF(bb, cc, dd, aa, X[ 3], 12); in ss_rmd256_compress() 98 FF(aa, bb, cc, dd, X[ 4], 5); in ss_rmd256_compress() 99 FF(dd, aa, bb, cc, X[ 5], 8); in ss_rmd256_compress() 100 FF(cc, dd, aa, bb, X[ 6], 7); in ss_rmd256_compress() 101 FF(bb, cc, dd, aa, X[ 7], 9); in ss_rmd256_compress() [all …]
|
| H A D | rmd160.c | 101 ulong32 aa,bb,cc,dd,ee,aaa,bbb,ccc,ddd,eee,X[16]; in ss_rmd160_compress() local 106 LOAD32L(X[i], buf + (4 * i)); in ss_rmd160_compress() 117 FF(aa, bb, cc, dd, ee, X[ 0], 11); in ss_rmd160_compress() 118 FF(ee, aa, bb, cc, dd, X[ 1], 14); in ss_rmd160_compress() 119 FF(dd, ee, aa, bb, cc, X[ 2], 15); in ss_rmd160_compress() 120 FF(cc, dd, ee, aa, bb, X[ 3], 12); in ss_rmd160_compress() 121 FF(bb, cc, dd, ee, aa, X[ 4], 5); in ss_rmd160_compress() 122 FF(aa, bb, cc, dd, ee, X[ 5], 8); in ss_rmd160_compress() 123 FF(ee, aa, bb, cc, dd, X[ 6], 7); in ss_rmd160_compress() 124 FF(dd, ee, aa, bb, cc, X[ 7], 9); in ss_rmd160_compress() [all …]
|
| H A D | rmd320.c | 96 ulong32 aa,bb,cc,dd,ee,aaa,bbb,ccc,ddd,eee,tmp,X[16]; in ss_rmd320_compress() local 101 LOAD32L(X[i], buf + (4 * i)); in ss_rmd320_compress() 117 FF(aa, bb, cc, dd, ee, X[ 0], 11); in ss_rmd320_compress() 118 FF(ee, aa, bb, cc, dd, X[ 1], 14); in ss_rmd320_compress() 119 FF(dd, ee, aa, bb, cc, X[ 2], 15); in ss_rmd320_compress() 120 FF(cc, dd, ee, aa, bb, X[ 3], 12); in ss_rmd320_compress() 121 FF(bb, cc, dd, ee, aa, X[ 4], 5); in ss_rmd320_compress() 122 FF(aa, bb, cc, dd, ee, X[ 5], 8); in ss_rmd320_compress() 123 FF(ee, aa, bb, cc, dd, X[ 6], 7); in ss_rmd320_compress() 124 FF(dd, ee, aa, bb, cc, X[ 7], 9); in ss_rmd320_compress() [all …]
|
| /optee_os/lib/libmbedtls/mbedtls/library/ |
| H A D | bignum.c | 60 int mbedtls_mpi_lt_mpi_ct(const mbedtls_mpi *X, in mbedtls_mpi_lt_mpi_ct() argument 66 if (X->n != Y->n) { in mbedtls_mpi_lt_mpi_ct() 74 X_is_negative = mbedtls_ct_bool((X->s & 2) >> 1); in mbedtls_mpi_lt_mpi_ct() 92 void * const p[2] = { X->p, Y->p }; in mbedtls_mpi_lt_mpi_ct() 94 mbedtls_ct_condition_t lt = mbedtls_mpi_core_lt_ct(p[i], p[i ^ 1], X->n); in mbedtls_mpi_lt_mpi_ct() 121 int mbedtls_mpi_safe_cond_assign(mbedtls_mpi *X, in mbedtls_mpi_safe_cond_assign() argument 127 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, Y->n)); in mbedtls_mpi_safe_cond_assign() 132 X->s = mbedtls_ct_mpi_sign_if(do_assign, Y->s, X->s); in mbedtls_mpi_safe_cond_assign() 134 mbedtls_mpi_core_cond_assign(X->p, Y->p, Y->n, do_assign); in mbedtls_mpi_safe_cond_assign() 137 for (size_t i = Y->n; i < X->n; i++) { in mbedtls_mpi_safe_cond_assign() [all …]
|
| H A D | des.c | 213 #define DES_IP(X, Y) \ argument 216 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; \ 222 (X) = (((X) << 1) | ((X) >> 31)) & 0xFFFFFFFF; \ 228 #define DES_FP(X, Y) \ argument 231 (X) = (((X) << 31) | ((X) >> 1)) & 0xFFFFFFFF; \ 232 T = ((X) ^ (Y)) & 0xAAAAAAAA; (X) ^= T; (Y) ^= T; \ [all …]
|
| H A D | bignum_mod_raw.c | 26 void mbedtls_mpi_mod_raw_cond_assign(mbedtls_mpi_uint *X, in mbedtls_mpi_mod_raw_cond_assign() argument 31 mbedtls_mpi_core_cond_assign(X, A, N->limbs, mbedtls_ct_bool(assign)); in mbedtls_mpi_mod_raw_cond_assign() 34 void mbedtls_mpi_mod_raw_cond_swap(mbedtls_mpi_uint *X, in mbedtls_mpi_mod_raw_cond_swap() argument 39 mbedtls_mpi_core_cond_swap(X, Y, N->limbs, mbedtls_ct_bool(swap)); in mbedtls_mpi_mod_raw_cond_swap() 42 int mbedtls_mpi_mod_raw_read(mbedtls_mpi_uint *X, in mbedtls_mpi_mod_raw_read() argument 52 ret = mbedtls_mpi_core_read_le(X, N->limbs, in mbedtls_mpi_mod_raw_read() 56 ret = mbedtls_mpi_core_read_be(X, N->limbs, in mbedtls_mpi_mod_raw_read() 67 if (!mbedtls_mpi_core_lt_ct(X, N->p, N->limbs)) { in mbedtls_mpi_mod_raw_read() 95 void mbedtls_mpi_mod_raw_sub(mbedtls_mpi_uint *X, in mbedtls_mpi_mod_raw_sub() argument 100 mbedtls_mpi_uint c = mbedtls_mpi_core_sub(X, A, B, N->limbs); in mbedtls_mpi_mod_raw_sub() [all …]
|
| H A D | bignum_core.c | 168 void mbedtls_mpi_core_cond_assign(mbedtls_mpi_uint *X, in mbedtls_mpi_core_cond_assign() argument 173 if (X == A) { in mbedtls_mpi_core_cond_assign() 183 X[i] = mbedtls_ct_mpi_uint_if(assign, A[i], X[i]); in mbedtls_mpi_core_cond_assign() 187 void mbedtls_mpi_core_cond_swap(mbedtls_mpi_uint *X, in mbedtls_mpi_core_cond_swap() argument 192 if (X == Y) { in mbedtls_mpi_core_cond_swap() 197 mbedtls_mpi_uint tmp = X[i]; in mbedtls_mpi_core_cond_swap() 198 X[i] = mbedtls_ct_mpi_uint_if(swap, Y[i], X[i]); in mbedtls_mpi_core_cond_swap() 203 int mbedtls_mpi_core_read_le(mbedtls_mpi_uint *X, in mbedtls_mpi_core_read_le() argument 214 if (X != NULL) { in mbedtls_mpi_core_read_le() 215 memset(X, 0, X_limbs * ciL); in mbedtls_mpi_core_read_le() [all …]
|
| H A D | bignum_mod_raw.h | 100 void mbedtls_mpi_mod_raw_cond_assign(mbedtls_mpi_uint *X, 126 void mbedtls_mpi_mod_raw_cond_swap(mbedtls_mpi_uint *X, 150 int mbedtls_mpi_mod_raw_read(mbedtls_mpi_uint *X, 195 void mbedtls_mpi_mod_raw_sub(mbedtls_mpi_uint *X, 229 void mbedtls_mpi_mod_raw_mul(mbedtls_mpi_uint *X, 277 void mbedtls_mpi_mod_raw_inv_prime(mbedtls_mpi_uint *X, 302 void mbedtls_mpi_mod_raw_add(mbedtls_mpi_uint *X, 321 mbedtls_mpi_uint *X, 338 mbedtls_mpi_uint *X, 369 int mbedtls_mpi_mod_raw_random(mbedtls_mpi_uint *X, [all …]
|
| H A D | bignum_core.h | 88 #define GET_BYTE(X, i) \ argument 89 (((X)[(i) / ciL] >> (((i) % ciL) * 8)) & 0xff) 202 void mbedtls_mpi_core_cond_assign(mbedtls_mpi_uint *X, 222 void mbedtls_mpi_core_cond_swap(mbedtls_mpi_uint *X, 241 int mbedtls_mpi_core_read_le(mbedtls_mpi_uint *X, 263 int mbedtls_mpi_core_read_be(mbedtls_mpi_uint *X, 320 void mbedtls_mpi_core_shift_r(mbedtls_mpi_uint *X, size_t limbs, 335 void mbedtls_mpi_core_shift_l(mbedtls_mpi_uint *X, size_t limbs, 355 mbedtls_mpi_uint mbedtls_mpi_core_add(mbedtls_mpi_uint *X, 390 mbedtls_mpi_uint mbedtls_mpi_core_add_if(mbedtls_mpi_uint *X, [all …]
|
| H A D | ecp_invasive.h | 112 int mbedtls_ecp_mod_p224_raw(mbedtls_mpi_uint *X, size_t X_limbs); 134 int mbedtls_ecp_mod_p256_raw(mbedtls_mpi_uint *X, size_t X_limbs); 156 int mbedtls_ecp_mod_p521_raw(mbedtls_mpi_uint *X, size_t X_limbs); 178 int mbedtls_ecp_mod_p384_raw(mbedtls_mpi_uint *X, size_t X_limbs); 202 int mbedtls_ecp_mod_p192k1_raw(mbedtls_mpi_uint *X, size_t X_limbs); 226 int mbedtls_ecp_mod_p224k1_raw(mbedtls_mpi_uint *X, size_t X_limbs); 250 int mbedtls_ecp_mod_p256k1_raw(mbedtls_mpi_uint *X, size_t X_limbs); 271 int mbedtls_ecp_mod_p255_raw(mbedtls_mpi_uint *X, size_t X_limbs); 297 int mbedtls_ecp_mod_p448_raw(mbedtls_mpi_uint *X, size_t X_limbs);
|
| H A D | bignum_mod.c | 90 static int set_mont_const_square(const mbedtls_mpi_uint **X, in set_mont_const_square() argument 97 *X = NULL; in set_mont_const_square() 115 *X = RR.p; in set_mont_const_square() 163 int mbedtls_mpi_mod_mul(mbedtls_mpi_mod_residue *X, in mbedtls_mpi_mod_mul() argument 172 if (X->limbs != N->limbs || A->limbs != N->limbs || B->limbs != N->limbs) { in mbedtls_mpi_mod_mul() 181 mbedtls_mpi_mod_raw_mul(X->p, A->p, B->p, N, T); in mbedtls_mpi_mod_mul() 188 int mbedtls_mpi_mod_sub(mbedtls_mpi_mod_residue *X, in mbedtls_mpi_mod_sub() argument 193 if (X->limbs != N->limbs || A->limbs != N->limbs || B->limbs != N->limbs) { in mbedtls_mpi_mod_sub() 197 mbedtls_mpi_mod_raw_sub(X->p, A->p, B->p, N); in mbedtls_mpi_mod_sub() 202 static int mbedtls_mpi_mod_inv_mont(mbedtls_mpi_mod_residue *X, in mbedtls_mpi_mod_inv_mont() argument [all …]
|
| H A D | psa_crypto_ffdh.c | 153 mbedtls_mpi GX, G, X, P; in mbedtls_psa_ffdh_export_public_key() local 168 mbedtls_mpi_init(&X); mbedtls_mpi_init(&P); in mbedtls_psa_ffdh_export_public_key() 178 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&X, key_buffer, in mbedtls_psa_ffdh_export_public_key() 181 MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod(&GX, &G, &X, &P, NULL)); in mbedtls_psa_ffdh_export_public_key() 189 mbedtls_mpi_free(&X); mbedtls_mpi_free(&GX); in mbedtls_psa_ffdh_export_public_key() 205 mbedtls_mpi X, P; in mbedtls_psa_ffdh_generate_key() local 208 mbedtls_mpi_init(&P); mbedtls_mpi_init(&X); in mbedtls_psa_ffdh_generate_key() 220 MBEDTLS_MPI_CHK(mbedtls_mpi_random(&X, 3, &P, mbedtls_psa_get_random, in mbedtls_psa_ffdh_generate_key() 222 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&X, &X, 1)); in mbedtls_psa_ffdh_generate_key() 223 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&X, key_buffer, key_buffer_size)); in mbedtls_psa_ffdh_generate_key() [all …]
|
| H A D | ecp.c | 492 if (grp->G.X.p == NULL) { in mbedtls_ecp_get_type() 508 mbedtls_mpi_init(&pt->X); in mbedtls_ecp_point_init() 554 mbedtls_mpi_free(&(pt->X)); in mbedtls_ecp_point_free() 624 MBEDTLS_MPI_CHK(mbedtls_mpi_copy(&P->X, &Q->X)); in mbedtls_ecp_copy() 646 MBEDTLS_MPI_CHK(mbedtls_mpi_lset(&pt->X, 1)); in mbedtls_ecp_set_zero() 668 if (mbedtls_mpi_cmp_mpi(&P->X, &Q->X) == 0 && in mbedtls_ecp_point_cmp() 684 MBEDTLS_MPI_CHK(mbedtls_mpi_read_string(&P->X, radix, x)); in mbedtls_ecp_point_read_string() 717 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary_le(&P->X, buf, plen)); in mbedtls_ecp_point_write_binary() 744 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&P->X, buf + 1, plen)); in mbedtls_ecp_point_write_binary() 754 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&P->X, buf + 1, plen)); in mbedtls_ecp_point_write_binary() [all …]
|
| H A D | camellia.c | 459 uint32_t *RK, X[4]; in mbedtls_camellia_crypt_ecb() local 469 X[0] = MBEDTLS_GET_UINT32_BE(input, 0); in mbedtls_camellia_crypt_ecb() 470 X[1] = MBEDTLS_GET_UINT32_BE(input, 4); in mbedtls_camellia_crypt_ecb() 471 X[2] = MBEDTLS_GET_UINT32_BE(input, 8); in mbedtls_camellia_crypt_ecb() 472 X[3] = MBEDTLS_GET_UINT32_BE(input, 12); in mbedtls_camellia_crypt_ecb() 474 X[0] ^= *RK++; in mbedtls_camellia_crypt_ecb() 475 X[1] ^= *RK++; in mbedtls_camellia_crypt_ecb() 476 X[2] ^= *RK++; in mbedtls_camellia_crypt_ecb() 477 X[3] ^= *RK++; in mbedtls_camellia_crypt_ecb() 481 camellia_feistel(X, RK, X + 2); in mbedtls_camellia_crypt_ecb() [all …]
|
| /optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ |
| H A D | bignum.h | 255 void mbedtls_mpi_init(mbedtls_mpi *X); 256 void mbedtls_mpi_init_mempool(mbedtls_mpi *X); 265 void mbedtls_mpi_free(mbedtls_mpi *X); 280 int mbedtls_mpi_grow(mbedtls_mpi *X, size_t nblimbs); 297 int mbedtls_mpi_shrink(mbedtls_mpi *X, size_t nblimbs); 312 int mbedtls_mpi_copy(mbedtls_mpi *X, const mbedtls_mpi *Y); 320 void mbedtls_mpi_swap(mbedtls_mpi *X, mbedtls_mpi *Y); 350 int mbedtls_mpi_safe_cond_assign(mbedtls_mpi *X, const mbedtls_mpi *Y, unsigned char assign); 379 int mbedtls_mpi_safe_cond_swap(mbedtls_mpi *X, mbedtls_mpi *Y, unsigned char swap); 391 int mbedtls_mpi_lset(mbedtls_mpi *X, mbedtls_mpi_sint z); [all …]
|
| /optee_os/core/lib/libtomcrypt/src/encauth/ocb/ |
| H A D | s_ocb_done.c | 35 unsigned char *Z, *Y, *X; in s_ocb_done() local 54 X = XMALLOC(MAXBLOCKSIZE); in s_ocb_done() 55 if (X == NULL || Y == NULL || Z == NULL) { in s_ocb_done() 56 if (X != NULL) { in s_ocb_done() 57 XFREE(X); in s_ocb_done() 69 ocb_shift_xor(ocb, X); in s_ocb_done() 70 XMEMCPY(Z, X, ocb->block_len); in s_ocb_done() 72 X[ocb->block_len-1] ^= (ptlen*8)&255; in s_ocb_done() 73 X[ocb->block_len-2] ^= ((ptlen*8)>>8)&255; in s_ocb_done() 75 X[x] ^= ocb->Lr[x]; in s_ocb_done() [all …]
|
| /optee_os/lib/libutils/isoc/newlib/ |
| H A D | strchr.c | 73 #define UNALIGNED(X) ((long)X & (sizeof (long) - 1)) argument 79 #define DETECTNULL(X) (((X) - 0x01010101L) & ~(X) & 0x80808080UL) argument 83 #define DETECTNULL(X) (((X) - 0x0101010101010101L) & ~(X) & \ argument 92 #define DETECTCHAR(X,MASK) (DETECTNULL(X ^ MASK)) argument
|
| H A D | memchr.c | 76 #define UNALIGNED(X) ((long)X & (sizeof(long) - 1)) argument 85 #define DETECTNULL(X) (((X) - 0x01010101L) & ~(X) & 0x80808080UL) argument 89 #define DETECTNULL(X) (((X) - 0x0101010101010101L) & ~(X) & \ argument 102 #define DETECTCHAR(X, MASK) (DETECTNULL(X ^ MASK)) argument
|
| H A D | strlen.c | 73 #define UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1)) argument 76 #define DETECTNULL(X) (((X) - 0x01010101L) & ~(X) & 0x80808080UL) argument 80 #define DETECTNULL(X) (((X) - 0x0101010101010101L) & ~(X) & \ argument
|
| H A D | strcpy.c | 75 #define UNALIGNED(X, Y) \ argument 76 (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) 79 #define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) argument 83 #define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080) argument
|
| H A D | strcmp.c | 77 #define UNALIGNED(X, Y) \ argument 78 (((long)X & (sizeof(long) - 1)) | ((long)Y & (sizeof(long) - 1))) 82 #define DETECTNULL(X) (((X) - 0x01010101L) & ~(X) & 0x80808080UL) argument 85 #define DETECTNULL(X) (((X) - 0x0101010101010101L) & ~(X) & \ argument
|
| H A D | strncmp.c | 76 #define UNALIGNED(X, Y) \ argument 77 (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) 81 #define DETECTNULL(X) (((X) - 0x01010101L) & ~(X) & 0x80808080UL) argument 84 #define DETECTNULL(X) (((X) - 0x0101010101010101L) & ~(X) & \ argument
|
| H A D | strncpy.c | 81 #define UNALIGNED(X, Y) \ argument 82 (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) 85 #define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) argument 89 #define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080) argument
|
| /optee_os/core/lib/libtomcrypt/src/encauth/gcm/ |
| H A D | gcm_add_aad.c | 48 gcm->X[x] ^= gcm->buf[x]; in gcm_add_aad() 52 gcm_mult_h(gcm, gcm->X); in gcm_add_aad() 59 gcm->X[x] ^= gcm->buf[x]; in gcm_add_aad() 61 gcm_mult_h(gcm, gcm->X); in gcm_add_aad() 64 XMEMCPY(gcm->Y, gcm->X, 16); in gcm_add_aad() 65 zeromem(gcm->X, 16); in gcm_add_aad() 89 *(LTC_FAST_TYPE_PTR_CAST(&gcm->X[y])) ^= *(LTC_FAST_TYPE_PTR_CAST(&adata[x + y])); in gcm_add_aad() 91 gcm_mult_h(gcm, gcm->X); in gcm_add_aad() 101 gcm->X[gcm->buflen++] ^= *adata++; in gcm_add_aad() 105 gcm_mult_h(gcm, gcm->X); in gcm_add_aad()
|