| /optee_os/lib/libmbedtls/mbedtls/library/ |
| H A D | sha3.c | 104 uint64_t *s = ctx->state; in keccak_f1600() local 113 lane[i] = s[i] ^ s[i + 5] ^ s[i + 10] ^ s[i + 15] ^ s[i + 20]; in keccak_f1600() 117 s[i] ^= t; s[i + 5] ^= t; s[i + 10] ^= t; s[i + 15] ^= t; s[i + 20] ^= t; in keccak_f1600() 120 lane[0] = s[0] ^ s[5] ^ s[10] ^ s[15] ^ s[20]; in keccak_f1600() 121 lane[1] = s[1] ^ s[6] ^ s[11] ^ s[16] ^ s[21]; in keccak_f1600() 122 lane[2] = s[2] ^ s[7] ^ s[12] ^ s[17] ^ s[22]; in keccak_f1600() 123 lane[3] = s[3] ^ s[8] ^ s[13] ^ s[18] ^ s[23]; in keccak_f1600() 124 lane[4] = s[4] ^ s[9] ^ s[14] ^ s[19] ^ s[24]; in keccak_f1600() 127 s[0] ^= t; s[5] ^= t; s[10] ^= t; s[15] ^= t; s[20] ^= t; in keccak_f1600() 130 s[1] ^= t; s[6] ^= t; s[11] ^= t; s[16] ^= t; s[21] ^= t; in keccak_f1600() [all …]
|
| H A D | bn_mul.h | 126 : "=m" (t), "=m" (c), "=m" (d), "=m" (s) \ 127 : "m" (t), "m" (s), "m" (d), "m" (c), "m" (b) \ 204 : "=m" (t), "=m" (c), "=m" (d), "=m" (s) \ 205 : "m" (t), "m" (s), "m" (d), "m" (c), "m" (b) \ 232 : "+c" (c), "+D" (d), "+S" (s), "+m" (*(uint64_t (*)[16]) d) \ 233 : "b" (b), "m" (*(const uint64_t (*)[16]) s) \ 251 do { uintptr_t muladdc_d = (uintptr_t) d, muladdc_s = (uintptr_t) s; asm( 269 : "r" (b), "m" (*(const uint64_t (*)[16]) s) \ 271 ); d = (mbedtls_mpi_uint *)muladdc_d; s = (mbedtls_mpi_uint *)muladdc_s; } while (0); 298 : "=m" (c), "=m" (d), "=m" (s) \ [all …]
|
| /optee_os/core/arch/arm/crypto/ |
| H A D | sm4_armv8a_ce_a64.S | 102 sm4e \in\().4s, RK0.4s 103 sm4e \in\().4s, RK1.4s 104 sm4e \in\().4s, RK2.4s 105 sm4e \in\().4s, RK3.4s 106 sm4e \in\().4s, RK4.4s 107 sm4e \in\().4s, RK5.4s 108 sm4e \in\().4s, RK6.4s 109 sm4e \in\().4s, RK7.4s 110 rev64 \in\().4s, \in\().4s 116 sm4e \in\().4s, RK0.4s [all …]
|
| H A D | sha256_armv8a_ce_a64.S | 31 add t1.4s, v\s0\().4s, \rc\().4s 32 sha256h dg0q, dg1q, t0.4s 33 sha256h2 dg1q, dg2q, t0.4s 36 add t0.4s, v\s0\().4s, \rc\().4s 38 sha256h dg0q, dg1q, t1.4s 39 sha256h2 dg1q, dg2q, t1.4s 44 sha256su0 v\s0\().4s, v\s1\().4s 46 sha256su1 v\s0\().4s, v\s2\().4s, v\s3\().4s 57 ld1 { v0.4s- v3.4s}, [x8], #64 58 ld1 { v4.4s- v7.4s}, [x8], #64 [all …]
|
| H A D | sha1_armv8a_ce_a64.S | 35 add t1.4s, v\s0\().4s, \rc\().4s 38 sha1\op dg0q, \dg1, t0.4s 40 sha1\op dg0q, dg1s, t0.4s 44 add t0.4s, v\s0\().4s, \rc\().4s 47 sha1\op dg0q, dg2s, t1.4s 52 sha1su0 v\s0\().4s, v\s1\().4s, v\s2\().4s 54 sha1su1 v\s0\().4s, v\s3\().4s 63 ld1r {k0.4s}, [x6], #4 64 ld1r {k1.4s}, [x6], #4 65 ld1r {k2.4s}, [x6], #4 [all …]
|
| H A D | sm3_armv8a_ce_a64.S | 13 .set .Lv\b\().4s, \b 45 sm3ss1 v5.4s, v8.4s, \t0\().4s, v9.4s 46 shl \t1\().4s, \t0\().4s, #1 47 sri \t1\().4s, \t0\().4s, #31 48 sm3tt1\ab v8.4s, v5.4s, v10.4s, \i 49 sm3tt2\ab v9.4s, v5.4s, \s0\().4s, \i 57 sm3partw1 \s4\().4s, \s0\().4s, \s3\().4s 68 sm3partw2 \s4\().4s, v7.4s, v6.4s 78 ld1 {v8.4s-v9.4s}, [x0] 79 rev64 v8.4s, v8.4s [all …]
|
| H A D | sm4_armv8a_aese_a64.S | 164 mov TMP0.s[0], tmpw2 168 mov tmpw2, TMP1.s[0] 179 round m0, m1, m2, m3, \k\().s[0] 180 round m1, m2, m3, m0, \k\().s[1] 181 round m2, m3, m0, m1, \k\().s[2] 182 round m3, m0, m1, m2, \k\().s[3] 186 round m0, m1, m2, m3, \k\().s[3] 187 round m1, m2, m3, m0, \k\().s[2] 188 round m2, m3, m0, m1, \k\().s[1] 189 round m3, m0, m1, m2, \k\().s[0] [all …]
|
| /optee_os/core/tee/ |
| H A D | uuid.c | 10 void tee_uuid_to_octets(uint8_t *d, const TEE_UUID *s) in tee_uuid_to_octets() argument 12 d[0] = s->timeLow >> 24; in tee_uuid_to_octets() 13 d[1] = s->timeLow >> 16; in tee_uuid_to_octets() 14 d[2] = s->timeLow >> 8; in tee_uuid_to_octets() 15 d[3] = s->timeLow; in tee_uuid_to_octets() 16 d[4] = s->timeMid >> 8; in tee_uuid_to_octets() 17 d[5] = s->timeMid; in tee_uuid_to_octets() 18 d[6] = s->timeHiAndVersion >> 8; in tee_uuid_to_octets() 19 d[7] = s->timeHiAndVersion; in tee_uuid_to_octets() 20 memcpy(d + 8, s->clockSeqAndNode, sizeof(s->clockSeqAndNode)); in tee_uuid_to_octets() [all …]
|
| /optee_os/lib/libutils/isoc/newlib/ |
| H A D | strchr.c | 99 _CONST unsigned char *s = (_CONST unsigned char *)s1; variable 110 while (UNALIGNED (s)) 112 if (!*s) 113 return (char *) s; 114 s++; 117 aligned_addr = (unsigned long *) s; 121 s = (const unsigned char *) aligned_addr; 122 while (*s) 123 s++; 124 return (char *) s; [all …]
|
| H A D | strtok_r.c | 33 __strtok_r (register char *s, in __strtok_r() argument 43 if (s == NULL && (s = *lasts) == NULL) in __strtok_r() 50 c = *s++; in __strtok_r() 57 *lasts = s; in __strtok_r() 58 s[-1] = 0; in __strtok_r() 59 return (s - 1); in __strtok_r() 68 tok = s - 1; in __strtok_r() 75 c = *s++; in __strtok_r() 80 s = NULL; in __strtok_r() 82 s[-1] = 0; in __strtok_r() [all …]
|
| H A D | strtoul.c | 163 register const unsigned char *s = (const unsigned char *)nptr; variable 173 c = *s++; 177 c = *s++; 179 c = *s++; 181 c == '0' && (*s == 'x' || *s == 'X')) { 182 c = s[1]; 183 s += 2; 190 for (acc = 0, any = 0;; c = *s++) { 212 *endptr = (char *) (any ? (char *)s - 1 : nptr); 219 _DEFUN (strtoul, (s, ptr, base), [all …]
|
| H A D | strrchr.c | 71 _DEFUN (strrchr, (s, i), 72 _CONST char *s _AND 79 while ((s=strchr(s, i))) 81 last = s; 82 s++; 87 last = strchr(s, i);
|
| /optee_os/lib/libutils/compiler-rt/lib/builtins/ |
| H A D | udivmodti4.c | 32 si_int s; // Shift amount for normalization in udiv128by64to64default() local 34 s = __builtin_clzll(v); in udiv128by64to64default() 35 if (s > 0) { in udiv128by64to64default() 37 v = v << s; in udiv128by64to64default() 38 un64 = (u1 << s) | (u0 >> (n_udword_bits - s)); in udiv128by64to64default() 39 un10 = u0 << s; // Shift dividend left in udiv128by64to64default() 80 *r = (un21 * b + un0 - q0 * v) >> s; in udiv128by64to64default() 114 if (divisor.s.high == 0) { in __udivmodti4() 115 remainder.s.high = 0; in __udivmodti4() 116 if (dividend.s.high < divisor.s.low) { in __udivmodti4() [all …]
|
| H A D | ashlti3.c | 27 result.s.low = 0; in __ashlti3() 28 result.s.high = input.s.low << (b - bits_in_dword); in __ashlti3() 32 result.s.low = input.s.low << b; in __ashlti3() 33 result.s.high = in __ashlti3() 34 ((du_int)input.s.high << b) | (input.s.low >> (bits_in_dword - b)); in __ashlti3()
|
| H A D | int_div_impl.inc | 15 // Adapted from Figure 3-40 of The PowerPC Compiler Writer's Guide 36 const fixint_t s = (fixint_t)(d - r - 1) >> (N - 1); 37 carry = s & 1; 38 r -= d & s; 65 const fixint_t s = (fixint_t)(d - r - 1) >> (N - 1); 66 carry = s & 1; 67 r -= d & s; 87 fixint_t s = b >> N; // s = b < 0 ? -1 : 0 88 fixuint_t b_u = (fixuint_t)(b ^ s) + (-s); // negate if s == -1 89 s = a >> N; // s = a < 0 ? -1 : 0 [all …]
|
| /optee_os/core/kernel/ |
| H A D | ts_manager.c | 19 struct ts_session *s = TAILQ_FIRST(&tsd->sess_stack); in update_current_ctx() local 21 if (s) { in update_current_ctx() 22 if (is_pseudo_ta_ctx(s->ctx)) in update_current_ctx() 23 s = TAILQ_NEXT(s, link_tsd); in update_current_ctx() 25 if (s) in update_current_ctx() 26 ctx = s->ctx; in update_current_ctx() 38 static void *swap_fbuf(struct ts_session *s __maybe_unused, in swap_fbuf() 44 ret = s->fbuf; in swap_fbuf() 45 s->fbuf = fbuf; in swap_fbuf() 51 void ts_push_current_session(struct ts_session *s) in ts_push_current_session() argument [all …]
|
| H A D | tee_ta_manager.c | 159 /* Either it's already true or we should set it to true */ in tee_ta_try_set_busy() 189 static void dec_session_ref_count(struct tee_ta_session *s) in dec_session_ref_count() argument 191 assert(s->ref_count > 0); in dec_session_ref_count() 192 s->ref_count--; in dec_session_ref_count() 193 if (s->ref_count == 1) in dec_session_ref_count() 194 condvar_signal(&s->refc_cv); in dec_session_ref_count() 197 void tee_ta_put_session(struct tee_ta_session *s) in tee_ta_put_session() argument 201 if (s->lock_thread == thread_get_id()) { in tee_ta_put_session() 202 s->lock_thread = THREAD_ID_INVALID; in tee_ta_put_session() 203 condvar_signal(&s in tee_ta_put_session() 213 struct tee_ta_session *s = NULL; tee_ta_find_session_nolock() local 229 struct tee_ta_session *s = NULL; tee_ta_find_session() local 243 struct tee_ta_session *s; tee_ta_get_session() local 278 tee_ta_unlink_session(struct tee_ta_session * s,struct tee_ta_session_head * open_sessions) tee_ta_unlink_session() argument 312 destroy_session(struct tee_ta_session * s,struct tee_ta_session_head * open_sessions) destroy_session() argument 349 check_client(struct tee_ta_session * s,const TEE_Identity * id) check_client() argument 532 tee_ta_init_session_with_context(struct tee_ta_session * s,const TEE_UUID * uuid) tee_ta_init_session_with_context() argument 609 struct tee_ta_session *s = calloc(1, sizeof(struct tee_ta_session)); tee_ta_init_session() local 714 struct tee_ta_session *s = NULL; tee_ta_open_session() local 836 dump_ta_memstats(struct tee_ta_session * s,struct tee_ta_param * param) dump_ta_memstats() argument 1035 tee_ta_session_is_cancelled(struct tee_ta_session * s,TEE_Time * curr_time) tee_ta_session_is_cancelled() argument 1065 struct ts_session *s = ts_get_current_session(); tee_ta_gprof_sample_pc() local 1091 gprof_update_session_utime(bool suspend,struct ts_session * s,uint64_t now) gprof_update_session_utime() argument 1118 struct ts_session *s = ts_get_current_session(); tee_ta_update_session_utime() local 1138 struct ts_session *s = ts_get_current_session_may_fail(); ftrace_update_times() local [all...] |
| /optee_os/core/lib/libtomcrypt/ |
| H A D | dsa.c | 16 TEE_Result crypto_acipher_alloc_dsa_keypair(struct dsa_keypair *s, in crypto_acipher_alloc_dsa_keypair() argument 19 memset(s, 0, sizeof(*s)); in crypto_acipher_alloc_dsa_keypair() 20 if (!bn_alloc_max(&s->g)) in crypto_acipher_alloc_dsa_keypair() 23 if (!bn_alloc_max(&s->p)) in crypto_acipher_alloc_dsa_keypair() 25 if (!bn_alloc_max(&s->q)) in crypto_acipher_alloc_dsa_keypair() 27 if (!bn_alloc_max(&s->y)) in crypto_acipher_alloc_dsa_keypair() 29 if (!bn_alloc_max(&s->x)) in crypto_acipher_alloc_dsa_keypair() 33 crypto_bignum_free(&s->g); in crypto_acipher_alloc_dsa_keypair() 34 crypto_bignum_free(&s->p); in crypto_acipher_alloc_dsa_keypair() 35 crypto_bignum_free(&s->q); in crypto_acipher_alloc_dsa_keypair() [all …]
|
| H A D | dh.c | 15 TEE_Result crypto_acipher_alloc_dh_keypair(struct dh_keypair *s, in crypto_acipher_alloc_dh_keypair() argument 18 memset(s, 0, sizeof(*s)); in crypto_acipher_alloc_dh_keypair() 19 if (!bn_alloc_max(&s->g)) in crypto_acipher_alloc_dh_keypair() 21 if (!bn_alloc_max(&s->p)) in crypto_acipher_alloc_dh_keypair() 23 if (!bn_alloc_max(&s->y)) in crypto_acipher_alloc_dh_keypair() 25 if (!bn_alloc_max(&s->x)) in crypto_acipher_alloc_dh_keypair() 27 if (!bn_alloc_max(&s->q)) in crypto_acipher_alloc_dh_keypair() 31 crypto_bignum_free(&s->g); in crypto_acipher_alloc_dh_keypair() 32 crypto_bignum_free(&s->p); in crypto_acipher_alloc_dh_keypair() 33 crypto_bignum_free(&s->y); in crypto_acipher_alloc_dh_keypair() [all …]
|
| H A D | ecc.c | 16 static void _ltc_ecc_free_public_key(struct ecc_public_key *s) in _ltc_ecc_free_public_key() argument 18 if (!s) in _ltc_ecc_free_public_key() 21 crypto_bignum_free(&s->x); in _ltc_ecc_free_public_key() 22 crypto_bignum_free(&s->y); in _ltc_ecc_free_public_key() 415 TEE_Result crypto_asym_alloc_ecc_keypair(struct ecc_keypair *s, in crypto_asym_alloc_ecc_keypair() argument 419 memset(s, 0, sizeof(*s)); in crypto_asym_alloc_ecc_keypair() 424 s->ops = &ecc_keypair_ops; in crypto_asym_alloc_ecc_keypair() 430 s->curve = TEE_ECC_CURVE_SM2; in crypto_asym_alloc_ecc_keypair() 431 s->ops = &sm2_dsa_keypair_ops; in crypto_asym_alloc_ecc_keypair() 437 s->curve = TEE_ECC_CURVE_SM2; in crypto_asym_alloc_ecc_keypair() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/stream/rc4/ |
| H A D | rc4_stream.c | 17 unsigned char tmp, *s; in rc4_stream_setup() local 25 s = st->buf; in rc4_stream_setup() 27 s[x] = x; in rc4_stream_setup() 31 y = (y + s[x] + key[j++]) & 255; in rc4_stream_setup() 35 tmp = s[x]; s[x] = s[y]; s[y] = tmp; in rc4_stream_setup() 53 unsigned char x, y, *s, tmp; in rc4_stream_crypt() local 61 s = st->buf; in rc4_stream_crypt() 64 y = (y + s[x]) & 255; in rc4_stream_crypt() 65 tmp = s[x]; s[x] = s[y]; s[y] = tmp; in rc4_stream_crypt() 66 tmp = (s[x] + s[y]) & 255; in rc4_stream_crypt() [all …]
|
| /optee_os/lib/libmbedtls/core/ |
| H A D | ecc.c | 38 static void ecc_free_public_key(struct ecc_public_key *s) in ecc_free_public_key() argument 40 if (!s) in ecc_free_public_key() 43 crypto_bignum_free(&s->x); in ecc_free_public_key() 44 crypto_bignum_free(&s->y); in ecc_free_public_key() 176 mbedtls_mpi s; in ecc_sign() local 181 memset(&s, 0, sizeof(s)); in ecc_sign() 187 mbedtls_mpi_init(&s); in ecc_sign() 217 lmd_res = mbedtls_ecdsa_sign(&ecdsa.grp, &r, &s, &ecdsa.d, msg, in ecc_sign() 226 mbedtls_mpi_write_binary(&s, sig + *sig_len - in ecc_sign() 227 mbedtls_mpi_size(&s), in ecc_sign() [all …]
|
| H A D | dh.c | 17 TEE_Result crypto_acipher_alloc_dh_keypair(struct dh_keypair *s, in crypto_acipher_alloc_dh_keypair() argument 20 memset(s, 0, sizeof(*s)); in crypto_acipher_alloc_dh_keypair() 21 s->g = crypto_bignum_allocate(key_size_bits); in crypto_acipher_alloc_dh_keypair() 22 if (!s->g) in crypto_acipher_alloc_dh_keypair() 24 s->p = crypto_bignum_allocate(key_size_bits); in crypto_acipher_alloc_dh_keypair() 25 if (!s->p) in crypto_acipher_alloc_dh_keypair() 27 s->y = crypto_bignum_allocate(key_size_bits); in crypto_acipher_alloc_dh_keypair() 28 if (!s->y) in crypto_acipher_alloc_dh_keypair() 30 s->x = crypto_bignum_allocate(key_size_bits); in crypto_acipher_alloc_dh_keypair() 31 if (!s->x) in crypto_acipher_alloc_dh_keypair() [all …]
|
| /optee_os/lib/libutils/ext/arch/arm/ |
| H A D | memtag.c | 95 size_t s = 0; in set_tags_dc_helper() local 98 s = MIN(dcsz - (va & mask), size); in set_tags_dc_helper() 99 set_tags_helper((void *)va, s); in set_tags_dc_helper() 100 va += s; in set_tags_dc_helper() 101 size -= s; in set_tags_dc_helper() 103 s = size & ~mask; in set_tags_dc_helper() 104 if (s) { in set_tags_dc_helper() 105 set_tags_dc_gva(va, s, dcsz); in set_tags_dc_helper() 106 va += s; in set_tags_dc_helper() 107 size -= s; in set_tags_dc_helper() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/ecc/ |
| H A D | ecc_sign_hash.c | 32 void *r, *s, *e, *p, *b; in ecc_sign_hash_ex() local 49 if ((err = mp_init_multi(&r, &s, &e, &b, LTC_NULL)) != CRYPT_OK) { in ecc_sign_hash_ex() 84 if (mp_copy(pubkey.pubkey.x, s) != CRYPT_OK) { goto error; } in ecc_sign_hash_ex() 85 while (mp_cmp_d(s, 0) == LTC_MP_GT && mp_cmp(s, p) != LTC_MP_LT) { in ecc_sign_hash_ex() 88 if ((err = mp_sub(s, p, s)) != CRYPT_OK) { goto error; } in ecc_sign_hash_ex() 100 … if ((err = mp_mulmod(key->k, r, p, s)) != CRYPT_OK) { goto error; } /* s = xr */ in ecc_sign_hash_ex() 101 … if ((err = mp_mulmod(pubkey.k, s, p, s)) != CRYPT_OK) { goto error; } /* s = xr/kb */ in ecc_sign_hash_ex() 103 …if ((err = mp_add(e, s, s)) != CRYPT_OK) { goto error; } /* s = e/kb + xr… in ecc_sign_hash_ex() 104 …if ((err = mp_mulmod(s, b, p, s)) != CRYPT_OK) { goto error; } /* s = b(e/kb + … in ecc_sign_hash_ex() 106 if (mp_iszero(s) == LTC_MP_NO) { in ecc_sign_hash_ex() [all …]
|