Home
last modified time | relevance | path

Searched refs:key_len (Results 1 – 25 of 209) sorted by relevance

123456789

/external/wpa_supplicant_8/src/crypto/
Dcrypto_internal.c35 size_t key_len; member
40 size_t key_len) in crypto_hash_init() argument
76 if (key_len > sizeof(k_pad)) { in crypto_hash_init()
78 MD5Update(&ctx->u.md5, key, key_len); in crypto_hash_init()
81 key_len = 16; in crypto_hash_init()
83 os_memcpy(ctx->key, key, key_len); in crypto_hash_init()
84 ctx->key_len = key_len; in crypto_hash_init()
86 os_memcpy(k_pad, key, key_len); in crypto_hash_init()
87 if (key_len < sizeof(k_pad)) in crypto_hash_init()
88 os_memset(k_pad + key_len, 0, sizeof(k_pad) - key_len); in crypto_hash_init()
[all …]
Daes-siv.c64 static int aes_s2v(const u8 *key, size_t key_len, in aes_s2v() argument
79 return omac1_aes_vector(key, key_len, 1, data, data_len, mac); in aes_s2v()
84 ret = omac1_aes_vector(key, key_len, 1, data, data_len, tmp); in aes_s2v()
89 ret = omac1_aes_vector(key, key_len, 1, &addr[i], &len[i], in aes_s2v()
104 ret = omac1_aes_vector(key, key_len, 1, data, &len[i], mac); in aes_s2v()
115 return omac1_aes_vector(key, key_len, 1, data, data_len, mac); in aes_s2v()
119 int aes_siv_encrypt(const u8 *key, size_t key_len, in aes_siv_encrypt() argument
132 (key_len != 32 && key_len != 48 && key_len != 64)) in aes_siv_encrypt()
135 key_len /= 2; in aes_siv_encrypt()
137 k2 = key + key_len; in aes_siv_encrypt()
[all …]
Dcrypto_gnutls.c101 static int gnutls_hmac_vector(int algo, const u8 *key, size_t key_len, in gnutls_hmac_vector() argument
114 if (gcry_md_setkey(hd, key, key_len) != GPG_ERR_NO_ERROR) { in gnutls_hmac_vector()
128 int hmac_md5_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_md5_vector() argument
131 return gnutls_hmac_vector(GCRY_MD_MD5, key, key_len, num_elem, addr, in hmac_md5_vector()
136 int hmac_md5(const u8 *key, size_t key_len, const u8 *data, size_t data_len, in hmac_md5() argument
139 return hmac_md5_vector(key, key_len, 1, &data, &data_len, mac); in hmac_md5()
143 int hmac_sha1_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_sha1_vector() argument
146 return gnutls_hmac_vector(GCRY_MD_SHA1, key, key_len, num_elem, addr, in hmac_sha1_vector()
151 int hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len, in hmac_sha1() argument
154 return hmac_sha1_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha1()
[all …]
Dsha512.c26 int hmac_sha512_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_sha512_vector() argument
43 if (key_len > 128) { in hmac_sha512_vector()
44 if (sha512_vector(1, &key, &key_len, tk) < 0) in hmac_sha512_vector()
47 key_len = 64; in hmac_sha512_vector()
61 os_memcpy(k_pad, key, key_len); in hmac_sha512_vector()
77 os_memcpy(k_pad, key, key_len); in hmac_sha512_vector()
100 int hmac_sha512(const u8 *key, size_t key_len, const u8 *data, in hmac_sha512() argument
103 return hmac_sha512_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha512()
Dsha384.c26 int hmac_sha384_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_sha384_vector() argument
43 if (key_len > 128) { in hmac_sha384_vector()
44 if (sha384_vector(1, &key, &key_len, tk) < 0) in hmac_sha384_vector()
47 key_len = 48; in hmac_sha384_vector()
61 os_memcpy(k_pad, key, key_len); in hmac_sha384_vector()
77 os_memcpy(k_pad, key, key_len); in hmac_sha384_vector()
100 int hmac_sha384(const u8 *key, size_t key_len, const u8 *data, in hmac_sha384() argument
103 return hmac_sha384_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha384()
Dsha256.c26 int hmac_sha256_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_sha256_vector() argument
43 if (key_len > 64) { in hmac_sha256_vector()
44 if (sha256_vector(1, &key, &key_len, tk) < 0) in hmac_sha256_vector()
47 key_len = 32; in hmac_sha256_vector()
61 os_memcpy(k_pad, key, key_len); in hmac_sha256_vector()
77 os_memcpy(k_pad, key, key_len); in hmac_sha256_vector()
100 int hmac_sha256(const u8 *key, size_t key_len, const u8 *data, in hmac_sha256() argument
103 return hmac_sha256_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha256()
Dsha1.c26 int hmac_sha1_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_sha1_vector() argument
44 if (key_len > 64) { in hmac_sha1_vector()
45 if (sha1_vector(1, &key, &key_len, tk)) in hmac_sha1_vector()
48 key_len = 20; in hmac_sha1_vector()
62 os_memcpy(k_pad, key, key_len); in hmac_sha1_vector()
78 os_memcpy(k_pad, key, key_len); in hmac_sha1_vector()
103 int hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len, in hmac_sha1() argument
106 return hmac_sha1_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha1()
Dcrypto_nettle.c108 int hmac_md5_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_md5_vector() argument
117 hmac_md5_set_key(&ctx, key_len, key); in hmac_md5_vector()
126 int hmac_md5(const u8 *key, size_t key_len, const u8 *data, size_t data_len, in hmac_md5() argument
129 return hmac_md5_vector(key, key_len, 1, &data, &data_len, mac); in hmac_md5()
133 int hmac_sha1_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_sha1_vector() argument
142 hmac_sha1_set_key(&ctx, key_len, key); in hmac_sha1_vector()
151 int hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len, in hmac_sha1() argument
154 return hmac_sha1_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha1()
160 int hmac_sha256_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_sha256_vector() argument
169 hmac_sha256_set_key(&ctx, key_len, key); in hmac_sha256_vector()
[all …]
Dmd5.c26 int hmac_md5_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_md5_vector() argument
44 if (key_len > 64) { in hmac_md5_vector()
45 if (md5_vector(1, &key, &key_len, tk)) in hmac_md5_vector()
48 key_len = 16; in hmac_md5_vector()
62 os_memcpy(k_pad, key, key_len); in hmac_md5_vector()
79 os_memcpy(k_pad, key, key_len); in hmac_md5_vector()
105 int hmac_md5(const u8 *key, size_t key_len, const u8 *data, size_t data_len, in hmac_md5() argument
108 return hmac_md5_vector(key, key_len, 1, &data, &data_len, mac); in hmac_md5()
Dcrypto_wolfssl.c160 size_t key_len, size_t num_elem, in wolfssl_hmac_vector() argument
172 if (wc_HmacSetKey(&hmac, type, key, (word32) key_len) != 0) in wolfssl_hmac_vector()
185 int hmac_md5_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_md5_vector() argument
188 return wolfssl_hmac_vector(WC_MD5, key, key_len, num_elem, addr, len, in hmac_md5_vector()
193 int hmac_md5(const u8 *key, size_t key_len, const u8 *data, size_t data_len, in hmac_md5() argument
196 return hmac_md5_vector(key, key_len, 1, &data, &data_len, mac); in hmac_md5()
202 int hmac_sha1_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_sha1_vector() argument
205 return wolfssl_hmac_vector(WC_SHA, key, key_len, num_elem, addr, len, in hmac_sha1_vector()
210 int hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len, in hmac_sha1() argument
213 return hmac_sha1_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha1()
[all …]
/external/vboot_reference/firmware/lib/cryptolib/
Drsa_utility.c16 int key_len; /* Key length in bytes. (int type matches siglen_map) */ in RSAProcessedKeySize() local
18 key_len = siglen_map[algorithm]; in RSAProcessedKeySize()
23 *out_size = (2 * key_len + sizeof(uint32_t) + sizeof(uint32_t)); in RSAProcessedKeySize()
51 uint64_t key_len; in RSAPublicKeyFromBuf() local
57 key_len = key->len; in RSAPublicKeyFromBuf()
58 key_len *= sizeof(uint32_t); in RSAPublicKeyFromBuf()
61 if (RSA1024NUMBYTES != key_len && in RSAPublicKeyFromBuf()
62 RSA2048NUMBYTES != key_len && in RSAPublicKeyFromBuf()
63 RSA4096NUMBYTES != key_len && in RSAPublicKeyFromBuf()
64 RSA8192NUMBYTES != key_len) { in RSAPublicKeyFromBuf()
[all …]
/external/curl/lib/
Dhash.c45 e->key_len = 0; in hash_element_dtor()
85 mk_hash_element(const void *key, size_t key_len, const void *p) in mk_hash_element() argument
89 key_len); in mk_hash_element()
92 memcpy(he->key, key, key_len); in mk_hash_element()
93 he->key_len = key_len; in mk_hash_element()
109 Curl_hash_add(struct curl_hash *h, void *key, size_t key_len, void *p) in Curl_hash_add() argument
113 struct curl_llist *l = FETCH_LIST(h, key, key_len); in Curl_hash_add()
117 if(h->comp_func(he->key, he->key_len, key, key_len)) { in Curl_hash_add()
124 he = mk_hash_element(key, key_len, p); in Curl_hash_add()
139 int Curl_hash_delete(struct curl_hash *h, void *key, size_t key_len) in Curl_hash_delete() argument
[all …]
/external/wpa_supplicant_8/src/wps/
Dwps_attr_process.c169 const u8 *key, size_t key_len) in wps_process_cred_network_key() argument
184 wpa_hexdump_key(MSG_DEBUG, "WPS: Network Key", key, key_len); in wps_process_cred_network_key()
185 if (key_len <= sizeof(cred->key)) { in wps_process_cred_network_key()
186 os_memcpy(cred->key, key, key_len); in wps_process_cred_network_key()
187 cred->key_len = key_len; in wps_process_cred_network_key()
213 cred->key_len > 8 && cred->key_len < 64 && in wps_workaround_cred_key()
214 cred->key[cred->key_len - 1] == 0) { in wps_workaround_cred_key()
219 cred->key, cred->key_len); in wps_workaround_cred_key()
229 cred->key_len--; in wps_workaround_cred_key()
235 (cred->key_len < 8 || has_ctrl_char(cred->key, cred->key_len))) { in wps_workaround_cred_key()
[all …]
/external/vboot_reference/tests/
Drsa_utility_tests.c87 uint32_t key_len = RSA1024NUMBYTES << i; in TestKeyFromBuffer() local
89 *buf_key_len = key_len / sizeof(uint32_t); in TestKeyFromBuffer()
92 buf[8 + key_len - 1] = 101; in TestKeyFromBuffer()
93 buf[8 + key_len] = 120; in TestKeyFromBuffer()
94 buf[8 + key_len * 2 - 1] = 121; in TestKeyFromBuffer()
97 key = RSAPublicKeyFromBuf(buf, 8 + key_len * 2); in TestKeyFromBuffer()
103 TEST_EQ(((uint8_t*)key->n)[key_len - 1], 101, in TestKeyFromBuffer()
107 TEST_EQ(((uint8_t*)key->rr)[key_len - 1], 121, in TestKeyFromBuffer()
112 TEST_PTR_EQ(RSAPublicKeyFromBuf(buf, 8 + key_len * 2 - 1), NULL, in TestKeyFromBuffer()
114 TEST_PTR_EQ(RSAPublicKeyFromBuf(buf, 8 + key_len * 2 + 1), NULL, in TestKeyFromBuffer()
[all …]
/external/webrtc/talk/session/media/
Dexternalhmac.cc92 err_status_t external_hmac_alloc(auth_t** a, int key_len, int out_len) { in external_hmac_alloc() argument
97 if (key_len > 20) in external_hmac_alloc()
117 (*a)->key_len = key_len; in external_hmac_alloc()
135 int key_len) { in external_hmac_init() argument
136 if (key_len > HMAC_KEY_LENGTH) in external_hmac_init()
139 memset(state->key, 0, key_len); in external_hmac_init()
140 memcpy(state->key, key, key_len); in external_hmac_init()
141 state->key_length = key_len; in external_hmac_init()
/external/pdfium/core/fpdfapi/parser/
Dcpdf_security_handler.cpp189 int& key_len) { in LoadDict() argument
203 if (!LoadCryptInfo(pEncryptDict, strf_name, cipher, key_len)) in LoadDict()
207 m_KeyLen = key_len; in LoadDict()
392 int32_t key_len) { in CheckPassword() argument
401 return CheckOwnerPassword(password, key, key_len); in CheckPassword()
403 return CheckUserPassword(password, false, key, key_len) || in CheckPassword()
404 CheckUserPassword(password, true, key, key_len); in CheckPassword()
410 int32_t key_len) { in CheckUserPassword() argument
411 CalcEncryptKey(m_pEncryptDict.Get(), password, key, key_len, in CheckUserPassword()
422 CRYPT_ArcFourCryptBlock(ukeybuf, 32, key, key_len); in CheckUserPassword()
[all …]
/external/e2fsprogs/lib/ext2fs/
Dhashmap.c31 size_t key_len) in ext2fs_hashmap_add() argument
33 uint32_t hash = h->hash(key, key_len) % h->size; in ext2fs_hashmap_add()
38 e->key_len = key_len; in ext2fs_hashmap_add()
52 size_t key_len) in ext2fs_hashmap_lookup() argument
55 uint32_t hash = h->hash(key, key_len) % h->size; in ext2fs_hashmap_lookup()
58 if (iter->key_len == key_len && !memcmp(iter->key, key, key_len)) in ext2fs_hashmap_lookup()
/external/scapy/scapy/layers/tls/crypto/
Dcipher_block.py52 l = self.key_len
114 key_len = 16 variable in Cipher_AES_128_CBC
117 key_len = 32 variable in Cipher_AES_256_CBC
124 key_len = 16 variable in Cipher_CAMELLIA_128_CBC
127 key_len = 32 variable in Cipher_CAMELLIA_256_CBC
137 key_len = 8 variable in Cipher_DES_CBC
149 key_len = 5 variable in Cipher_DES40_CBC
155 key_len = 24 variable in Cipher_3DES_EDE_CBC
161 key_len = 16 variable in Cipher_IDEA_CBC
167 key_len = 16 variable in Cipher_SEED_CBC
[all …]
/external/boringssl/src/crypto/cipher_extra/
De_tls.c63 static int aead_tls_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, in aead_tls_init() argument
73 if (key_len != EVP_AEAD_key_length(ctx->aead)) { in aead_tls_init()
81 (implicit_iv ? EVP_CIPHER_iv_length(cipher) : 0) == key_len); in aead_tls_init()
396 size_t key_len, size_t tag_len, in aead_aes_128_cbc_sha1_tls_init() argument
398 return aead_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), in aead_aes_128_cbc_sha1_tls_init()
403 EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, size_t tag_len, in aead_aes_128_cbc_sha1_tls_implicit_iv_init() argument
405 return aead_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), in aead_aes_128_cbc_sha1_tls_implicit_iv_init()
410 const uint8_t *key, size_t key_len, in aead_aes_128_cbc_sha256_tls_init() argument
413 return aead_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), in aead_aes_128_cbc_sha256_tls_init()
418 size_t key_len, size_t tag_len, in aead_aes_256_cbc_sha1_tls_init() argument
[all …]
/external/boringssl/src/crypto/fipsmodule/cipher/
De_aes.c106 ret = aes_hw_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
113 ret = aes_nohw_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
118 ret = vpaes_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
122 ret = aes_nohw_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
132 ret = aes_hw_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
141 ret = aes_nohw_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
146 ret = vpaes_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
158 ret = aes_nohw_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
318 ctx->key_len); in aes_gcm_init_key()
539 out->key_len = 16; in DEFINE_LOCAL_DATA()
[all …]
/external/boringssl/src/crypto/fipsmodule/hmac/
Dhmac.c68 uint8_t *HMAC(const EVP_MD *evp_md, const void *key, size_t key_len, in HMAC() argument
73 if (!HMAC_Init_ex(&ctx, key, key_len, evp_md, NULL) || in HMAC()
114 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, size_t key_len, in HMAC_Init_ex() argument
134 if (block_size < key_len) { in HMAC_Init_ex()
137 !EVP_DigestUpdate(&ctx->md_ctx, key, key_len) || in HMAC_Init_ex()
142 assert(key_len <= sizeof(key_block)); in HMAC_Init_ex()
143 OPENSSL_memcpy(key_block, key, key_len); in HMAC_Init_ex()
144 key_block_len = (unsigned)key_len; in HMAC_Init_ex()
218 int HMAC_Init(HMAC_CTX *ctx, const void *key, int key_len, const EVP_MD *md) { in HMAC_Init() argument
222 return HMAC_Init_ex(ctx, key, key_len, md, NULL); in HMAC_Init()
/external/grpc-grpc/src/php/ext/grpc/
Dphp7_wrapper.h43 #define PHP_GRPC_ADD_STRING_TO_ARRAY(val, key, key_len, str, dup) \ argument
44 add_assoc_string_ex(val, key, key_len , str, dup);
45 #define PHP_GRPC_ADD_LONG_TO_ARRAY(val, key, key_len, str) \ argument
46 add_assoc_long_ex(val, key, key_len, str);
47 #define PHP_GRPC_ADD_BOOL_TO_ARRAY(val, key, key_len, str) \ argument
48 add_assoc_bool_ex(val, key, key_len, str);
49 #define PHP_GRPC_ADD_LONG_TO_RETVAL(val, key, key_len, str) \ argument
50 add_assoc_long_ex(val, key, key_len+1, str);
180 #define PHP_GRPC_ADD_STRING_TO_ARRAY(val, key, key_len, str, dup) \ argument
181 add_assoc_string_ex(val, key, key_len - 1, str);
[all …]
/external/boringssl/src/crypto/evp/
Dpbkdf.c67 const EVP_MD *digest, size_t key_len, uint8_t *out_key) { in PKCS5_PBKDF2_HMAC() argument
79 while (key_len > 0) { in PKCS5_PBKDF2_HMAC()
81 if (todo > key_len) { in PKCS5_PBKDF2_HMAC()
82 todo = key_len; in PKCS5_PBKDF2_HMAC()
113 key_len -= todo; in PKCS5_PBKDF2_HMAC()
142 unsigned iterations, size_t key_len, in PKCS5_PBKDF2_HMAC_SHA1() argument
145 EVP_sha1(), key_len, out_key); in PKCS5_PBKDF2_HMAC_SHA1()
Dp_rsa.c175 const size_t key_len = EVP_PKEY_size(ctx->pkey); in pkey_rsa_sign() local
178 *siglen = key_len; in pkey_rsa_sign()
182 if (*siglen < key_len) { in pkey_rsa_sign()
230 const size_t key_len = EVP_PKEY_size(ctx->pkey); in pkey_rsa_verify() local
232 !RSA_verify_raw(rsa, &rslen, rctx->tbuf, key_len, sig, siglen, in pkey_rsa_verify()
247 const size_t key_len = EVP_PKEY_size(ctx->pkey); in pkey_rsa_verify_recover() local
250 *out_len = key_len; in pkey_rsa_verify_recover()
254 if (*out_len < key_len) { in pkey_rsa_verify_recover()
283 if (!RSA_verify_raw(rsa, &rslen, rctx->tbuf, key_len, sig, sig_len, in pkey_rsa_verify_recover()
311 const size_t key_len = EVP_PKEY_size(ctx->pkey); in pkey_rsa_encrypt() local
[all …]
/external/u-boot/board/freescale/common/
Dfsl_validate.c26 #define CHECK_KEY_LEN(key_len) (((key_len) == 2 * KEY_SIZE_BYTES / 4) || \ argument
27 ((key_len) == 2 * KEY_SIZE_BYTES / 2) || \
28 ((key_len) == 2 * KEY_SIZE_BYTES))
245 if (!CHECK_KEY_LEN(img->srk_tbl[i].key_len)) in read_validate_srk_tbl()
249 img->key_len = img->srk_tbl[key_num - 1].key_len; in read_validate_srk_tbl()
252 img->key_len); in read_validate_srk_tbl()
265 if (!CHECK_KEY_LEN(hdr->key_len)) in read_validate_single_key()
268 memcpy(&img->img_key, esbc + hdr->pkey, hdr->key_len); in read_validate_single_key()
270 img->key_len = hdr->key_len; in read_validate_single_key()
312 ie_key_len = ie_info->ie_key_tbl[ie_num - 1].key_len; in read_validate_ie_tbl()
[all …]

123456789