| /optee_os/lib/libmbedtls/mbedtls/library/ |
| H A D | bn_mul.h | 105 "movl %%ebx, %0 \n\t" \ 106 "movl %5, %%esi \n\t" \ 107 "movl %6, %%edi \n\t" \ 108 "movl %7, %%ecx \n\t" \ 109 "movl %8, %%ebx \n\t" 112 "lodsl \n\t" \ 113 "mull %%ebx \n\t" \ 114 "addl %%ecx, %%eax \n\t" \ 115 "adcl $0, %%edx \n\t" \ 116 "addl (%%edi), %%eax \n\t" \ [all …]
|
| H A D | bignum_mod_raw.c | 28 const mbedtls_mpi_mod_modulus *N, 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() 36 const mbedtls_mpi_mod_modulus *N, 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() 43 const mbedtls_mpi_mod_modulus *N, 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() 78 const mbedtls_mpi_mod_modulus *N, in mbedtls_mpi_mod_raw_write() argument 85 return mbedtls_mpi_core_write_le(A, N->limbs, in mbedtls_mpi_mod_raw_write() [all …]
|
| H A D | bignum_mod.c | 26 const mbedtls_mpi_mod_modulus *N, in mbedtls_mpi_mod_residue_setup() argument 30 if (p_limbs != N->limbs || !mbedtls_mpi_core_lt_ct(p, N->p, N->limbs)) { in mbedtls_mpi_mod_residue_setup() 34 r->limbs = N->limbs; in mbedtls_mpi_mod_residue_setup() 50 void mbedtls_mpi_mod_modulus_init(mbedtls_mpi_mod_modulus *N) in mbedtls_mpi_mod_modulus_init() argument 52 if (N == NULL) { in mbedtls_mpi_mod_modulus_init() 56 N->p = NULL; in mbedtls_mpi_mod_modulus_init() 57 N->limbs = 0; in mbedtls_mpi_mod_modulus_init() 58 N->bits = 0; in mbedtls_mpi_mod_modulus_init() 59 N->int_rep = MBEDTLS_MPI_MOD_REP_INVALID; in mbedtls_mpi_mod_modulus_init() 62 void mbedtls_mpi_mod_modulus_free(mbedtls_mpi_mod_modulus *N) in mbedtls_mpi_mod_modulus_free() argument [all …]
|
| H A D | aesni.c | 75 asm ("movl $1, %%eax \n\t" in mbedtls_aesni_has_support() 76 "cpuid \n\t" in mbedtls_aesni_has_support() 446 #define AESDEC(regs) ".byte 0x66,0x0F,0x38,0xDE," regs "\n\t" 447 #define AESDECLAST(regs) ".byte 0x66,0x0F,0x38,0xDF," regs "\n\t" 448 #define AESENC(regs) ".byte 0x66,0x0F,0x38,0xDC," regs "\n\t" 449 #define AESENCLAST(regs) ".byte 0x66,0x0F,0x38,0xDD," regs "\n\t" 450 #define AESIMC(regs) ".byte 0x66,0x0F,0x38,0xDB," regs "\n\t" 451 #define AESKEYGENA(regs, imm) ".byte 0x66,0x0F,0x3A,0xDF," regs "," imm "\n\t" 452 #define PCLMULQDQ(regs, imm) ".byte 0x66,0x0F,0x3A,0x44," regs "," imm "\n\t" 470 asm ("movdqu (%3), %%xmm0 \n\t" // load input in mbedtls_aesni_crypt_ecb() [all …]
|
| H A D | padlock.c | 33 asm ("movl %%ebx, %0 \n\t" in mbedtls_padlock_has_support() 34 "movl $0xC0000000, %%eax \n\t" in mbedtls_padlock_has_support() 35 "cpuid \n\t" in mbedtls_padlock_has_support() 36 "cmpl $0xC0000001, %%eax \n\t" in mbedtls_padlock_has_support() 37 "movl $0, %%edx \n\t" in mbedtls_padlock_has_support() 38 "jb 1f \n\t" in mbedtls_padlock_has_support() 39 "movl $0xC0000001, %%eax \n\t" in mbedtls_padlock_has_support() 40 "cpuid \n\t" in mbedtls_padlock_has_support() 41 "1: \n\t" in mbedtls_padlock_has_support() 42 "movl %%edx, %1 \n\t" in mbedtls_padlock_has_support() [all …]
|
| H A D | bignum_mod_raw.h | 21 * named \c N and is usually input-only. 55 * range [0, \c N - 1] and guarantee outputs in the range [0, \c N - 1]. If 81 * The size to copy is determined by \p N. 87 * \param[in] N The address of the modulus related to \p X and \p A. 102 const mbedtls_mpi_mod_modulus *N, 109 * The size to swap is determined by \p N. 113 * \param[in] N The address of the modulus related to \p X and \p Y. 128 const mbedtls_mpi_mod_modulus *N, 136 * \param[out] X The address of the MPI. The size is determined by \p N. 138 * the modulus \p N.) [all …]
|
| H A D | bignum_mod.h | 13 * named \c N and is usually input-only. Functions which take a parameter 18 * associated with the modulus \c N. Unless otherwise specified: 24 * they must be set up and associated with the modulus \c N. Some 51 * form (i.e. that \c A < \c N), this is only checked during setup of a 54 * range [0, \c N - 1] and guarantee outputs in the range [0, \c N - 1]. 111 mbedtls_mpi_uint const *rr; /* The residue for 2^{2*n*biL} mod N */ 112 mbedtls_mpi_uint mm; /* Montgomery const for -N^{-1} mod 2^{ciL} */ 136 * The residue will be set up with the buffer \p p and modulus \p N. 141 * and interpreted according to the value of the `N->int_rep` field. 143 * The modulus \p N will be the modulus associated with \p r. The residue \p r [all …]
|
| H A D | psa_crypto_core_common.h | 18 * (`p + n` has undefined behavior when `p` is null, even when `n == 0`. 22 * \param p Pointer to a buffer of at least n bytes. 23 * This may be \p NULL if \p n is zero. 24 * \param n An offset in bytes. 25 * \return Pointer to offset \p n in the buffer \p p. 27 * buffer is at least \p n + 1. 30 unsigned char *p, size_t n) in psa_crypto_buffer_offset() argument 32 return p == NULL ? NULL : p + n; in psa_crypto_buffer_offset() 39 * \param p Pointer to a buffer of at least n bytes. 40 * This may be \p NULL if \p n is zero. [all …]
|
| H A D | bignum.c | 66 if (X->n != Y->n) { in mbedtls_mpi_lt_mpi_ct() 71 * Set N_is_negative to MBEDTLS_CT_FALSE if N >= 0, MBEDTLS_CT_TRUE if N < 0. in mbedtls_mpi_lt_mpi_ct() 72 * We know that N->s == 1 if N >= 0 and N->s == -1 if N < 0. 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() 127 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, Y->n)); 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() 165 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(X, Y->n)); in mbedtls_mpi_safe_cond_swap() 166 MBEDTLS_MPI_CHK(mbedtls_mpi_grow(Y, X->n)); in mbedtls_mpi_safe_cond_swap() 172 mbedtls_mpi_core_cond_swap(X->p, Y->p, X->n, do_swap); in mbedtls_mpi_safe_cond_swap() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/misc/crypt/ |
| H A D | crypt.c | 13 "LibTomCrypt " SCRYPT " (www.libtom.net)\n" 14 "LibTomCrypt is public domain software.\n" 16 "Built on " __DATE__ " at " __TIME__ "\n" 18 "\n\nEndianness: " 28 " (32-bit words)\n" 30 " (64-bit words)\n" 32 " (no wordsize defined)\n" 36 "enabled\n" 38 "disabled\n" 40 "\nCiphers built-in:\n" [all …]
|
| /optee_os/core/arch/riscv/plat-spike/ |
| H A D | conf.mk | 2 $(call force,CFG_WITH_USER_TA,n) 4 $(call force,CFG_CORE_FFA,n) 5 $(call force,CFG_CORE_DYN_SHM,n) 6 $(call force,CFG_SECURE_PARTITION,n) 7 $(call force,CFG_PAGED_USER_TA,n) 8 $(call force,CFG_WITH_PAGER,n) 10 $(call force,CFG_EMBEDDED_TS,n) 11 $(call force,CFG_CORE_ASLR,n) 13 $(call force,CFG_UNWIND,n) 14 $(call force,CFG_DT,n) [all …]
|
| /optee_os/core/lib/scmi-server/ |
| H A D | conf.mk | 11 # Boolean y|n switches for module features 34 CFG_SCPFW_MOD_CLOCK ?= n 35 CFG_SCPFW_MOD_DVFS ?= n 36 CFG_SCPFW_MOD_MOCK_CLOCK ?= n 37 CFG_SCPFW_MOD_MOCK_PPU ?= n 38 CFG_SCPFW_MOD_MOCK_PSU ?= n 39 CFG_SCPFW_MOD_MSG_SMT ?= n 40 CFG_SCPFW_MOD_OPTEE_CLOCK ?= n 42 CFG_SCPFW_MOD_OPTEE_MBX ?= n 43 CFG_SCPFW_MOD_OPTEE_RESET ?= n [all …]
|
| /optee_os/lib/libutils/compiler-rt/lib/builtins/ |
| H A D | int_div_impl.inc | 16 static __inline fixuint_t __udivXi3(fixuint_t n, fixuint_t d) { 17 const unsigned N = sizeof(fixuint_t) * CHAR_BIT; 19 unsigned sr = (d ? clz(d) : N) - (n ? clz(n) : N); 20 // 0 <= sr <= N - 1 or sr is very large. 21 if (sr > N - 1) // n < d 23 if (sr == N - 1) // d == 1 24 return n; 26 // 1 <= sr <= N - 1. Shifts do not trigger UB. 27 fixuint_t r = n >> sr; 28 n <<= N - sr; [all …]
|
| /optee_os/core/arch/arm/plat-sam/ |
| H A D | tz_matrix.h | 30 #define MATRIX_MCFG(n) (0x0000 + (n) * 4) /* Master Configuration Register */ argument 31 #define MATRIX_SCFG(n) (0x0040 + (n) * 4) /* Slave Configuration Register */ argument 32 #define MATRIX_PRAS(n) (0x0080 + (n) * 8) /* Priority Register A for Slave */ argument 33 #define MATRIX_PRBS(n) (0x0084 + (n) * 8) /* Priority Register B for Slave */ argument 41 /* Master n Error Address Register */ 42 #define MATRIX_MEAR(n) (0x0160 + (n) * 4) argument 47 /* Security Slave n Register */ 48 #define MATRIX_SSR(n) (0x0200 + (n) * 4) argument 49 /* Security Area Split Slave n Register */ 50 #define MATRIX_SASSR(n) (0x0240 + (n) * 4) argument [all …]
|
| /optee_os/lib/libutee/ |
| H A D | user_ta_entry_compat.c | 3 * Copyright (c) 2014, STMicroelectronics International N.V. 12 size_t n = 0; in to_gp11_param() local 14 for (n = 0; n < TEE_NUM_PARAMS; n++) { in to_gp11_param() 15 switch (TEE_PARAM_TYPE_GET(pt, n)) { in to_gp11_param() 19 gp11_params[n].value.a = params[n].value.a; in to_gp11_param() 20 gp11_params[n].value.b = params[n].value.b; in to_gp11_param() 25 gp11_params[n].memref.buffer = params[n].memref.buffer; in to_gp11_param() 26 gp11_params[n].memref.size = params[n].memref.size; in to_gp11_param() 38 size_t n = 0; in from_gp11_param() local 40 for (n = 0; n < TEE_NUM_PARAMS; n++) { in from_gp11_param() [all …]
|
| H A D | tee_api.c | 3 * Copyright (c) 2014, STMicroelectronics International N.V. 39 size_t n = 0; in copy_param() local 44 for (n = 0; n < TEE_NUM_PARAMS; n++) { in copy_param() 45 switch (TEE_PARAM_TYPE_GET(up->types, n)) { in copy_param() 48 a = params[n].value.a; in copy_param() 49 b = params[n].value.b; in copy_param() 54 a = (vaddr_t)params[n].memref.buffer; in copy_param() 55 b = params[n].memref.size; in copy_param() 61 up->vals[n * 2] = a; in copy_param() 62 up->vals[n * 2 + 1] = b; in copy_param() [all …]
|
| /optee_os/core/kernel/ |
| H A D | thread.c | 4 * Copyright (c) 2014, STMicroelectronics International N.V. 47 * stack_xxx[n] "hard" top "soft" top bottom 64 #define GET_STACK_BOTTOM(stack, n) ((vaddr_t)&(stack)[n] + sizeof(stack[n]) - \ argument 68 #define GET_STACK_BOTTOM(stack, n) 0 argument 73 #define GET_STACK_THREAD_BOTTOM(n) 0 argument 76 #define GET_STACK_THREAD_BOTTOM(n) \ argument 77 ((vaddr_t)&stack_thread[n] + sizeof(stack_thread[n]) - \ 144 size_t n = 0; in thread_init_canaries() local 147 for (n = 0; n < thread_core_count; n++) { in thread_init_canaries() 148 if (thread_core_local[n].tmp_stack_va_end) { in thread_init_canaries() [all …]
|
| H A D | handle.c | 22 size_t n = 0; in handle_db_destroy() local 24 for (n = 0; n < db->max_ptrs; n++) in handle_db_destroy() 25 if (db->ptrs[n]) in handle_db_destroy() 26 ptr_destructor(db->ptrs[n]); in handle_db_destroy() 36 size_t n = 0; in handle_db_is_empty() local 39 for (n = 0; n < db->max_ptrs; n++) { in handle_db_is_empty() 40 if (db->ptrs[n]) in handle_db_is_empty() 49 size_t n; in handle_get() local 57 for (n = 0; n < db->max_ptrs; n++) { in handle_get() 58 if (!db->ptrs[n]) { in handle_get() [all …]
|
| /optee_os/lib/libutils/ext/ |
| H A D | base64.c | 4 * Copyright (c) 2014, STMicroelectronics International N.V. 18 size_t n = 0; in base64_enc() local 22 n = base64_enc_len(dlen); in base64_enc() 23 if (*blen < n) { in base64_enc() 24 *blen = n; in base64_enc() 28 for (n = 0; n < dlen; n += 3) { in base64_enc() 31 igrp = d[n]; in base64_enc() 34 if ((n + 1) < dlen) in base64_enc() 35 igrp |= d[n + 1]; in base64_enc() 38 if ((n + 2) < dlen) in base64_enc() [all …]
|
| /optee_os/core/crypto/ |
| H A D | aes-gcm-sw.c | 41 size_t n = 0; in internal_aes_gcm_ghash_update() local 47 for (n = 0; n < num_blocks; n++) in internal_aes_gcm_ghash_update() 50 n * TEE_AES_BLOCK_SIZE); in internal_aes_gcm_ghash_update() 72 size_t n = 0; in encrypt_pl() local 75 for (n = 0; n < num_blocks; n++) { in encrypt_pl() 76 const void *s = src + n * TEE_AES_BLOCK_SIZE; in encrypt_pl() 77 void *d = dst + n * TEE_AES_BLOCK_SIZE; in encrypt_pl() 82 for (n = 0; n < num_blocks; n++) { in encrypt_pl() 84 void *d = dst + n * TEE_AES_BLOCK_SIZE; in encrypt_pl() 86 memcpy(tmp, src + n * TEE_AES_BLOCK_SIZE, sizeof(tmp)); in encrypt_pl() [all …]
|
| /optee_os/core/drivers/clk/sam/ |
| H A D | sama5d2_clk.c | 23 const char *n; member 64 { .n = "ddrck", .id = 2 }, 65 { .n = "lcdck", .id = 3 }, 66 { .n = "uhpck", .id = 6 }, 67 { .n = "udpck", .id = 7 }, 68 { .n = "pck0", .id = 8 }, 69 { .n = "pck1", .id = 9 }, 70 { .n = "pck2", .id = 10 }, 71 { .n = "iscck", .id = 18 }, 79 .clk = { .n = "macb0_clk", .id = 5 }, [all …]
|
| /optee_os/lib/libutils/ext/include/ |
| H A D | speculation_barrier.h | 74 "cmp\t%[__c], %[__l]\n\t" \ 75 "bcc\t.ns%=\n\t" \ 76 "ldr" __sz "\t%" __w "[__v], %[__p]\n" \ 77 ".ns%=:\n\t" \ 78 "csel\t%" __w "[__v], %" __w "[__v], %" __w "[__f], cs\n\t" \ 97 "cmp\t%[__c], %[__l]\n\t" \ 98 "ccmp\t%[__c], %[__h], 2, cs\n\t" \ 99 "bcs\t.ns%=\n\t" \ 100 "ldr" __sz "\t%" __w "[__v], %[__p]\n" \ 101 ".ns%=:\n\t" \ [all …]
|
| /optee_os/scripts/ |
| H A D | gen_ldelf_hex.py | 31 def round_up(n, m): argument 32 if n == 0: 35 return (((n - 1) // m) + 1) * m 48 n = 0 68 print('RO load segment found after RW one(s) (m={})'.format(n)) 77 'segment {}, please check'.format(pad, n-1)) 80 n = n + 1 85 n = 0 88 sz = segment['p_filesz'] + pad_size[n] 94 n = n + 1 [all …]
|
| H A D | ts_bin_to_c.py | 121 f.write('\n') 149 os.path.basename(__file__) + ' */\n\n') 150 f.write('#include <kernel/embedded_ts.h>\n\n') 151 f.write('#include <scattered_array.h>\n\n') 152 f.write('const uint8_t ts_bin_' + ts_uuid.hex + '[] = {\n') 154 f.write('};\n') 158 f.write('#include <kernel/secure_partition.h>\n\n') 159 f.write('const uint8_t fdt_bin_' + ts_uuid.hex + '[] = {\n') 161 f.write('};\n') 163 sp_image) = {\n') [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/rsa/ |
| H A D | rsa_key.c | 17 unsigned n; in s_mpi_shrink_multi() local 24 n = 0; in s_mpi_shrink_multi() 29 if (n >= sizeof(tmp)/sizeof(tmp[0])) { in s_mpi_shrink_multi() 33 arg[n] = cur; in s_mpi_shrink_multi() 34 if ((err = mp_init_copy(&tmp[n], *arg[n])) != CRYPT_OK) { in s_mpi_shrink_multi() 37 n++; in s_mpi_shrink_multi() 44 while (n != 0 && arg[--n] != NULL) { in s_mpi_shrink_multi() 45 mp_clear(*arg[n]); in s_mpi_shrink_multi() 46 *arg[n] = tmp[n]; in s_mpi_shrink_multi() 54 (n >= sizeof(tmp)/sizeof(tmp[0]))) { in s_mpi_shrink_multi() [all …]
|