Home
last modified time | relevance | path

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

12345678

/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 …]
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()
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()
Dsha256-prf.c30 int sha256_prf(const u8 *key, size_t key_len, const char *label, in sha256_prf() argument
33 return sha256_prf_bits(key, key_len, label, data, data_len, buf, in sha256_prf()
54 int sha256_prf_bits(const u8 *key, size_t key_len, const char *label, in sha256_prf_bits() argument
81 if (hmac_sha256_vector(key, key_len, 4, addr, len, in sha256_prf_bits()
86 if (hmac_sha256_vector(key, key_len, 4, addr, len, in sha256_prf_bits()
Dsha384-prf.c29 void sha384_prf(const u8 *key, size_t key_len, const char *label, in sha384_prf() argument
32 sha384_prf_bits(key, key_len, label, data, data_len, buf, buf_len * 8); in sha384_prf()
51 void sha384_prf_bits(const u8 *key, size_t key_len, const char *label, in sha384_prf_bits() argument
78 hmac_sha384_vector(key, key_len, 4, addr, len, in sha384_prf_bits()
82 hmac_sha384_vector(key, key_len, 4, addr, len, hash); in sha384_prf_bits()
Dsha384.h14 int hmac_sha384_vector(const u8 *key, size_t key_len, size_t num_elem,
16 int hmac_sha384(const u8 *key, size_t key_len, const u8 *data,
18 void sha384_prf(const u8 *key, size_t key_len, const char *label,
20 void sha384_prf_bits(const u8 *key, size_t key_len, const char *label,
/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/dhcpcd-6.8.2/crypt/
Dhmac_md5.c49 const uint8_t *key, size_t key_len, in hmac_md5() argument
58 if (key_len > HMAC_PAD_LEN) { in hmac_md5()
60 MD5Update(&context, key, (unsigned int)key_len); in hmac_md5()
63 key_len = MD5_DIGEST_LENGTH; in hmac_md5()
67 memcpy(k_ipad, key, key_len); in hmac_md5()
68 memcpy(k_opad, key, key_len); in hmac_md5()
69 memset(k_ipad + key_len, 0, sizeof(k_ipad) - key_len); in hmac_md5()
70 memset(k_opad + key_len, 0, sizeof(k_opad) - key_len); in hmac_md5()
/external/curl/lib/
Dhash.c44 e->key_len = 0; in hash_element_dtor()
93 mk_hash_element(const void *key, size_t key_len, const void *p) in mk_hash_element() argument
98 void *dupkey = malloc(key_len); in mk_hash_element()
101 memcpy(dupkey, key, key_len); in mk_hash_element()
104 he->key_len = key_len; in mk_hash_element()
124 Curl_hash_add(struct curl_hash *h, void *key, size_t key_len, void *p) in Curl_hash_add() argument
128 struct curl_llist *l = FETCH_LIST (h, key, key_len); in Curl_hash_add()
132 if(h->comp_func(he->key, he->key_len, key, key_len)) { in Curl_hash_add()
139 he = mk_hash_element(key, key_len, p); in Curl_hash_add()
159 int Curl_hash_delete(struct curl_hash *h, void *key, size_t key_len) in Curl_hash_delete() argument
[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/avahi/avahi-compat-libdns_sd/
Dtxt.c118 size_t key_len; in remove_key() local
121 key_len = strlen(key); in remove_key()
122 assert(key_len <= 0xFF); in remove_key()
133 if (key_len > t->size - i - 1) in remove_key()
136 if (key_len <= *p && in remove_key()
137 strncmp(key, (char*) p+1, key_len) == 0 && in remove_key()
138 (key_len == *p || p[1+key_len] == '=')) { in remove_key()
263 size_t key_len; in find_key() local
265 key_len = strlen(key); in find_key()
267 assert(key_len <= 0xFF); in find_key()
[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/boringssl/src/crypto/cipher/
De_tls.c55 static int aead_tls_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, in aead_tls_init() argument
65 if (key_len != EVP_AEAD_key_length(ctx->aead)) { in aead_tls_init()
73 (implicit_iv ? EVP_CIPHER_iv_length(cipher) : 0) == key_len); in aead_tls_init()
354 size_t key_len, size_t tag_len, in aead_rc4_md5_tls_init() argument
356 return aead_tls_init(ctx, key, key_len, tag_len, dir, EVP_rc4(), EVP_md5(), in aead_rc4_md5_tls_init()
361 size_t key_len, size_t tag_len, in aead_rc4_sha1_tls_init() argument
363 return aead_tls_init(ctx, key, key_len, tag_len, dir, EVP_rc4(), EVP_sha1(), in aead_rc4_sha1_tls_init()
368 size_t key_len, size_t tag_len, in aead_aes_128_cbc_sha1_tls_init() argument
370 return aead_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), in aead_aes_128_cbc_sha1_tls_init()
375 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
[all …]
De_ssl3.c83 static int aead_ssl3_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, in aead_ssl3_init() argument
92 if (key_len != EVP_AEAD_key_length(ctx->aead)) { in aead_ssl3_init()
99 assert(mac_key_len + enc_key_len + EVP_CIPHER_iv_length(cipher) == key_len); in aead_ssl3_init()
324 size_t key_len, size_t tag_len, in aead_rc4_md5_ssl3_init() argument
326 return aead_ssl3_init(ctx, key, key_len, tag_len, dir, EVP_rc4(), EVP_md5()); in aead_rc4_md5_ssl3_init()
330 size_t key_len, size_t tag_len, in aead_rc4_sha1_ssl3_init() argument
332 return aead_ssl3_init(ctx, key, key_len, tag_len, dir, EVP_rc4(), EVP_sha1()); in aead_rc4_sha1_ssl3_init()
336 size_t key_len, size_t tag_len, in aead_aes_128_cbc_sha1_ssl3_init() argument
338 return aead_ssl3_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), in aead_aes_128_cbc_sha1_ssl3_init()
343 size_t key_len, size_t tag_len, in aead_aes_256_cbc_sha1_ssl3_init() argument
[all …]
Daead.c25 size_t EVP_AEAD_key_length(const EVP_AEAD *aead) { return aead->key_len; } in EVP_AEAD_key_length()
38 const uint8_t *key, size_t key_len, size_t tag_len, in EVP_AEAD_CTX_init() argument
45 return EVP_AEAD_CTX_init_with_direction(ctx, aead, key, key_len, tag_len, in EVP_AEAD_CTX_init()
50 const uint8_t *key, size_t key_len, in EVP_AEAD_CTX_init_with_direction() argument
53 if (key_len != aead->key_len) { in EVP_AEAD_CTX_init_with_direction()
63 ok = aead->init(ctx, key, key_len, tag_len); in EVP_AEAD_CTX_init_with_direction()
65 ok = aead->init_with_direction(ctx, key, key_len, tag_len, dir); in EVP_AEAD_CTX_init_with_direction()
/external/boringssl/src/crypto/evp/
Dpbkdf_test.cc36 const EVP_MD *digest, size_t key_len, in TestPBKDF2() argument
40 if (key_len > sizeof(key)) { in TestPBKDF2()
47 key_len, key)) { in TestPBKDF2()
53 if (memcmp(key, expected_key, key_len) != 0) { in TestPBKDF2()
56 PrintDataHex(expected_key, key_len); in TestPBKDF2()
58 PrintDataHex(key, key_len); in TestPBKDF2()
165 const size_t key_len = sizeof(key); in TestZeroIterations() local
169 1 /* iterations */, digest, key_len, key)) { in TestZeroIterations()
180 0 /* iterations */, digest, key_len, key)) { in TestZeroIterations()
Dp_rsa.c169 const size_t key_len = EVP_PKEY_size(ctx->pkey); in pkey_rsa_sign() local
172 *siglen = key_len; in pkey_rsa_sign()
176 if (*siglen < key_len) { in pkey_rsa_sign()
206 !RSA_sign_raw(rsa, siglen, sig, *siglen, rctx->tbuf, key_len, in pkey_rsa_sign()
226 const size_t key_len = EVP_PKEY_size(ctx->pkey); in pkey_rsa_verify() local
235 !RSA_verify_raw(rsa, &rslen, rctx->tbuf, key_len, sig, siglen, in pkey_rsa_verify()
249 !RSA_verify_raw(rsa, &rslen, rctx->tbuf, key_len, sig, siglen, in pkey_rsa_verify()
263 const size_t key_len = EVP_PKEY_size(ctx->pkey); in pkey_rsa_encrypt() local
266 *outlen = key_len; in pkey_rsa_encrypt()
270 if (*outlen < key_len) { in pkey_rsa_encrypt()
[all …]
/external/boringssl/src/crypto/hmac/
Dhmac.c65 uint8_t *HMAC(const EVP_MD *evp_md, const void *key, size_t key_len, in HMAC() argument
79 if (!HMAC_Init_ex(&ctx, key, key_len, evp_md, NULL) || in HMAC()
103 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, size_t key_len, in HMAC_Init_ex() argument
124 if (block_size < key_len) { in HMAC_Init_ex()
127 !EVP_DigestUpdate(&ctx->md_ctx, key, key_len) || in HMAC_Init_ex()
132 assert(key_len <= sizeof(key_block)); in HMAC_Init_ex()
133 memcpy(key_block, key, key_len); in HMAC_Init_ex()
134 key_block_len = (unsigned)key_len; in HMAC_Init_ex()
203 int HMAC_Init(HMAC_CTX *ctx, const void *key, int key_len, const EVP_MD *md) { in HMAC_Init() argument
207 return HMAC_Init_ex(ctx, key, key_len, md, NULL); in HMAC_Init()
/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()
/external/srtp/crypto/hash/
Dhmac.c57 hmac_alloc(auth_t **a, int key_len, int out_len) { in hmac_alloc() argument
61 debug_print(mod_hmac, "allocating auth func with key length %d", key_len); in hmac_alloc()
68 if (key_len > 20) in hmac_alloc()
85 (*a)->key_len = key_len; in hmac_alloc()
112 hmac_init(hmac_ctx_t *state, const uint8_t *key, int key_len) { in hmac_init() argument
120 if (key_len > 20) in hmac_init()
127 for (i=0; i < key_len; i++) { in hmac_init()
Dnull_auth.c56 null_auth_alloc(auth_t **a, int key_len, int out_len) { in null_auth_alloc() argument
60 debug_print(mod_auth, "allocating auth func with key length %d", key_len); in null_auth_alloc()
74 (*a)->key_len = key_len; in null_auth_alloc()
100 null_auth_init(null_auth_ctx_t *state, const uint8_t *key, int key_len) { in null_auth_init() argument
/external/tcpdump/
Dsignature.c50 unsigned int key_len, uint8_t *digest) in signature_compute_hmac_md5() argument
59 if (key_len > 64) { in signature_compute_hmac_md5()
64 MD5_Update(&tctx, key, key_len); in signature_compute_hmac_md5()
68 key_len = 16; in signature_compute_hmac_md5()
85 memcpy(k_ipad, key, key_len); in signature_compute_hmac_md5()
86 memcpy(k_opad, key, key_len); in signature_compute_hmac_md5()
/external/pdfium/core/src/fpdfapi/fpdf_parser/
Dfpdf_parser_encrypt.cpp90 FX_BOOL CPDF_StandardSecurityHandler::CheckSecurity(int32_t key_len) { in CheckSecurity() argument
93 key_len)) { in CheckSecurity()
96 key_len)) { in CheckSecurity()
104 key_len); in CheckSecurity()
176 int& key_len) { in LoadDict() argument
190 if (!_LoadCryptInfo(pEncryptDict, strf_name, cipher, key_len)) { in LoadDict()
194 m_KeyLen = key_len; in LoadDict()
397 int32_t key_len) { in CheckPassword() argument
406 return CheckOwnerPassword(password, size, key, key_len); in CheckPassword()
408 return CheckUserPassword(password, size, FALSE, key, key_len) || in CheckPassword()
[all …]
/external/wpa_supplicant_8/src/eap_common/
Dikev2_common.c56 int ikev2_integ_hash(int alg, const u8 *key, size_t key_len, const u8 *data, in ikev2_integ_hash() argument
63 if (key_len != 20) in ikev2_integ_hash()
65 if (hmac_sha1(key, key_len, data, data_len, tmphash) < 0) in ikev2_integ_hash()
70 if (key_len != 16) in ikev2_integ_hash()
72 if (hmac_md5(key, key_len, data, data_len, tmphash) < 0) in ikev2_integ_hash()
97 int ikev2_prf_hash(int alg, const u8 *key, size_t key_len, in ikev2_prf_hash() argument
103 return hmac_sha1_vector(key, key_len, num_elem, addr, len, in ikev2_prf_hash()
106 return hmac_md5_vector(key, key_len, num_elem, addr, len, hash); in ikev2_prf_hash()
113 int ikev2_prf_plus(int alg, const u8 *key, size_t key_len, in ikev2_prf_plus() argument
143 res = ikev2_prf_hash(alg, key, key_len, 2, &addr[1], in ikev2_prf_plus()
[all …]

12345678