/optee_os/core/lib/libtomcrypt/src/prngs/ |
A D | yarrow.c | 53 prng->u.yarrow.cipher = register_cipher(&aes_desc); in yarrow_start() 60 prng->u.yarrow.cipher = register_cipher(&rc6_desc); in yarrow_start() 62 prng->u.yarrow.cipher = register_cipher(&rc5_desc); in yarrow_start() 66 prng->u.yarrow.cipher = register_cipher(&rc2_desc); in yarrow_start() 107 prng->u.yarrow.hash = register_hash(&md5_desc); in yarrow_start() 109 prng->u.yarrow.hash = register_hash(&md4_desc); in yarrow_start() 111 prng->u.yarrow.hash = register_hash(&md2_desc); in yarrow_start() 122 zeromem(prng->u.yarrow.pool, sizeof(prng->u.yarrow.pool)); in yarrow_start() 156 if ((err = hash_descriptor[prng->u.yarrow.hash]->process(&md, prng->u.yarrow.pool, in yarrow_add_entropy() 167 err = hash_descriptor[prng->u.yarrow.hash]->done(&md, prng->u.yarrow.pool); in yarrow_add_entropy() [all …]
|
A D | fortuna.c | 68 IV = prng->u.fortuna.IV; in _fortuna_update_iv() 156 if ((err = rijndael_setup(prng->u.fortuna.K, 32, 0, &prng->u.fortuna.skey)) != CRYPT_OK) { in _fortuna_reseed() 162 prng->u.fortuna.pool0_len = 0; in _fortuna_reseed() 166 prng->u.fortuna.wd = 0; in _fortuna_reseed() 241 prng->u.fortuna.pool_idx = prng->u.fortuna.pool0_len = prng->u.fortuna.wd = 0; in fortuna_start() 246 if ((err = rijndael_setup(prng->u.fortuna.K, 32, 0, &prng->u.fortuna.skey)) != CRYPT_OK) { in fortuna_start() 405 rijndael_ecb_encrypt(prng->u.fortuna.IV, out, &prng->u.fortuna.skey); in fortuna_read() 413 rijndael_ecb_encrypt(prng->u.fortuna.IV, tmp, &prng->u.fortuna.skey); in fortuna_read() 419 rijndael_ecb_encrypt(prng->u.fortuna.IV, prng->u.fortuna.K , &prng->u.fortuna.skey); in fortuna_read() 422 rijndael_ecb_encrypt(prng->u.fortuna.IV, prng->u.fortuna.K+16, &prng->u.fortuna.skey); in fortuna_read() [all …]
|
A D | sober128.c | 44 XMEMSET(&prng->u.sober128.ent, 0, sizeof(prng->u.sober128.ent)); in sober128_start() 45 prng->u.sober128.idx = 0; in sober128_start() 73 … if ((err = sober128_stream_setup(&prng->u.sober128.s, buf, 32)) != CRYPT_OK) goto LBL_UNLOCK; in sober128_add_entropy() 75 … if ((err = sober128_stream_setiv(&prng->u.sober128.s, buf + 32, 8)) != CRYPT_OK) goto LBL_UNLOCK; in sober128_add_entropy() 81 …while (inlen--) prng->u.sober128.ent[prng->u.sober128.idx++ % sizeof(prng->u.sober128.ent)] ^= *in… in sober128_add_entropy() 103 …if ((err = sober128_stream_setup(&prng->u.sober128.s, prng->u.sober128.ent, 32)) != CRYPT_OK) … in sober128_ready() 105 …if ((err = sober128_stream_setiv(&prng->u.sober128.s, prng->u.sober128.ent + 32, 8)) != CRYPT_OK) … in sober128_ready() 106 XMEMSET(&prng->u.sober128.ent, 0, sizeof(prng->u.sober128.ent)); in sober128_ready() 107 prng->u.sober128.idx = 0; in sober128_ready() 126 if (sober128_stream_keystream(&prng->u.sober128.s, out, outlen) != CRYPT_OK) outlen = 0; in sober128_read() [all …]
|
A D | chacha20.c | 42 XMEMSET(&prng->u.chacha.ent, 0, sizeof(prng->u.chacha.ent)); in chacha20_prng_start() 43 prng->u.chacha.idx = 0; in chacha20_prng_start() 71 if ((err = chacha_setup(&prng->u.chacha.s, buf, 32, 20)) != CRYPT_OK) goto LBL_UNLOCK; in chacha20_prng_add_entropy() 73 if ((err = chacha_ivctr64(&prng->u.chacha.s, buf + 32, 8, 0)) != CRYPT_OK) goto LBL_UNLOCK; in chacha20_prng_add_entropy() 79 … while (inlen--) prng->u.chacha.ent[prng->u.chacha.idx++ % sizeof(prng->u.chacha.ent)] ^= *in++; in chacha20_prng_add_entropy() 101 …if ((err = chacha_setup(&prng->u.chacha.s, prng->u.chacha.ent, 32, 20)) != CRYPT_OK) goto LBL… in chacha20_prng_ready() 103 …if ((err = chacha_ivctr64(&prng->u.chacha.s, prng->u.chacha.ent + 32, 8, 0)) != CRYPT_OK) goto LBL… in chacha20_prng_ready() 104 XMEMSET(&prng->u.chacha.ent, 0, sizeof(prng->u.chacha.ent)); in chacha20_prng_ready() 105 prng->u.chacha.idx = 0; in chacha20_prng_ready() 124 if (chacha_keystream(&prng->u.chacha.s, out, outlen) != CRYPT_OK) outlen = 0; in chacha20_prng_read() [all …]
|
A D | rc4.c | 43 prng->u.rc4.s.x = 0; in rc4_start() 45 XMEMSET(&prng->u.rc4.s.buf, 0, sizeof(prng->u.rc4.s.buf)); in rc4_start() 73 if ((err = rc4_stream_setup(&prng->u.rc4.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; in rc4_add_entropy() 75 for (i = 0; i < 12; i++) rc4_stream_keystream(&prng->u.rc4.s, buf, sizeof(buf)); in rc4_add_entropy() 80 while (inlen--) prng->u.rc4.s.buf[prng->u.rc4.s.x++ % sizeof(prng->u.rc4.s.buf)] ^= *in++; in rc4_add_entropy() 103 XMEMCPY(buf, prng->u.rc4.s.buf, sizeof(buf)); in rc4_ready() 105 len = MIN(prng->u.rc4.s.x, 256); /* TODO: we can perhaps always use all 256 bytes */ in rc4_ready() 106 if ((err = rc4_stream_setup(&prng->u.rc4.s, buf, len)) != CRYPT_OK) goto LBL_UNLOCK; in rc4_ready() 108 for (i = 0; i < 12; i++) rc4_stream_keystream(&prng->u.rc4.s, buf, sizeof(buf)); in rc4_ready() 127 if (rc4_stream_keystream(&prng->u.rc4.s, out, outlen) != CRYPT_OK) outlen = 0; in rc4_read() [all …]
|
/optee_os/core/arch/arm/kernel/ |
A D | thread_optee_smc.c | 347 param->u.rmem.offs = tpm->u.memref.offs; in set_rmem() 348 param->u.rmem.size = tpm->u.memref.size; in set_rmem() 350 param->u.rmem.shm_ref = mobj_get_cookie(tpm->u.memref.mobj); in set_rmem() 377 param->u.tmem.size = tpm->u.memref.size; in set_tmem() 427 arg->params[n].u.value.a = params[n].u.value.a; in get_rpc_arg() 428 arg->params[n].u.value.b = params[n].u.value.b; in get_rpc_arg() 429 arg->params[n].u.value.c = params[n].u.value.c; in get_rpc_arg() 465 params[n].u.value.a = arg->params[n].u.value.a; in get_rpc_arg_res() 466 params[n].u.value.b = arg->params[n].u.value.b; in get_rpc_arg_res() 467 params[n].u.value.c = arg->params[n].u.value.c; in get_rpc_arg_res() [all …]
|
A D | thread_spmc.c | 1092 param->u.fmem.offs_low = offs; in set_fmem() 1097 param->u.fmem.size = tpm->u.memref.size; in set_fmem() 1098 if (tpm->u.memref.mobj) { in set_fmem() 1104 param->u.fmem.global_id = cookie; in set_fmem() 1144 arg->params[n].u.value.a = params[n].u.value.a; in get_rpc_arg() 1145 arg->params[n].u.value.b = params[n].u.value.b; in get_rpc_arg() 1146 arg->params[n].u.value.c = params[n].u.value.c; in get_rpc_arg() 1172 params[n].u.value.a = arg->params[n].u.value.a; in get_rpc_arg_res() 1173 params[n].u.value.b = arg->params[n].u.value.b; in get_rpc_arg_res() 1174 params[n].u.value.c = arg->params[n].u.value.c; in get_rpc_arg_res() [all …]
|
/optee_os/core/tee/ |
A D | entry_std.c | 204 ta_param->u[n].val.a = READ_ONCE(params[n].u.value.a); in copy_in_params() 205 ta_param->u[n].val.b = READ_ONCE(params[n].u.value.b); in copy_in_params() 212 &ta_param->u[n].mem); in copy_in_params() 223 &ta_param->u[n].mem); in copy_in_params() 234 &ta_param->u[n].mem); in copy_in_params() 267 mobj_put(param->u[n].mem.mobj); in cleanup_shm_refs() 287 params[n].u.tmem.size = ta_param->u[n].mem.size; in copy_out_param() 291 params[n].u.rmem.size = ta_param->u[n].mem.size; in copy_out_param() 299 params[n].u.value.a = ta_param->u[n].val.a; in copy_out_param() 300 params[n].u.value.b = ta_param->u[n].val.b; in copy_out_param() [all …]
|
A D | tee_svc.c | 536 p->u[n].mem.offs = a; in utee_param_to_param() 537 p->u[n].mem.size = b; in utee_param_to_param() 539 if (!p->u[n].mem.offs) { in utee_param_to_param() 541 if (p->u[n].mem.size) in utee_param_to_param() 543 p->u[n].mem.mobj = NULL; in utee_param_to_param() 554 p->u[n].val.a = a; in utee_param_to_param() 555 p->u[n].val.b = b; in utee_param_to_param() 558 memset(&p->u[n], 0, sizeof(p->u[n])); in utee_param_to_param() 653 s = param->u[n].mem.size; in tee_svc_copy_param() 669 ¶m->u[n].mem.mobj, in tee_svc_copy_param() [all …]
|
A D | tee_cryp_pbkdf2.c | 31 uint8_t u[TEE_MAX_HASH_SIZE]; in pbkdf2_f() local 56 res = crypto_mac_update(h->ctx, u, h->hash_len); in pbkdf2_f() 61 res = crypto_mac_final(h->ctx, u, sizeof(u)); in pbkdf2_f() 66 out[j] ^= u[j]; in pbkdf2_f()
|
A D | socket.c | 55 params[3].value.a = tpm[3].u.value.a; in socket_open() 114 params[2].value.a = tpm[2].u.value.b; /* transmitted bytes */ in socket_send() 154 MIN(params[1].memref.size, tpm[1].u.memref.size)); in socket_recv() 155 params[1].memref.size = tpm[1].u.memref.size; in socket_recv() 193 if (tpm[1].u.memref.size <= params[1].memref.size) in socket_ioctl() 194 memcpy(params[1].memref.buffer, va, tpm[1].u.memref.size); in socket_ioctl() 196 params[1].memref.size = tpm[1].u.memref.size; in socket_ioctl() 235 .attr = THREAD_PARAM_ATTR_VALUE_IN, .u.value = { in pta_socket_close_session()
|
/optee_os/lib/libmbedtls/mbedtls/library/ |
A D | camellia.c | 932 int i, j, u, v; in mbedtls_camellia_self_test() local 953 u = j >> 1; in mbedtls_camellia_self_test() 961 memcpy( key, camellia_test_ecb_key[u][i], 16 + 8 * u ); in mbedtls_camellia_self_test() 996 u = j >> 1; in mbedtls_camellia_self_test() 1005 memcpy( key, camellia_test_cbc_key[u], 16 + 8 * u ); in mbedtls_camellia_self_test() 1049 u = i >> 1; in mbedtls_camellia_self_test() 1057 memcpy( key, camellia_test_ctr_key[u], 16 ); in mbedtls_camellia_self_test() 1064 len = camellia_test_ctr_len[u]; in mbedtls_camellia_self_test() 1065 memcpy( buf, camellia_test_ctr_ct[u], len ); in mbedtls_camellia_self_test() 1079 len = camellia_test_ctr_len[u]; in mbedtls_camellia_self_test() [all …]
|
A D | des.c | 869 int i, j, u, v, ret = 0; in mbedtls_des_self_test() local 885 u = i >> 1; in mbedtls_des_self_test() 890 ( u == 0 ) ? ' ' : '3', 56 + u * 56, in mbedtls_des_self_test() 927 if( u == 0 ) in mbedtls_des_self_test() 934 memcmp( buf, des3_test_ecb_dec[u], 8 ) != 0 ) || in mbedtls_des_self_test() 936 memcmp( buf, des3_test_ecb_enc[u], 8 ) != 0 ) ) in mbedtls_des_self_test() 958 u = i >> 1; in mbedtls_des_self_test() 963 ( u == 0 ) ? ' ' : '3', 56 + u * 56, in mbedtls_des_self_test() 1004 if( u == 0 ) in mbedtls_des_self_test() 1016 if( u == 0 ) in mbedtls_des_self_test() [all …]
|
A D | aes.c | 1792 int ret = 0, i, j, u, mode; in mbedtls_aes_self_test() local 1824 u = i >> 1; in mbedtls_aes_self_test() 1825 keybits = 128 + u * 64; in mbedtls_aes_self_test() 1886 u = i >> 1; in mbedtls_aes_self_test() 1887 keybits = 128 + u * 64; in mbedtls_aes_self_test() 1961 u = i >> 1; in mbedtls_aes_self_test() 1962 keybits = 128 + u * 64; in mbedtls_aes_self_test() 2024 u = i >> 1; in mbedtls_aes_self_test() 2025 keybits = 128 + u * 64; in mbedtls_aes_self_test() 2087 u = i >> 1; in mbedtls_aes_self_test() [all …]
|
/optee_os/lib/libutee/ |
A D | tee_uuid_from_str.c | 45 TEE_UUID u = { }; in tee_uuid_from_str() local 54 u.timeLow = parse_hex(p, 8, &res); in tee_uuid_from_str() 58 u.timeMid = parse_hex(p, 4, &res); in tee_uuid_from_str() 62 u.timeHiAndVersion = parse_hex(p, 4, &res); in tee_uuid_from_str() 67 u.clockSeqAndNode[i] = parse_hex(p, 2, &res); in tee_uuid_from_str() 75 *uuid = u; in tee_uuid_from_str()
|
A D | tee_api_arith_mpi.c | 614 mbedtls_mpi u; in mpi_egcd() local 622 get_mpi(&u, NULL); in mpi_egcd() 642 MPI_CHECK(mbedtls_mpi_copy(&u, &x)); in mpi_egcd() 649 while (mbedtls_mpi_cmp_int(&u, 0)) { in mpi_egcd() 650 while (mpi_is_even(&u)) { in mpi_egcd() 651 MPI_CHECK(mbedtls_mpi_shift_r(&u, 1)); in mpi_egcd() 671 if (mbedtls_mpi_cmp_mpi(&u, gcd) >= 0) { in mpi_egcd() 672 MPI_CHECK(mbedtls_mpi_sub_mpi(&u, &u, gcd)); in mpi_egcd() 693 mbedtls_mpi_free(&u); in mpi_egcd() 713 if (!u && !v) { in TEE_BigIntComputeExtendedGcd() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/x25519/ |
A D | x25519_set_key.c | 33 const unsigned char *u, unsigned long ulen, in x25519_set_key() argument 42 if (u != NULL) { in x25519_set_key() 44 if (XMEM_NEQ(u, key->pub, sizeof(key->pub)) != 0) { in x25519_set_key() 50 } else if (u != NULL) { in x25519_set_key() 52 XMEMCPY(key->pub, u, sizeof(key->pub)); in x25519_set_key()
|
/optee_os/core/lib/libtomcrypt/src/ciphers/ |
A D | rc6.c | 127 ulong32 a,b,c,d,t,u; in _rc6_ecb_encrypt() local 141 u = (d * (d + d + 1)); u = ROLc(u, 5); \ in _rc6_ecb_encrypt() 142 a = ROL(a^t,u) + K[0]; \ in _rc6_ecb_encrypt() 143 c = ROL(c^u,t) + K[1]; K += 2; in _rc6_ecb_encrypt() 182 ulong32 a,b,c,d,t,u; in _rc6_ecb_decrypt() local 196 u = (d * (d + d + 1)); u = ROLc(u, 5); \ in _rc6_ecb_decrypt() 197 c = ROR(c - K[1], t) ^ u; \ in _rc6_ecb_decrypt() 198 a = ROR(a - K[0], u) ^ t; K -= 2; in _rc6_ecb_decrypt()
|
/optee_os/core/lib/libtomcrypt/src/misc/pkcs12/ |
A D | pkcs12_kdf.c | 21 unsigned long u = hash_descriptor[hash_id]->hashsize; in pkcs12_kdf() local 23 unsigned long c = (outlen + u - 1) / u; in pkcs12_kdf() 38 key = XMALLOC(u * c); in pkcs12_kdf() 41 zeromem(key, u * c); in pkcs12_kdf() 83 zeromem(key, u * c); in pkcs12_kdf()
|
/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ |
A D | ui64_to_f32.c | 46 union ui32_f32 u; in ui64_to_f32() local 51 u.ui = in ui64_to_f32() 55 return u.f; in ui64_to_f32()
|
A D | i64_to_f32.c | 49 union ui32_f32 u; in i64_to_f32() local 56 u.ui = in i64_to_f32() 60 return u.f; in i64_to_f32()
|
A D | extF80M_to_i64_r_minMag.c | 65 union { uint64_t ui; int64_t i; } u; in extF80M_to_i64_r_minMag() local 96 u.ui = -absZ; in extF80M_to_i64_r_minMag() 97 z = u.i; in extF80M_to_i64_r_minMag()
|
A D | extF80M_to_i32_r_minMag.c | 66 union { uint32_t ui; int32_t i; } u; in extF80M_to_i32_r_minMag() local 99 u.ui = -absZ; in extF80M_to_i32_r_minMag() 100 z = u.i; in extF80M_to_i32_r_minMag()
|
/optee_os/core/kernel/ |
A D | pseudo_ta.c | 69 tee_param[n].value.a = param->u[n].val.a; in copy_in_param() 70 tee_param[n].value.b = param->u[n].val.b; in copy_in_param() 75 mem = ¶m->u[n].mem; in copy_in_param() 113 param->u[n].val.a = tee_param[n].value.a; in update_out_param() 114 param->u[n].val.b = tee_param[n].value.b; in update_out_param() 118 param->u[n].mem.size = tee_param[n].memref.size; in update_out_param() 135 res = mobj_dec_map(param->u[n].mem.mobj); in unmap_mapped_param()
|
/optee_os/lib/libutils/ext/ |
A D | consttime_memcmp.c | 39 unsigned int isLT = 0u; in consttime_memcmp() 40 unsigned int isGT = 0u; in consttime_memcmp()
|