Home
last modified time | relevance | path

Searched full:tmp (Results 1 – 25 of 151) sorted by relevance

1234567

/optee_os/core/lib/libtomcrypt/src/pk/rsa/
H A Drsa_exptmod.c27 void *tmp, *tmpa, *tmpb; in rsa_exptmod() local
49 /* init and copy into tmp */ in rsa_exptmod()
50 if ((err = mp_init_multi(&tmp, &tmpa, &tmpb, in rsa_exptmod()
56 if ((err = mp_read_unsigned_bin(tmp, (unsigned char *)in, (int)inlen)) != CRYPT_OK) in rsa_exptmod()
61 if (mp_cmp(key->N, tmp) == LTC_MP_LT) { in rsa_exptmod()
87 /* tmp = tmp*rnd mod N */ in rsa_exptmod()
88 err = mp_mulmod( tmp, rnd, key->N, tmp); in rsa_exptmod()
105 …if ((err = mp_exptmod(tmp, key->d, key->N, tmp)) != CRYPT_OK) { goto … in rsa_exptmod()
107 /* tmpa = tmp^dP mod p */ in rsa_exptmod()
108 …if ((err = mp_exptmod(tmp, key->dP, key->p, tmpa)) != CRYPT_OK) { goto … in rsa_exptmod()
[all …]
H A Drsa_key.c20 void *tmp[10] = { 0 }; in s_mpi_shrink_multi() local
29 if (n >= sizeof(tmp)/sizeof(tmp[0])) { in s_mpi_shrink_multi()
34 if ((err = mp_init_copy(&tmp[n], *arg[n])) != CRYPT_OK) { 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()
55 for (n = 0; n < sizeof(tmp)/sizeof(tmp[0]); ++n) { in s_mpi_shrink_multi()
56 if (tmp[n] != NULL) { in s_mpi_shrink_multi()
57 mp_clear(tmp[n]); in s_mpi_shrink_multi()
H A Drsa_export.c56 unsigned char* tmp = NULL; in rsa_export() local
60 tmp = XMALLOC(tmplen); in rsa_export()
62 if (tmp == NULL) { in rsa_export()
67 tmp = out; in rsa_export()
71 err = der_encode_sequence_multi(tmp, ptmplen, in rsa_export()
81 LTC_OID_RSA, tmp, tmplen, LTC_ASN1_NULL, NULL, 0); in rsa_export()
84 if (tmp != out) XFREE(tmp); in rsa_export()
H A Drsa_decrypt_key.c36 unsigned char *tmp; in rsa_decrypt_key_ex() local
70 tmp = XMALLOC(inlen); in rsa_decrypt_key_ex()
71 if (tmp == NULL) { in rsa_decrypt_key_ex()
77 if ((err = ltc_mp.rsa_me(in, inlen, tmp, &x, PK_PRIVATE, key)) != CRYPT_OK) { in rsa_decrypt_key_ex()
78 XFREE(tmp); in rsa_decrypt_key_ex()
84 err = pkcs_1_oaep_decode(tmp, x, lparam, lparamlen, modulus_bitlen, mgf_hash, in rsa_decrypt_key_ex()
88 err = pkcs_1_v1_5_decode(tmp, x, LTC_PKCS_1_EME, modulus_bitlen, out, outlen, stat); in rsa_decrypt_key_ex()
91 XFREE(tmp); in rsa_decrypt_key_ex()
/optee_os/core/include/
H A Dio.h138 const struct __unaligned_u64_t *tmp = p; in get_unaligned_be64() local
140 return TEE_U64_FROM_BIG_ENDIAN(tmp->x); in get_unaligned_be64()
145 struct __unaligned_u64_t *tmp = p; in put_unaligned_be64() local
147 tmp->x = TEE_U64_TO_BIG_ENDIAN(val); in put_unaligned_be64()
152 const struct __unaligned_u32_t *tmp = p; in get_unaligned_be32() local
154 return TEE_U32_FROM_BIG_ENDIAN(tmp->x); in get_unaligned_be32()
159 struct __unaligned_u32_t *tmp = p; in put_unaligned_be32() local
161 tmp->x = TEE_U32_TO_BIG_ENDIAN(val); in put_unaligned_be32()
166 const struct __unaligned_u16_t *tmp = p; in get_unaligned_be16() local
168 return TEE_U16_FROM_BIG_ENDIAN(tmp->x); in get_unaligned_be16()
[all …]
/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/
H A Docb3_done.c21 unsigned char tmp[MAXBLOCKSIZE]; in ocb3_done() local
44 ocb3_int_xor_blocks(tmp, ocb->adata_buffer, ocb->aOffset_current, ocb->adata_buffer_bytes); in ocb3_done()
47 tmp[x] = 0x80 ^ ocb->aOffset_current[x]; in ocb3_done()
50 tmp[x] = 0x00 ^ ocb->aOffset_current[x]; in ocb3_done()
55 if ((err = cipher_descriptor[ocb->cipher]->ecb_encrypt(tmp, tmp, &ocb->key)) != CRYPT_OK) { in ocb3_done()
58 ocb3_int_xor_blocks(ocb->aSum_current, ocb->aSum_current, tmp, ocb->block_len); in ocb3_done()
65 ocb3_int_xor_blocks(tmp, ocb->tag_part, ocb->aSum_current, ocb->block_len); in ocb3_done()
68 for(x = 0; x < ocb->tag_len; x++) tag[x] = tmp[x]; in ocb3_done()
75 zeromem(tmp, MAXBLOCKSIZE); in ocb3_done()
H A Docb3_decrypt.c22 unsigned char tmp[MAXBLOCKSIZE]; in ocb3_decrypt() local
50 /* tmp[] = ct[] XOR ocb->Offset_current[] */ in ocb3_decrypt()
51 ocb3_int_xor_blocks(tmp, ct_b, ocb->Offset_current, ocb->block_len); in ocb3_decrypt()
54 if ((err = cipher_descriptor[ocb->cipher]->ecb_decrypt(tmp, tmp, &ocb->key)) != CRYPT_OK) { in ocb3_decrypt()
58 /* pt[] = tmp[] XOR ocb->Offset_current[] */ in ocb3_decrypt()
59 ocb3_int_xor_blocks(pt_b, tmp, ocb->Offset_current, ocb->block_len); in ocb3_decrypt()
71 zeromem(tmp, sizeof(tmp)); in ocb3_decrypt()
H A Docb3_encrypt.c22 unsigned char tmp[MAXBLOCKSIZE]; in ocb3_encrypt() local
50 /* tmp[] = pt[] XOR ocb->Offset_current[] */ in ocb3_encrypt()
51 ocb3_int_xor_blocks(tmp, pt_b, ocb->Offset_current, ocb->block_len); in ocb3_encrypt()
54 if ((err = cipher_descriptor[ocb->cipher]->ecb_encrypt(tmp, tmp, &ocb->key)) != CRYPT_OK) { in ocb3_encrypt()
58 /* ct[] = tmp[] XOR ocb->Offset_current[] */ in ocb3_encrypt()
59 ocb3_int_xor_blocks(ct_b, tmp, ocb->Offset_current, ocb->block_len); in ocb3_encrypt()
71 zeromem(tmp, sizeof(tmp)); in ocb3_encrypt()
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utf8/
H A Dder_decode_utf8_string.c24 wchar_t tmp; in der_decode_utf8_string() local
62 tmp = in[x++]; in der_decode_utf8_string()
77 this is done by left-shifting tmp, which clears the ms-bits */ in der_decode_utf8_string()
78 for (z = 0; (tmp & 0x80) && (z <= 4); z++, tmp = (tmp << 1) & 0xFF); in der_decode_utf8_string()
85 /* right-shift tmp to restore least-sig bits */ in der_decode_utf8_string()
86 tmp >>= z; in der_decode_utf8_string()
100 tmp = (tmp << 6) | ((wchar_t)in[x++] & 0x3F); in der_decode_utf8_string()
104 out[y] = tmp; in der_decode_utf8_string()
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/
H A Dder_encode_asn1_identifier.c20 ulong64 tmp; in der_encode_asn1_identifier() local
64 tmp = id->tag; in der_encode_asn1_identifier()
67 tmp >>= 7; in der_encode_asn1_identifier()
68 } while (tmp); in der_encode_asn1_identifier()
75 for (tmp = 1; tmp <= tag_len; ++tmp) { in der_encode_asn1_identifier()
76 out[tmp] = ((id->tag >> (7 * (tag_len - tmp))) & 0x7f) | 0x80; in der_encode_asn1_identifier()
/optee_os/core/lib/libtomcrypt/src/prngs/
H A Dfortuna.c110 unsigned char tmp[MAXBLOCKSIZE]; in s_fortuna_reseed() local
129 sha256_done(&md, tmp); in s_fortuna_reseed()
138 if ((err = sha256_done(&prng->u.fortuna.pool[x], tmp)) != CRYPT_OK) { in s_fortuna_reseed()
139 sha256_done(&md, tmp); in s_fortuna_reseed()
143 if ((err = sha256_process(&md, tmp, 32)) != CRYPT_OK) { in s_fortuna_reseed()
144 sha256_done(&md, tmp); in s_fortuna_reseed()
149 sha256_done(&md, tmp); in s_fortuna_reseed()
178 zeromem(tmp, sizeof(tmp)); in s_fortuna_reseed()
195 unsigned char tmp[MAXBLOCKSIZE]; in fortuna_update_seed() local
202 sha256_done(&md, tmp); in fortuna_update_seed()
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/asn1/oid/
H A Dpk_oid_str.c49 char tmp[256] = { 0 }; in pk_oid_num_to_str() local
58 tmp[k] = '0'; in pk_oid_num_to_str()
59 if (++k >= sizeof(tmp)) return CRYPT_ERROR; in pk_oid_num_to_str()
63 tmp[k] = '0' + (j % 10); in pk_oid_num_to_str()
64 if (++k >= sizeof(tmp)) return CRYPT_ERROR; in pk_oid_num_to_str()
69 tmp[k] = '.'; in pk_oid_num_to_str()
70 if (++k >= sizeof(tmp)) return CRYPT_ERROR; in pk_oid_num_to_str()
78 for (j = 0; j < k; j++) OID[j] = tmp[k - j - 1]; in pk_oid_num_to_str()
/optee_os/core/lib/libtomcrypt/src/pk/dh/
H A Ddh_shared_secret.c19 void *tmp; in dh_shared_secret() local
38 if ((err = mp_init(&tmp)) != CRYPT_OK) { in dh_shared_secret()
47 /* compute tmp = y^x mod p */ in dh_shared_secret()
48 if ((err = mp_exptmod(public_key->y, private_key->x, private_key->prime, tmp)) != CRYPT_OK) { in dh_shared_secret()
53 x = (unsigned long)mp_unsigned_bin_size(tmp); in dh_shared_secret()
59 if ((err = mp_to_unsigned_bin(tmp, out)) != CRYPT_OK) { in dh_shared_secret()
66 mp_clear(tmp); in dh_shared_secret()
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/integer/
H A Dder_encode_integer.c78 void *tmp; in der_encode_integer() local
81 if (mp_init(&tmp) != CRYPT_OK) { in der_encode_integer()
89 if (mp_2expt(tmp, y) != CRYPT_OK || mp_add(tmp, num, tmp) != CRYPT_OK) { in der_encode_integer()
90 mp_clear(tmp); in der_encode_integer()
93 if ((err = mp_to_unsigned_bin(tmp, out)) != CRYPT_OK) { in der_encode_integer()
94 mp_clear(tmp); in der_encode_integer()
97 mp_clear(tmp); in der_encode_integer()
H A Dder_decode_integer.c52 void *tmp; in der_decode_integer() local
53 if (mp_init(&tmp) != CRYPT_OK) { in der_decode_integer()
57 if (mp_2expt(tmp, mp_count_bits(num)) != CRYPT_OK || mp_sub(num, tmp, num) != CRYPT_OK) { in der_decode_integer()
58 mp_clear(tmp); in der_decode_integer()
61 mp_clear(tmp); in der_decode_integer()
/optee_os/mk/
H A Dcheckconf.mk23 echo "#ifndef $${guard}" >$@.tmp; \
24 echo "#define $${guard}" >>$@.tmp; \
25 echo -n "$${cnf}" | sed 's/_nl_ */\n/g' >>$@.tmp; \
26 echo "#endif" >>$@.tmp; \
27 $(call mv-if-changed,$@.tmp,$@)
37 echo "# auto-generated TEE configuration file" >$@.tmp; \
38 echo "# TEE version ${TEE_IMPL_VERSION}" >>$@.tmp; \
39 echo -n "$${cnf}" | sed 's/_nl_ */\n/g' >>$@.tmp; \
40 $(call mv-if-changed,$@.tmp,$@)
50 echo "# auto-generated TEE configuration file" >$@.tmp; \
[all …]
/optee_os/core/crypto/
H A Dsigned_hdr.c25 vaddr_t tmp = 0; in shdr_alloc_and_copy() local
35 if (ADD_OVERFLOW(img_va, shdr_size, &tmp)) in shdr_alloc_and_copy()
210 } *tmp = NULL; in calc_next_uuid() local
224 tmp = mempool_alloc(mempool_default, sizeof(*tmp) + name_size); in calc_next_uuid()
225 if (!tmp) in calc_next_uuid()
227 memcpy(tmp->name_str, ns_name, name_size); in calc_next_uuid()
231 crypto_hash_update(ctx, (const void *)tmp->name_str, in calc_next_uuid()
232 strnlen(tmp->name_str, name_size)) || in calc_next_uuid()
233 crypto_hash_final(ctx, tmp->digest, sizeof(tmp->digest))) in calc_next_uuid()
236 tee_uuid_from_octets(&tmp->uuid, tmp->digest); in calc_next_uuid()
[all …]
H A Daes-gcm-sw.c83 uint64_t tmp[2] = { 0 }; in encrypt_pl() local
86 memcpy(tmp, src + n * TEE_AES_BLOCK_SIZE, sizeof(tmp)); in encrypt_pl()
87 encrypt_block(state, ek, tmp, d); in encrypt_pl()
122 uint64_t tmp[2] = { 0 }; in decrypt_pl() local
125 memcpy(tmp, src + n * TEE_AES_BLOCK_SIZE, sizeof(tmp)); in decrypt_pl()
126 decrypt_block(state, ek, tmp, d); in decrypt_pl()
/optee_os/core/lib/libtomcrypt/src/stream/rc4/
H A Drc4_stream.c17 unsigned char tmp, *s; in rc4_stream_setup() local
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
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()
67 *out++ = *in++ ^ s[tmp]; in rc4_stream_crypt()
/optee_os/core/lib/zlib/
H A Dadler32.c30 unsigned long tmp = a >> 16; \
32 a += (tmp << 4) - tmp; \
46 z_off64_t tmp = a >> 32; \
48 a += (tmp << 8) - (tmp << 5) + tmp; \
49 tmp = a >> 16; \
51 a += (tmp << 4) - tmp; \
52 tmp = a >> 16; \
54 a += (tmp << 4) - tmp; \
/optee_os/core/lib/libtomcrypt/src/ciphers/
H A Drc2.c66 unsigned char tmp[128]; in rc2_setup_ex() local
85 tmp[i] = key[i] & 255; in rc2_setup_ex()
91 tmp[i] = permute[(tmp[i - 1] + tmp[i - keylen]) & 255]; in rc2_setup_ex()
98 tmp[128 - T8] = permute[tmp[128 - T8] & TM]; in rc2_setup_ex()
100 tmp[i] = permute[tmp[i + 1] ^ tmp[i + T8]]; in rc2_setup_ex()
105 xkey[i] = (unsigned)tmp[2*i] + ((unsigned)tmp[2*i+1] << 8); in rc2_setup_ex()
109 zeromem(tmp, sizeof(tmp)); in rc2_setup_ex()
347 unsigned char tmp[2][8]; in rc2_test()
350 zeromem(tmp, sizeof(tmp)); in rc2_test()
362 rc2_ecb_encrypt(tests[x].pt, tmp[0], &skey); in rc2_test()
[all …]
H A Dtea.c147 unsigned char tmp[2][8]; in tea_test()
166 tea_ecb_encrypt(ptct[0], tmp[0], &skey); in tea_test()
167 tea_ecb_decrypt(tmp[0], tmp[1], &skey); in tea_test()
169 if (compare_testvector(tmp[0], 8, ptct[1], 8, "TEA Encrypt", i) != 0 || in tea_test()
170 compare_testvector(tmp[1], 8, ptct[0], 8, "TEA Decrypt", i) != 0) { in tea_test()
175 for (y = 0; y < 8; y++) tmp[0][y] = 0; in tea_test()
176 for (y = 0; y < 1000; y++) tea_ecb_encrypt(tmp[0], tmp[0], &skey); in tea_test()
177 for (y = 0; y < 1000; y++) tea_ecb_decrypt(tmp[0], tmp[0], &skey); in tea_test()
178 for (y = 0; y < 8; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; in tea_test()
/optee_os/core/arch/arm/plat-marvell/armada7k8k/
H A Dhal_sec_perf.c142 uint32_t tmp; in _find_valid_range() local
145 tmp = io_read32(MCU_TZ_RANGE_LOW_REG(i)); in _find_valid_range()
146 if (!TZ_IS_VALID(tmp)) in _find_valid_range()
211 uint32_t tmp; in _dump_range() local
219 tmp = io_read32(MCU_TZ_RANGE_LOW_REG(i)); in _dump_range()
221 if (TZ_IS_VALID(tmp)) { in _dump_range()
222 TZ_GET_PERM(tmp, perm_read); in _dump_range()
223 TZ_GET_AREA_LEN_CODE(tmp, sizecode_read); in _dump_range()
224 TZ_GET_START_ADDR_L(tmp, addr_read); in _dump_range()
228 i, MCU_TZ_RANGE_LOW_REG(i), tmp); in _dump_range()
[all …]
/optee_os/core/arch/arm/kernel/
H A Dunwind_arm64.c53 vaddr_t *tmp = NULL; in unw_get_kernel_stack() local
63 tmp = unw_grow(addr, &size, (n + 1) * sizeof(vaddr_t)); in unw_get_kernel_stack()
64 if (!tmp) in unw_get_kernel_stack()
66 addr = tmp; in unw_get_kernel_stack()
72 tmp = unw_grow(addr, &size, (n + 1) * sizeof(vaddr_t)); in unw_get_kernel_stack()
73 if (!tmp) in unw_get_kernel_stack()
75 addr = tmp; in unw_get_kernel_stack()
H A Dunwind_private.h12 void *tmp = NULL; in unw_grow() local
18 tmp = realloc(p, rounded_size); in unw_grow()
20 if (tmp) in unw_grow()
22 return tmp; in unw_grow()

1234567