Home
last modified time | relevance | path

Searched refs:key_len (Results 1 – 25 of 184) 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 …]
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()
105 ret = omac1_aes_vector(key, key_len, 1, data, &len[i], mac); in aes_s2v()
116 return omac1_aes_vector(key, key_len, 1, data, data_len, mac); in aes_s2v()
120 int aes_siv_encrypt(const u8 *key, size_t key_len, in aes_siv_encrypt() argument
133 (key_len != 32 && key_len != 48 && key_len != 64)) in aes_siv_encrypt()
136 key_len /= 2; in aes_siv_encrypt()
138 k2 = key + key_len; in aes_siv_encrypt()
[all …]
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()
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()
Daes_wrap.h25 int __must_check omac1_aes_vector(const u8 *key, size_t key_len,
36 int __must_check aes_ctr_encrypt(const u8 *key, size_t key_len, const u8 *nonce,
52 int __must_check aes_gcm_ae(const u8 *key, size_t key_len,
57 int __must_check aes_gcm_ad(const u8 *key, size_t key_len,
62 int __must_check aes_gmac(const u8 *key, size_t key_len,
65 int __must_check aes_ccm_ae(const u8 *key, size_t key_len, const u8 *nonce,
68 int __must_check aes_ccm_ad(const u8 *key, size_t key_len, const u8 *nonce,
/external/syslinux/gpxe/src/crypto/
Dhmac.c41 void *key, size_t *key_len ) { in hmac_reduce_key() argument
45 digest_update ( digest, digest_ctx, key, *key_len ); in hmac_reduce_key()
47 *key_len = digest->digestsize; in hmac_reduce_key()
64 void *key, size_t *key_len ) { in hmac_init() argument
69 if ( *key_len > sizeof ( k_ipad ) ) in hmac_init()
70 hmac_reduce_key ( digest, key, key_len ); in hmac_init()
74 memcpy ( k_ipad, key, *key_len ); in hmac_init()
99 void *key, size_t *key_len, void *hmac ) { in hmac_final() argument
104 if ( *key_len > sizeof ( k_opad ) ) in hmac_final()
105 hmac_reduce_key ( digest, key, key_len ); in hmac_final()
[all …]
Dsha1extra.c42 void prf_sha1 ( const void *key, size_t key_len, const char *label, in prf_sha1() argument
46 u8 keym[key_len]; /* modifiable copy of key */ in prf_sha1()
57 memcpy ( keym, key, key_len ); in prf_sha1()
66 hmac_init ( &sha1_algorithm, sha1_ctx, keym, &key_len ); in prf_sha1()
68 hmac_final ( &sha1_algorithm, sha1_ctx, keym, &key_len, out ); in prf_sha1()
147 int iterations, void *key, size_t key_len ) in pbkdf2_sha1() argument
149 u32 blocks = ( key_len + SHA1_SIZE - 1 ) / SHA1_SIZE; in pbkdf2_sha1()
156 if ( key_len <= SHA1_SIZE ) { in pbkdf2_sha1()
157 memcpy ( key, buf, key_len ); in pbkdf2_sha1()
162 key_len -= SHA1_SIZE; in pbkdf2_sha1()
/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/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.c47 e->key_len = 0; in hash_element_dtor()
101 mk_hash_element(const void *key, size_t key_len, const void *p) in mk_hash_element() argument
106 void *dupkey = malloc(key_len); in mk_hash_element()
109 memcpy(dupkey, key, key_len); in mk_hash_element()
112 he->key_len = key_len; in mk_hash_element()
134 Curl_hash_add(struct curl_hash *h, void *key, size_t key_len, void *p) in Curl_hash_add() argument
138 struct curl_llist *l = FETCH_LIST (h, key, key_len); in Curl_hash_add()
142 if(h->comp_func(he->key, he->key_len, key, key_len)) { in Curl_hash_add()
149 he = mk_hash_element(key, key_len, p); in Curl_hash_add()
173 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.cpp103 bool CPDF_SecurityHandler::CheckSecurity(int32_t key_len) { in CheckSecurity() argument
107 m_EncryptKey, key_len)) { in CheckSecurity()
112 m_EncryptKey, key_len); in CheckSecurity()
184 int& key_len) { in LoadDict() argument
198 if (!LoadCryptInfo(pEncryptDict, strf_name, cipher, key_len)) in LoadDict()
202 m_KeyLen = key_len; in LoadDict()
400 int32_t key_len) { in CheckPassword() argument
409 return CheckOwnerPassword(password, size, key, key_len); in CheckPassword()
411 return CheckUserPassword(password, size, false, key, key_len) || in CheckPassword()
412 CheckUserPassword(password, size, true, key, key_len); in CheckPassword()
[all …]
Dcpdf_security_handler.h52 int32_t key_len);
57 int key_len);
64 int& key_len);
70 int32_t key_len);
75 int32_t key_len);
97 bool CheckSecurity(int32_t key_len);
/external/boringssl/src/crypto/cipher_extra/
De_tls.c56 static int aead_tls_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, in aead_tls_init() argument
66 if (key_len != EVP_AEAD_key_length(ctx->aead)) { in aead_tls_init()
74 (implicit_iv ? EVP_CIPHER_iv_length(cipher) : 0) == key_len); in aead_tls_init()
370 size_t key_len, size_t tag_len, in aead_aes_128_cbc_sha1_tls_init() argument
372 return aead_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), in aead_aes_128_cbc_sha1_tls_init()
377 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
379 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()
384 const uint8_t *key, size_t key_len, in aead_aes_128_cbc_sha256_tls_init() argument
387 return aead_tls_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), in aead_aes_128_cbc_sha256_tls_init()
392 size_t key_len, size_t tag_len, in aead_aes_256_cbc_sha1_tls_init() argument
[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()
97 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, size_t key_len, in HMAC_Init_ex() argument
117 if (block_size < key_len) { in HMAC_Init_ex()
120 !EVP_DigestUpdate(&ctx->md_ctx, key, key_len) || in HMAC_Init_ex()
125 assert(key_len <= sizeof(key_block)); in HMAC_Init_ex()
126 OPENSSL_memcpy(key_block, key, key_len); in HMAC_Init_ex()
127 key_block_len = (unsigned)key_len; in HMAC_Init_ex()
196 int HMAC_Init(HMAC_CTX *ctx, const void *key, int key_len, const EVP_MD *md) { in HMAC_Init() argument
200 return HMAC_Init_ex(ctx, key, key_len, md, NULL); in HMAC_Init()
/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.c170 const size_t key_len = EVP_PKEY_size(ctx->pkey); in pkey_rsa_sign() local
173 *siglen = key_len; in pkey_rsa_sign()
177 if (*siglen < key_len) { in pkey_rsa_sign()
225 const size_t key_len = EVP_PKEY_size(ctx->pkey); in pkey_rsa_verify() local
227 !RSA_verify_raw(rsa, &rslen, rctx->tbuf, key_len, sig, siglen, in pkey_rsa_verify()
242 const size_t key_len = EVP_PKEY_size(ctx->pkey); in pkey_rsa_verify_recover() local
245 *out_len = key_len; in pkey_rsa_verify_recover()
249 if (*out_len < key_len) { in pkey_rsa_verify_recover()
278 if (!RSA_verify_raw(rsa, &rslen, rctx->tbuf, key_len, sig, sig_len, in pkey_rsa_verify_recover()
306 const size_t key_len = EVP_PKEY_size(ctx->pkey); in pkey_rsa_encrypt() local
[all …]
/external/boringssl/src/crypto/fipsmodule/cipher/
De_aes.c231 ret = aes_hw_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
238 ret = AES_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
242 ret = vpaes_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
247 ret = AES_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
253 ret = aes_hw_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
262 ret = AES_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
266 ret = vpaes_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
271 ret = AES_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); in aes_init_key()
406 aes_ctr_set_key(&gctx->ks.ks, &gctx->gcm, NULL, key, ctx->key_len); in aes_gcm_init_key()
627 out->key_len = 16; in DEFINE_LOCAL_DATA()
[all …]
/external/syslinux/com32/libutil/
Dsha256crypt.c301 size_t key_len; in sha256_crypt_r() local
331 key_len = strlen(key); in sha256_crypt_r()
334 char *tmp = (char *)alloca(key_len + __alignof__(uint32_t)); in sha256_crypt_r()
337 key, key_len); in sha256_crypt_r()
351 sha256_process_bytes(key, key_len, &ctx); in sha256_crypt_r()
363 sha256_process_bytes(key, key_len, &alt_ctx); in sha256_crypt_r()
369 sha256_process_bytes(key, key_len, &alt_ctx); in sha256_crypt_r()
376 for (cnt = key_len; cnt > 32; cnt -= 32) in sha256_crypt_r()
382 for (cnt = key_len; cnt; cnt >>= 1) in sha256_crypt_r()
386 sha256_process_bytes(key, key_len, &ctx); in sha256_crypt_r()
[all …]
Dsha512crypt.c336 size_t key_len; in sha512_crypt_r() local
366 key_len = strlen(key); in sha512_crypt_r()
369 char *tmp = (char *)alloca(key_len + __alignof__(uint64_t)); in sha512_crypt_r()
372 key, key_len); in sha512_crypt_r()
386 sha512_process_bytes(key, key_len, &ctx); in sha512_crypt_r()
398 sha512_process_bytes(key, key_len, &alt_ctx); in sha512_crypt_r()
404 sha512_process_bytes(key, key_len, &alt_ctx); in sha512_crypt_r()
411 for (cnt = key_len; cnt > 64; cnt -= 64) in sha512_crypt_r()
417 for (cnt = key_len; cnt > 0; cnt >>= 1) in sha512_crypt_r()
421 sha512_process_bytes(key, key_len, &ctx); in sha512_crypt_r()
[all …]
/external/tcpdump/
Dsignature.c51 unsigned int key_len, uint8_t *digest) in signature_compute_hmac_md5() argument
60 if (key_len > 64) { in signature_compute_hmac_md5()
65 MD5_Update(&tctx, key, key_len); in signature_compute_hmac_md5()
69 key_len = 16; in signature_compute_hmac_md5()
86 memcpy(k_ipad, key, key_len); in signature_compute_hmac_md5()
87 memcpy(k_opad, key, key_len); in signature_compute_hmac_md5()

12345678