| /optee_os/core/kernel/ |
| H A D | mutex.c | 16 void mutex_init(struct mutex *m) in mutex_init() argument 18 *m = (struct mutex)MUTEX_INITIALIZER; in mutex_init() 21 void mutex_init_recursive(struct recursive_mutex *m) in mutex_init_recursive() argument 23 *m = (struct recursive_mutex)RECURSIVE_MUTEX_INITIALIZER; in mutex_init_recursive() 26 static void __mutex_lock(struct mutex *m, const char *fname, int lineno) in __mutex_lock() argument 32 mutex_lock_check(m); in __mutex_lock() 48 old_itr_status = cpu_spin_lock_xsave(&m->spin_lock); in __mutex_lock() 50 can_lock = !m->state; in __mutex_lock() 52 wq_wait_init(&m->wq, &wqe, false /* wait_read */); in __mutex_lock() 54 m->state = -1; /* write locked */ in __mutex_lock() [all …]
|
| H A D | mutex_lockdep.h | 13 void mutex_lock_check(struct mutex *m); 15 void mutex_trylock_check(struct mutex *m); 17 void mutex_unlock_check(struct mutex *m); 19 void mutex_destroy_check(struct mutex *m); 23 static inline void mutex_lock_check(struct mutex *m __unused) in mutex_lock_check() 26 static inline void mutex_trylock_check(struct mutex *m __unused) in mutex_trylock_check() 29 static inline void mutex_unlock_check(struct mutex *m __unused) in mutex_unlock_check() 32 static inline void mutex_destroy_check(struct mutex *m __unused) in mutex_destroy_check()
|
| H A D | mutex_lockdep.c | 37 void mutex_lock_check(struct mutex *m) in mutex_lock_check() argument 43 lockdep_lock_acquire(&graph, &owned[thread], (uintptr_t)m); in mutex_lock_check() 47 void mutex_trylock_check(struct mutex *m) in mutex_trylock_check() argument 53 lockdep_lock_tryacquire(&graph, &owned[thread], (uintptr_t)m); in mutex_trylock_check() 57 void mutex_unlock_check(struct mutex *m) in mutex_unlock_check() argument 63 lockdep_lock_release(&owned[thread], (uintptr_t)m); in mutex_unlock_check() 67 void mutex_destroy_check(struct mutex *m) in mutex_destroy_check() argument 71 lockdep_lock_destroy(&graph, (uintptr_t)m); in mutex_destroy_check()
|
| /optee_os/core/include/kernel/ |
| H A D | mutex.h | 22 struct mutex m; /* used when lock_depth goes 0 -> 1 or 1 -> 0 */ member 27 #define RECURSIVE_MUTEX_INITIALIZER { .m = MUTEX_INITIALIZER, \ 32 void mutex_init(struct mutex *m); 33 void mutex_destroy(struct mutex *m); 35 void mutex_init_recursive(struct recursive_mutex *m); 36 void mutex_destroy_recursive(struct recursive_mutex *m); 37 unsigned int mutex_get_recursive_lock_depth(struct recursive_mutex *m); 40 void mutex_unlock_debug(struct mutex *m, const char *fname, int lineno); 41 #define mutex_unlock(m) mutex_unlock_debug((m), __FILE__, __LINE__) argument 43 void mutex_lock_debug(struct mutex *m, const char *fname, int lineno); [all …]
|
| H A D | mutex_pm_aware.h | 37 void mutex_pm_aware_init(struct mutex_pm_aware *m); 38 void mutex_pm_aware_destroy(struct mutex_pm_aware *m); 39 void mutex_pm_aware_lock(struct mutex_pm_aware *m); 40 void mutex_pm_aware_unlock(struct mutex_pm_aware *m);
|
| /optee_os/core/arch/arm/mm/ |
| H A D | mobj_ffa.c | 165 struct mobj_ffa_shm *m = NULL; in ffa_shm_new() local 174 m = calloc(1, s); in ffa_shm_new() 175 if (!m) in ffa_shm_new() 178 m->mf.mobj.ops = &mobj_ffa_shm_ops; in ffa_shm_new() 179 m->mf.mobj.size = num_pages * SMALL_PAGE_SIZE; in ffa_shm_new() 180 m->mf.mobj.phys_granule = SMALL_PAGE_SIZE; in ffa_shm_new() 181 refcount_set(&m->mf.mobj.refc, 0); in ffa_shm_new() 182 m->mf.inactive_refs = 0; in ffa_shm_new() 184 return &m->mf; in ffa_shm_new() 190 struct mobj_ffa_prm *m = NULL; in ffa_prm_new() local [all …]
|
| H A D | sp_mem.c | 48 struct mobj_sp *m = NULL; in sp_mem_new_mobj() local 55 m = calloc(1, s); in sp_mem_new_mobj() 56 if (!m) in sp_mem_new_mobj() 59 m->mobj.ops = &mobj_sp_ops; in sp_mem_new_mobj() 60 m->mobj.size = pages * SMALL_PAGE_SIZE; in sp_mem_new_mobj() 61 m->mobj.phys_granule = SMALL_PAGE_SIZE; in sp_mem_new_mobj() 63 m->mem_type = mem_type; in sp_mem_new_mobj() 64 m->is_secure = is_secure; in sp_mem_new_mobj() 66 refcount_set(&m->mobj.refc, 1); in sp_mem_new_mobj() 67 return &m->mobj; in sp_mem_new_mobj() [all …]
|
| /optee_os/lib/libutils/ext/ |
| H A D | base64.c | 79 size_t m = 0; in base64_dec() local 96 if (b && m < *blen) in base64_dec() 97 b[m] = byte | (idx >> 4); in base64_dec() 98 m++; in base64_dec() 103 if (b && m < *blen) in base64_dec() 104 b[m] = byte | (idx >> 2); in base64_dec() 105 m++; in base64_dec() 110 if (b && m < *blen) in base64_dec() 111 b[m] = byte | idx; in base64_dec() 112 m++; in base64_dec() [all …]
|
| /optee_os/core/mm/ |
| H A D | mobj.c | 248 struct mobj_shm *m = to_mobj_shm(mobj); in mobj_shm_get_va() local 253 return phys_to_virt(m->pa + offset, MEM_AREA_NSEC_SHM, in mobj_shm_get_va() 260 struct mobj_shm *m = to_mobj_shm(mobj); in mobj_shm_get_pa() local 266 p = m->pa + offs; in mobj_shm_get_pa() 304 struct mobj_shm *m = to_mobj_shm(mobj); in mobj_shm_free() local 306 free(m); in mobj_shm_free() 337 struct mobj_shm *m; in mobj_shm_alloc() local 342 m = calloc(1, sizeof(*m)); in mobj_shm_alloc() 343 if (!m) in mobj_shm_alloc() 346 m->mobj.size = size; in mobj_shm_alloc() [all …]
|
| H A D | mobj_dyn_shm.c | 333 struct mobj_protmem *m = NULL; in check_protmem_conflict() local 336 SLIST_FOREACH(m, &protmem_list, next) { in check_protmem_conflict() 337 res = check_reg_shm_conflict(r, m->pa, m->mobj.size); in check_protmem_conflict() 420 struct mobj_protmem *m = NULL; in protmem_find_unlocked() local 422 SLIST_FOREACH(m, &protmem_list, next) in protmem_find_unlocked() 423 if (m->cookie == cookie) in protmem_find_unlocked() 424 return m; in protmem_find_unlocked() 434 struct mobj *m = NULL; in mobj_reg_shm_get_by_cookie() local 439 m = mobj_get(&rs->mobj); in mobj_reg_shm_get_by_cookie() 444 m = mobj_get(&rm->mobj); in mobj_reg_shm_get_by_cookie() [all …]
|
| H A D | core_mmu.c | 124 struct tee_mmap_region *m = NULL; in heap_realloc_memory_map() local 127 size_t sz = old_sz + sizeof(*m); in heap_realloc_memory_map() 130 m = nex_realloc(old, sz); in heap_realloc_memory_map() 131 if (!m) in heap_realloc_memory_map() 133 mem_map->map = m; in heap_realloc_memory_map() 139 struct tee_mmap_region *m = NULL; in boot_mem_realloc_memory_map() local 144 m = boot_mem_alloc_tmp(sz, alignof(*m)); in boot_mem_realloc_memory_map() 145 memcpy(m, old, old_sz); in boot_mem_realloc_memory_map() 146 mem_map->map = m; in boot_mem_realloc_memory_map() 392 struct core_mmu_phys_mem *m = *mem; in carve_out_phys_mem() local [all …]
|
| /optee_os/core/lib/libtomcrypt/src/mac/poly1305/ |
| H A D | poly1305_test.c | 21 char m[] = "Cryptographic Forum Research Group"; in poly1305_test() 22 unsigned long len = 16, mlen = XSTRLEN(m); in poly1305_test() 29 if ((err = poly1305_process(&st, (unsigned char*)m, 5)) != CRYPT_OK) return err; in poly1305_test() 30 if ((err = poly1305_process(&st, (unsigned char*)m + 5, 4)) != CRYPT_OK) return err; in poly1305_test() 31 if ((err = poly1305_process(&st, (unsigned char*)m + 9, 3)) != CRYPT_OK) return err; in poly1305_test() 32 if ((err = poly1305_process(&st, (unsigned char*)m + 12, 2)) != CRYPT_OK) return err; in poly1305_test() 33 if ((err = poly1305_process(&st, (unsigned char*)m + 14, 1)) != CRYPT_OK) return err; in poly1305_test() 34 if ((err = poly1305_process(&st, (unsigned char*)m + 15, mlen - 15)) != CRYPT_OK) return err; in poly1305_test() 39 if ((err = poly1305_process(&st, (unsigned char*)m, mlen)) != CRYPT_OK) return err; in poly1305_test()
|
| /optee_os/core/lib/libtomcrypt/src/pk/ed25519/ |
| H A D | ed25519_verify.c | 18 unsigned char* m; in s_ed25519_verify() local 35 m = XMALLOC(mlen); in s_ed25519_verify() 36 if (m == NULL) return CRYPT_MEM; in s_ed25519_verify() 38 XMEMCPY(m, sig, siglen); in s_ed25519_verify() 39 XMEMCPY(m + siglen, msg, msglen); in s_ed25519_verify() 42 m, &mlen, in s_ed25519_verify() 43 m, mlen, in s_ed25519_verify() 48 zeromem(m, msglen + siglen); in s_ed25519_verify() 50 XFREE(m); in s_ed25519_verify()
|
| /optee_os/lib/libutils/isoc/newlib/ |
| H A D | memset.c | 75 _PTR _DEFUN(memset, (m, c, n), _PTR m _AND int c _AND size_t n) 77 char *s = (char *)m; 90 return m; 128 return m;
|
| /optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/ |
| H A D | chacha20poly1305_test.c | 27 …char m[] = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the fu… in chacha20poly1305_test() 28 unsigned long mlen = XSTRLEN(m); in chacha20poly1305_test() 41 …if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m, 25, ct)) != CRYPT_OK) re… in chacha20poly1305_test() 42 …if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 25, 10, ct + 25)) != CRYPT_O… in chacha20poly1305_test() 43 …if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 35, 35, ct + 35)) != CRYPT_O… in chacha20poly1305_test() 44 …if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 70, 5, ct + 70)) != CRYPT_O… in chacha20poly1305_test() 45 …if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 75, 5, ct + 75)) != CRYPT_O… in chacha20poly1305_test() 46 …if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 80, mlen - 80, ct + 80)) != CRYPT_O… in chacha20poly1305_test() 62 if (compare_testvector(pt, mlen, m, mlen, "DEC-PT", 3) != 0) return CRYPT_FAIL_TESTVECTOR; in chacha20poly1305_test() 67 …err = chacha20poly1305_memory(k, sizeof(k), i12, sizeof(i12), aad, sizeof(aad), (unsigned char *)m, in chacha20poly1305_test() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/ecc/ |
| H A D | ecc_recover_key.c | 31 void *p, *m, *a, *b; in ecc_recover_key() local 54 m = key->dp.prime; in ecc_recover_key() 171 …if ((err = mp_mulmod(p, x, m, x)) != CRYPT_OK) … in ecc_recover_key() 175 …if ((err = mp_mulmod(t1, x, m, t1)) != CRYPT_OK) … in ecc_recover_key() 177 …if ((err = mp_mulmod(a, x, m, t2)) != CRYPT_OK) … in ecc_recover_key() 182 …if ((err = mp_sqrtmod_prime(t1, m, t2)) != CRYPT_OK) … in ecc_recover_key() 187 …if ((err = mp_mod(t2, m, mR->y)) != CRYPT_OK) … in ecc_recover_key() 190 …if ((err = mp_submod(m, t2, m, mR->y)) != CRYPT_OK) … in ecc_recover_key() 213 …if ((err = mp_montgomery_setup(m, &mp)) != CRYPT_OK) … in ecc_recover_key() 216 if (mp_cmp(a_plus3, m) != LTC_MP_EQ) { in ecc_recover_key() [all …]
|
| H A D | ecc_verify_hash.c | 29 void *r, *s, *v, *w, *u1, *u2, *e, *p, *m, *a, *a_plus3; in ecc_verify_hash_ex() local 50 m = key->dp.prime; in ecc_verify_hash_ex() 162 …if ((err = mp_montgomery_setup(m, &mp)) != CRYPT_OK) … in ecc_verify_hash_ex() 165 if (mp_cmp(a_plus3, m) != LTC_MP_EQ) { in ecc_verify_hash_ex() 167 …if ((err = mp_montgomery_normalization(mu, m)) != CRYPT_OK) … in ecc_verify_hash_ex() 168 …if ((err = mp_mulmod(a, mu, m, ma)) != CRYPT_OK) … 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() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/ec25519/ |
| H A D | tweetnacl.c | 72 gf m,t; in pack25519() local 78 m[0]=t[0]-0xffed; in pack25519() 80 m[i]=t[i]-0xffff-((m[i-1]>>16)&1); in pack25519() 81 m[i-1]&=0xffff; in pack25519() 83 m[15]=t[15]-0x7fff-((m[14]>>16)&1); in pack25519() 84 b=(m[15]>>16)&1; in pack25519() 85 m[14]&=0xffff; in pack25519() 86 sel25519(t,m,1-b); in pack25519() 224 static LTC_INLINE int tweetnacl_crypto_hash_ctx(u8 *out,const u8 *m,u64 n,const u8 *ctx,u32 cs) in tweetnacl_crypto_hash_ctx() argument 232 return hash_memory(hash_idx, m, n, out, &len); in tweetnacl_crypto_hash_ctx() [all …]
|
| /optee_os/core/pta/tests/ |
| H A D | aes_perf.c | 138 unsigned int m = 0; in do_update() local 146 for (m = 0; m < sz / unit_size; m++) { in do_update() 147 res = update_func(ctx, mode, in + m * unit_size, in do_update() 148 unit_size, out + m * unit_size); in do_update() 153 res = update_func(ctx, mode, in + m * unit_size, in do_update() 154 sz % unit_size, out + m * unit_size); in do_update()
|
| /optee_os/core/lib/libtomcrypt/src/mac/pmac/ |
| H A D | pmac_init.c | 40 int poly, x, y, m, err; in pmac_init() local 92 m = pmac->Ls[x-1][0] >> 7; in pmac_init() 98 if (m == 1) { in pmac_init() 106 m = L[pmac->block_len-1] & 1; in pmac_init() 114 if (m == 1) { in pmac_init()
|
| /optee_os/core/lib/libtomcrypt/src/modes/xts/ |
| H A D | xts_decrypt.c | 57 unsigned long i, m, mo, lim; in xts_decrypt() local 72 m = ptlen >> 4; in xts_decrypt() 76 if (m == 0) { in xts_decrypt() 81 lim = m; in xts_decrypt() 83 lim = m - 1; in xts_decrypt()
|
| H A D | xts_encrypt.c | 59 unsigned long i, m, mo, lim; in xts_encrypt() local 74 m = ptlen >> 4; in xts_encrypt() 78 if (m == 0) { in xts_encrypt() 83 lim = m; in xts_encrypt() 85 lim = m - 1; in xts_encrypt()
|
| /optee_os/core/lib/libtomcrypt/src/encauth/ocb/ |
| H A D | ocb_init.c | 42 int poly, x, y, m, err; in ocb_init() local 90 m = ocb->Ls[x-1][0] >> 7; in ocb_init() 96 if (m == 1) { in ocb_init() 104 m = ocb->L[ocb->block_len-1] & 1; in ocb_init() 112 if (m == 1) { in ocb_init()
|
| /optee_os/core/arch/arm/crypto/ |
| H A D | sha1_armv8a_ce_a32.S | 86 add_update m, 0, k2, 10, 11, 8, 9 87 add_update m, 1, k2, 11, 8, 9, 10 88 add_update m, 0, k2, 8, 9, 10, 11 89 add_update m, 1, k2, 9, 10, 11, 8 90 add_update m, 0, k3, 10, 11, 8, 9
|
| /optee_os/lib/libutils/isoc/arch/arm/softfloat/source/include/ |
| H A D | primitiveTypes.h | 66 #define indexMultiword( total, m, n ) (n) argument 77 #define indexMultiword( total, m, n ) ((total) - 1 - (m)) argument
|