Home
last modified time | relevance | path

Searched refs:in (Results 1 – 25 of 255) sorted by relevance

1234567891011

/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/
H A Dder_sequence_free.c16 void der_sequence_free(ltc_asn1_list *in) in der_sequence_free() argument
20 if (!in) return; in der_sequence_free()
23 while (in->prev != NULL || in->parent != NULL) { in der_sequence_free()
24 if (in->parent != NULL) { in der_sequence_free()
25 in = in->parent; in der_sequence_free()
27 in = in->prev; in der_sequence_free()
32 while (in != NULL) { in der_sequence_free()
34 if (in->child) { in der_sequence_free()
36 in->child->parent = NULL; in der_sequence_free()
37 der_sequence_free(in->child); in der_sequence_free()
[all …]
H A Dder_sequence_shrink.c17 void der_sequence_shrink(ltc_asn1_list *in) in der_sequence_shrink() argument
19 if (!in) return; in der_sequence_shrink()
22 while (in != NULL) { in der_sequence_shrink()
24 if (in->child) { in der_sequence_shrink()
25 der_sequence_shrink(in->child); in der_sequence_shrink()
28 switch (in->type) { in der_sequence_shrink()
31 case LTC_ASN1_SEQUENCE : if (in->data != NULL) { XFREE(in->data); in->data = NULL; } break; in der_sequence_shrink()
36 in = in->next; in der_sequence_shrink()
/optee_os/core/lib/libtomcrypt/src/misc/pkcs12/
H A Dpkcs12_utf8_to_utf16.c8 int pkcs12_utf8_to_utf16(const unsigned char *in, unsigned long inlen, in pkcs12_utf8_to_utf16() argument
11 const unsigned char* in_end = in + inlen; in pkcs12_utf8_to_utf16()
18 LTC_ARGCHK(in != NULL); in pkcs12_utf8_to_utf16()
22 while (in < in_end) { in pkcs12_utf8_to_utf16()
25 if (*in >= 192) extra++; /* 1 */ in pkcs12_utf8_to_utf16()
26 if (*in >= 224) extra++; /* 2 */ in pkcs12_utf8_to_utf16()
27 if (*in >= 240) extra++; /* 3 */ in pkcs12_utf8_to_utf16()
28 if (*in >= 248) extra++; /* 4 */ in pkcs12_utf8_to_utf16()
29 if (*in >= 252) extra++; /* 5 */ in pkcs12_utf8_to_utf16()
30 if (in + extra >= in_end) goto ERROR; in pkcs12_utf8_to_utf16()
[all …]
/optee_os/core/lib/libtomcrypt/src/misc/base32/
H A Dbase32_encode.c17 int base32_encode(const unsigned char *in, unsigned long inlen, in base32_encode() argument
30 LTC_ARGCHK(in != NULL); in base32_encode()
53 *out++ = codes[(in[0] >> 3) & 0x1F]; in base32_encode()
54 *out++ = codes[(((in[0] & 0x7) << 2) + (in[1] >> 6)) & 0x1F]; in base32_encode()
55 *out++ = codes[(in[1] >> 1) & 0x1F]; in base32_encode()
56 *out++ = codes[(((in[1] & 0x1) << 4) + (in[2] >> 4)) & 0x1F]; in base32_encode()
57 *out++ = codes[(((in[2] & 0xF) << 1) + (in[3] >> 7)) & 0x1F]; in base32_encode()
58 *out++ = codes[(in[3] >> 2) & 0x1F]; in base32_encode()
59 *out++ = codes[(((in[3] & 0x3) << 3) + (in[4] >> 5)) & 0x1F]; in base32_encode()
60 *out++ = codes[in[4] & 0x1F]; in base32_encode()
[all …]
/optee_os/core/lib/libtomcrypt/src/misc/base64/
H A Dbase64_encode.c33 static int s_base64_encode_internal(const unsigned char *in, unsigned long inlen, in s_base64_encode_internal() argument
56 LTC_ARGCHK(in != NULL); in s_base64_encode_internal()
59 if ((void*)in == out) { in s_base64_encode_internal()
66 *p++ = codes[(in[0] >> 2) & 0x3F]; in s_base64_encode_internal()
67 *p++ = codes[(((in[0] & 3) << 4) + (in[1] >> 4)) & 0x3F]; in s_base64_encode_internal()
68 *p++ = codes[(((in[1] & 0xf) << 2) + (in[2] >> 6)) & 0x3F]; in s_base64_encode_internal()
69 *p++ = codes[in[2] & 0x3F]; in s_base64_encode_internal()
70 in += 3; in s_base64_encode_internal()
78 unsigned a = in[0]; in s_base64_encode_internal()
79 unsigned b = (i+1 < inlen) ? in[1] : 0; in s_base64_encode_internal()
[all …]
H A Dbase64_decode.c78 static int s_base64_decode_internal(const char *in, unsigned long inlen, in s_base64_decode_internal() argument
86 LTC_ARGCHK(in != NULL); in s_base64_decode_internal()
92 if ((in[x] == 0) && (x == (inlen - 1)) && (mode != strict)) { in s_base64_decode_internal()
95 c = map[(unsigned char)in[x]&0xFF]; in s_base64_decode_internal()
149 int base64_decode(const char *in, unsigned long inlen, in base64_decode() argument
152 return s_base64_decode_internal(in, inlen, out, outlen, map_base64, insane); in base64_decode()
163 int base64_strict_decode(const char *in, unsigned long inlen, in base64_strict_decode() argument
166 return s_base64_decode_internal(in, inlen, out, outlen, map_base64, strict); in base64_strict_decode()
177 int base64_sane_decode(const char *in, unsigned long inlen, in base64_sane_decode() argument
180 return s_base64_decode_internal(in, inlen, out, outlen, map_base64, relaxed); in base64_sane_decode()
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utf8/
H A Dder_encode_utf8_string.c21 int der_encode_utf8_string(const wchar_t *in, unsigned long inlen, in der_encode_utf8_string() argument
27 LTC_ARGCHK(in != NULL); in der_encode_utf8_string()
33 if (!der_utf8_valid_char(in[x])) return CRYPT_INVALID_ARG; in der_encode_utf8_string()
34 len += der_utf8_charsize(in[x]); in der_encode_utf8_string()
59 switch (der_utf8_charsize(in[y])) { in der_encode_utf8_string()
60 case 1: out[x++] = (unsigned char)in[y]; break; in der_encode_utf8_string()
61 case 2: out[x++] = 0xC0 | ((in[y] >> 6) & 0x1F); out[x++] = 0x80 | (in[y] & 0x3F); break; in der_encode_utf8_string()
62 …case 3: out[x++] = 0xE0 | ((in[y] >> 12) & 0x0F); out[x++] = 0x80 | ((in[y] >> 6) & 0x3F); out[x++… in der_encode_utf8_string()
64 …] = 0xF0 | ((in[y] >> 18) & 0x07); out[x++] = 0x80 | ((in[y] >> 12) & 0x3F); out[x++] = 0x80 | ((i… in der_encode_utf8_string()
H A Dder_decode_utf8_string.c21 int der_decode_utf8_string(const unsigned char *in, unsigned long inlen, in der_decode_utf8_string() argument
28 LTC_ARGCHK(in != NULL); in der_decode_utf8_string()
38 if ((in[0] & 0x1F) != 0x0C) { in der_decode_utf8_string()
45 if ((err = der_decode_asn1_length(in + x, &y, &len)) != CRYPT_OK) { in der_decode_utf8_string()
62 tmp = in[x++]; in der_decode_utf8_string()
97 if ((in[x] & 0xC0) != 0x80) { in der_decode_utf8_string()
100 tmp = (tmp << 6) | ((wchar_t)in[x++] & 0x3F); in der_decode_utf8_string()
/optee_os/core/arch/arm/crypto/
H A Dsm4_armv8a_neon.c35 void crypto_accel_sm4_ecb_enc(void *out, const void *in, const void *key, in crypto_accel_sm4_ecb_enc() argument
40 assert(out && in && key && !(len % 16)); in crypto_accel_sm4_ecb_enc()
43 neon_sm4_ecb_encrypt(out, in, key, len); in crypto_accel_sm4_ecb_enc()
47 void crypto_accel_sm4_cbc_enc(void *out, const void *in, const void *key, in crypto_accel_sm4_cbc_enc() argument
52 assert(out && in && key && !(len % 16)); in crypto_accel_sm4_cbc_enc()
55 neon_sm4_cbc_encrypt(out, in, key, len, iv); in crypto_accel_sm4_cbc_enc()
59 void crypto_accel_sm4_cbc_dec(void *out, const void *in, const void *key, in crypto_accel_sm4_cbc_dec() argument
64 assert(out && in && key && !(len % 16)); in crypto_accel_sm4_cbc_dec()
67 neon_sm4_cbc_decrypt(out, in, key, len, iv); in crypto_accel_sm4_cbc_dec()
71 void crypto_accel_sm4_ctr_enc(void *out, const void *in, const void *key, in crypto_accel_sm4_ctr_enc() argument
[all …]
H A Dsm4_armv8a_ce.c35 void crypto_accel_sm4_ecb_enc(void *out, const void *in, const void *key, in crypto_accel_sm4_ecb_enc() argument
40 assert(out && in && key && !(len % 16)); in crypto_accel_sm4_ecb_enc()
43 ce_sm4_ecb_encrypt(out, in, key, len); in crypto_accel_sm4_ecb_enc()
47 void crypto_accel_sm4_cbc_enc(void *out, const void *in, const void *key, in crypto_accel_sm4_cbc_enc() argument
52 assert(out && in && key && !(len % 16)); in crypto_accel_sm4_cbc_enc()
55 ce_sm4_cbc_encrypt(out, in, key, len, iv); in crypto_accel_sm4_cbc_enc()
59 void crypto_accel_sm4_cbc_dec(void *out, const void *in, const void *key, in crypto_accel_sm4_cbc_dec() argument
64 assert(out && in && key && !(len % 16)); in crypto_accel_sm4_cbc_dec()
67 ce_sm4_cbc_decrypt(out, in, key, len, iv); in crypto_accel_sm4_cbc_dec()
71 void crypto_accel_sm4_ctr_enc(void *out, const void *in, const void *key, in crypto_accel_sm4_ctr_enc() argument
[all …]
H A Daes_armv8a_ce.c156 void crypto_accel_aes_ecb_enc(void *out, const void *in, const void *key, in crypto_accel_aes_ecb_enc() argument
162 assert(out && in && key); in crypto_accel_aes_ecb_enc()
165 ce_aes_ecb_encrypt(out, in, key, round_count, block_count, 1); in crypto_accel_aes_ecb_enc()
169 void crypto_accel_aes_ecb_dec(void *out, const void *in, const void *key, in crypto_accel_aes_ecb_dec() argument
175 assert(out && in && key); in crypto_accel_aes_ecb_dec()
178 ce_aes_ecb_decrypt(out, in, key, round_count, block_count, 1); in crypto_accel_aes_ecb_dec()
182 void crypto_accel_aes_cbc_enc(void *out, const void *in, const void *key, in crypto_accel_aes_cbc_enc() argument
188 assert(out && in && key && iv); in crypto_accel_aes_cbc_enc()
191 ce_aes_cbc_encrypt(out, in, key, round_count, block_count, iv); in crypto_accel_aes_cbc_enc()
195 void crypto_accel_aes_cbc_dec(void *out, const void *in, const void *key, in crypto_accel_aes_cbc_dec() argument
[all …]
H A Daes_armv8a_ce.h12 uint32_t ce_aes_sub(uint32_t in);
14 void ce_aes_ecb_encrypt(uint8_t out[], uint8_t const in[], uint8_t const rk[],
16 void ce_aes_ecb_decrypt(uint8_t out[], uint8_t const in[], uint8_t const rk[],
18 void ce_aes_cbc_encrypt(uint8_t out[], uint8_t const in[], uint8_t const rk[],
20 void ce_aes_cbc_decrypt(uint8_t out[], uint8_t const in[], uint8_t const rk[],
22 void ce_aes_ctr_encrypt(uint8_t out[], uint8_t const in[], uint8_t const rk[],
24 void ce_aes_xts_encrypt(uint8_t out[], uint8_t const in[], uint8_t const rk1[],
27 void ce_aes_xts_decrypt(uint8_t out[], uint8_t const in[], uint8_t const rk1[],
/optee_os/lib/libmbedtls/mbedtls/library/
H A Dssl_debug_helpers_generated.c21 const char *mbedtls_ssl_named_group_to_str( uint16_t in ) in mbedtls_ssl_named_group_to_str() argument
23 switch( in ) in mbedtls_ssl_named_group_to_str()
65 const char *mbedtls_ssl_sig_alg_to_str( uint16_t in ) in mbedtls_ssl_sig_alg_to_str() argument
67 switch( in ) in mbedtls_ssl_sig_alg_to_str()
107 const char *mbedtls_ssl_states_str( mbedtls_ssl_states in ) in mbedtls_ssl_states_str() argument
109 switch (in) { in mbedtls_ssl_states_str()
176 const char *mbedtls_ssl_early_data_status_str( mbedtls_ssl_early_data_status in ) in mbedtls_ssl_early_data_status_str() argument
178 switch (in) { in mbedtls_ssl_early_data_status_str()
191 const char *mbedtls_ssl_protocol_version_str( mbedtls_ssl_protocol_version in ) in mbedtls_ssl_protocol_version_str() argument
193 switch (in) { in mbedtls_ssl_protocol_version_str()
[all …]
H A Dssl_debug_helpers.h22 const char *mbedtls_ssl_states_str(mbedtls_ssl_states in);
25 const char *mbedtls_ssl_early_data_status_str(mbedtls_ssl_early_data_status in);
26 const char *mbedtls_ssl_early_data_state_str(mbedtls_ssl_early_data_state in);
29 const char *mbedtls_ssl_protocol_version_str(mbedtls_ssl_protocol_version in);
31 const char *mbedtls_tls_prf_types_str(mbedtls_tls_prf_types in);
33 const char *mbedtls_ssl_key_export_type_str(mbedtls_ssl_key_export_type in);
35 const char *mbedtls_ssl_sig_alg_to_str(uint16_t in);
37 const char *mbedtls_ssl_named_group_to_str(uint16_t in);
/optee_os/core/lib/libtomcrypt/src/misc/ssh/
H A Dssh_decode_sequence_multi.c20 int ssh_decode_sequence_multi(const unsigned char *in, unsigned long *inlen, ...) in ssh_decode_sequence_multi() argument
34 LTC_ARGCHK(in != NULL); in ssh_decode_sequence_multi()
69 LOAD32H(size, in); in ssh_decode_sequence_multi()
70 in += 4; in ssh_decode_sequence_multi()
99 *cdata = *in++; in ssh_decode_sequence_multi()
107 *cdata = (*in++)?1:0; in ssh_decode_sequence_multi()
111 LOAD32H(*u32data, in); in ssh_decode_sequence_multi()
112 in += 4; in ssh_decode_sequence_multi()
116 LOAD64H(*u64data, in); in ssh_decode_sequence_multi()
117 in += 8; in ssh_decode_sequence_multi()
[all …]
/optee_os/core/lib/libtomcrypt/src/headers/
H A Dtomcrypt_pk.h52 int rsa_exptmod(const unsigned char *in, unsigned long inlen,
59 #define rsa_encrypt_key(in, inlen, out, outlen, lparam, lparamlen, prng, prng_idx, hash_idx, key) \ argument
60 …rsa_encrypt_key_ex(in, inlen, out, outlen, lparam, lparamlen, prng, prng_idx, hash_idx, -1, LTC_PK…
62 #define rsa_decrypt_key(in, inlen, out, outlen, lparam, lparamlen, hash_idx, stat, key) \ argument
63 …rsa_decrypt_key_ex(in, inlen, out, outlen, lparam, lparamlen, hash_idx, -1, LTC_PKCS_1_OAEP, stat,…
65 #define rsa_sign_hash(in, inlen, out, outlen, prng, prng_idx, hash_idx, saltlen, key) \ argument
66 rsa_sign_hash_ex(in, inlen, out, outlen, LTC_PKCS_1_PSS, prng, prng_idx, hash_idx, saltlen, key)
75 int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen,
83 int rsa_decrypt_key_ex(const unsigned char *in, unsigned long inlen,
90 int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen,
[all …]
H A Dtomcrypt_misc.h6 int base64_encode(const unsigned char *in, unsigned long inlen,
9 int base64_decode(const char *in, unsigned long inlen,
11 int base64_strict_decode(const char *in, unsigned long inlen,
13 int base64_sane_decode(const char *in, unsigned long inlen,
18 int base64url_encode(const unsigned char *in, unsigned long inlen,
20 int base64url_strict_encode(const unsigned char *in, unsigned long inlen,
23 int base64url_decode(const char *in, unsigned long inlen,
25 int base64url_strict_decode(const char *in, unsigned long inlen,
27 int base64url_sane_decode(const char *in, unsigned long inlen,
39 int base32_encode(const unsigned char *in, unsigned long inlen,
[all …]
H A Dtomcrypt_prng.h91 int (*add_entropy)(const unsigned char *in, unsigned long inlen, prng_state *prng);
122 int (*pimport)(const unsigned char *in, unsigned long inlen, prng_state *prng);
131 int yarrow_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng);
136 int yarrow_import(const unsigned char *in, unsigned long inlen, prng_state *prng);
143 int fortuna_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng);
144 int fortuna_add_random_event(unsigned long source, unsigned long pool, const unsigned char *in, uns…
149 int fortuna_import(const unsigned char *in, unsigned long inlen, prng_state *prng);
150 int fortuna_update_seed(const unsigned char *in, unsigned long inlen, prng_state *prng);
157 int rc4_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng);
162 int rc4_import(const unsigned char *in, unsigned long inlen, prng_state *prng);
[all …]
/optee_os/core/include/crypto/
H A Dcrypto_accel.h16 void crypto_accel_aes_ecb_enc(void *out, const void *in, const void *key,
19 void crypto_accel_aes_ecb_dec(void *out, const void *in, const void *key,
23 void crypto_accel_aes_cbc_enc(void *out, const void *in, const void *key,
26 void crypto_accel_aes_cbc_dec(void *out, const void *in, const void *key,
30 void crypto_accel_aes_ctr_be_enc(void *out, const void *in, const void *key,
34 void crypto_accel_aes_xts_enc(void *out, const void *in, const void *key1,
38 void crypto_accel_aes_xts_dec(void *out, const void *in, const void *key1,
57 void crypto_accel_sm4_ecb_enc(void *out, const void *in, const void *key,
59 void crypto_accel_sm4_cbc_enc(void *out, const void *in, const void *key,
61 void crypto_accel_sm4_cbc_dec(void *out, const void *in, const void *key,
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/boolean/
H A Dder_decode_boolean.c20 int der_decode_boolean(const unsigned char *in, unsigned long inlen, in der_decode_boolean() argument
23 LTC_ARGCHK(in != NULL); in der_decode_boolean()
26 if (inlen < 3 || in[0] != 0x01 || in[1] != 0x01 || (in[2] != 0x00 && in[2] != 0xFF)) { in der_decode_boolean()
30 *out = (in[2]==0xFF) ? 1 : 0; in der_decode_boolean()
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/custom_type/
H A Dder_decode_custom_type.c20 int der_decode_custom_type(const unsigned char *in, unsigned long inlen, in der_decode_custom_type() argument
24 …return der_decode_custom_type_ex(in, inlen, root, NULL, 0, LTC_DER_SEQ_ORDERED | LTC_DER_SEQ_RELAX… in der_decode_custom_type()
42 int der_decode_custom_type_ex(const unsigned char *in, unsigned long inlen, in der_decode_custom_type_ex() argument
54 LTC_ARGCHK(in != NULL); in der_decode_custom_type_ex()
66 if (in[x] != 0x30 && in[x] != 0x31) { in der_decode_custom_type_ex()
81 XMEMCPY(in_new, in, inlen); in der_decode_custom_type_ex()
82 in = in_new; in der_decode_custom_type_ex()
86 if ((err = der_decode_asn1_identifier(in, &y, &ident)) != CRYPT_OK) { in der_decode_custom_type_ex()
119 if ((err = der_decode_asn1_length(&in[x], &y, &blksize)) != CRYPT_OK) { in der_decode_custom_type_ex()
166 if (in[x] & 0xE0u) { in der_decode_custom_type_ex()
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/choice/
H A Dder_decode_choice.c20 int der_decode_choice(const unsigned char *in, unsigned long *inlen, in der_decode_choice() argument
26 LTC_ARGCHK(in != NULL); in der_decode_choice()
47 if (der_decode_boolean(in, *inlen, data) == CRYPT_OK) { in der_decode_choice()
57 if (der_decode_integer(in, *inlen, data) == CRYPT_OK) { in der_decode_choice()
67 if (der_decode_short_integer(in, *inlen, data) == CRYPT_OK) { in der_decode_choice()
77 if (der_decode_bit_string(in, *inlen, data, &size) == CRYPT_OK) { in der_decode_choice()
88 if (der_decode_raw_bit_string(in, *inlen, data, &size) == CRYPT_OK) { in der_decode_choice()
99 if (der_decode_octet_string(in, *inlen, data, &size) == CRYPT_OK) { in der_decode_choice()
110 if (*inlen == 2 && in[x] == 0x05 && in[x+1] == 0x00) { in der_decode_choice()
118 if (der_decode_object_identifier(in, *inlen, data, &size) == CRYPT_OK) { in der_decode_choice()
[all …]
/optee_os/core/kernel/
H A Dtee_misc.c13 static uint8_t tee_b2hs_add_base(uint8_t in) in tee_b2hs_add_base() argument
15 if (in > 9) in tee_b2hs_add_base()
16 return in + 55; in tee_b2hs_add_base()
18 return in + 48; in tee_b2hs_add_base()
21 static int tee_hs2b_rem_base(uint8_t in, uint8_t *out) in tee_hs2b_rem_base() argument
23 if (in < 48 || in > 70 || (in > 57 && in < 65)) in tee_hs2b_rem_base()
26 if (in < 58) in tee_hs2b_rem_base()
27 *out = in - 48; in tee_hs2b_rem_base()
29 *out = in - 55; in tee_hs2b_rem_base()
/optee_os/core/lib/libtomcrypt/src/pk/ecc/
H A Dltc_ecc_import_point.c8 int ltc_ecc_import_point(const unsigned char *in, unsigned long inlen, void *prime, void *a, void *… in ltc_ecc_import_point() argument
21 if (in[0] == 0x04 && (inlen&1) && ((inlen-1)>>1) == size) { in ltc_ecc_import_point()
24 …if ((err = mp_read_unsigned_bin(x, (unsigned char *)in+1, size)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point()
26 …if ((err = mp_read_unsigned_bin(y, (unsigned char *)in+1+size, size)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point()
28 else if ((in[0] == 0x02 || in[0] == 0x03) && (inlen-1) == size && ltc_mp.sqrtmod_prime != NULL) { in ltc_ecc_import_point()
31 …if ((err = mp_read_unsigned_bin(x, (unsigned char *)in+1, size)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point()
43 if ((mp_isodd(t2) && in[0] == 0x03) || (!mp_isodd(t2) && in[0] == 0x02)) { in ltc_ecc_import_point()
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/integer/
H A Dder_decode_integer.c20 int der_decode_integer(const unsigned char *in, unsigned long inlen, void *num) in der_decode_integer() argument
26 LTC_ARGCHK(in != NULL); in der_decode_integer()
35 if ((in[x++] & 0x1F) != 0x02) { in der_decode_integer()
41 if ((err = der_decode_asn1_length(in + x, &inlen, &y)) != CRYPT_OK) { in der_decode_integer()
46 if ((err = mp_read_unsigned_bin(num, (unsigned char *)in + x, y)) != CRYPT_OK) { in der_decode_integer()
51 if (in[x] & 0x80) { in der_decode_integer()

1234567891011