/external/wpa_supplicant_8/src/crypto/ |
D | crypto_internal.c | 35 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 …]
|
D | sha256.c | 26 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()
|
D | sha1.c | 26 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()
|
D | md5.c | 26 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()
|
D | sha256-prf.c | 30 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()
|
D | sha384-prf.c | 29 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()
|
D | sha384.h | 14 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/ |
D | rsa_utility.c | 16 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/ |
D | hmac_md5.c | 49 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/ |
D | hash.c | 44 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/ |
D | rsa_utility_tests.c | 87 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/ |
D | txt.c | 118 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/ |
D | externalhmac.cc | 92 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/ |
D | e_tls.c | 55 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 …]
|
D | e_ssl3.c | 83 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 …]
|
D | aead.c | 25 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/ |
D | pbkdf_test.cc | 36 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()
|
D | p_rsa.c | 169 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/ |
D | hmac.c | 65 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/ |
D | wps_attr_process.c | 169 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/ |
D | hmac.c | 57 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()
|
D | null_auth.c | 56 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/ |
D | signature.c | 50 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/ |
D | fpdf_parser_encrypt.cpp | 90 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/ |
D | ikev2_common.c | 56 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 …]
|