Home
last modified time | relevance | path

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

12345

/hostap-latest/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 …]
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 …]
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()
104 int hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len, in hmac_sha1() argument
107 return hmac_sha1_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha1()
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()
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()
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.c26 int hmac_sha256_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_sha256_vector() argument
44 if (key_len > 64) { in hmac_sha256_vector()
45 if (sha256_vector(1, &key, &key_len, tk) < 0) in hmac_sha256_vector()
48 key_len = 32; in hmac_sha256_vector()
62 os_memcpy(k_pad, key, key_len); in hmac_sha256_vector()
79 os_memcpy(k_pad, key, key_len); in hmac_sha256_vector()
109 int hmac_sha256(const u8 *key, size_t key_len, const u8 *data, in hmac_sha256() argument
112 return hmac_sha256_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha256()
Dcrypto_linux.c58 size_t key_len, size_t num_elem, in linux_af_alg_hash_vector() argument
71 if (key && setsockopt(s, SOL_ALG, ALG_SET_KEY, key, key_len) < 0) { in linux_af_alg_hash_vector()
171 int hmac_md5_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_md5_vector() argument
174 return linux_af_alg_hash_vector("hmac(md5)", key, key_len, num_elem, in hmac_md5_vector()
179 int hmac_md5(const u8 *key, size_t key_len, const u8 *data, size_t data_len, in hmac_md5() argument
182 return hmac_md5_vector(key, key_len, 1, &data, &data_len, mac); in hmac_md5()
186 int hmac_sha1_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_sha1_vector() argument
189 return linux_af_alg_hash_vector("hmac(sha1)", key, key_len, num_elem, in hmac_sha1_vector()
194 int hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len, in hmac_sha1() argument
197 return hmac_sha1_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha1()
[all …]
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,
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.c30 int sha384_prf(const u8 *key, size_t key_len, const char *label, in sha384_prf() argument
33 return sha384_prf_bits(key, key_len, label, data, data_len, buf, in sha384_prf()
54 int sha384_prf_bits(const u8 *key, size_t key_len, const char *label, in sha384_prf_bits() argument
81 if (hmac_sha384_vector(key, key_len, 4, addr, len, in sha384_prf_bits()
86 if (hmac_sha384_vector(key, key_len, 4, addr, len, in sha384_prf_bits()
Dsha512-prf.c30 int sha512_prf(const u8 *key, size_t key_len, const char *label, in sha512_prf() argument
33 return sha512_prf_bits(key, key_len, label, data, data_len, buf, in sha512_prf()
54 int sha512_prf_bits(const u8 *key, size_t key_len, const char *label, in sha512_prf_bits() argument
81 if (hmac_sha512_vector(key, key_len, 4, addr, len, in sha512_prf_bits()
86 if (hmac_sha512_vector(key, key_len, 4, addr, len, in sha512_prf_bits()
Dcrypto_mbedtls_alt.c308 struct crypto_hash *crypto_hash_init(enum crypto_hash_alg alg, const u8 *key, size_t key_len) in crypto_hash_init() argument
355 mbedtls_md_hmac_starts(&ctx->ctx, key, key_len); in crypto_hash_init()
390 size_t key_len, in hmac_vector() argument
398 return hmac_vector_psa(key, key_len, num_elem, addr, len, mac, md_type); in hmac_vector()
410 mbedtls_md_hmac_starts(&ctx, key, key_len); in hmac_vector()
419 int hmac_sha512_vector(const u8 *key, size_t key_len, size_t num_elem, const u8 *addr[], const size… in hmac_sha512_vector() argument
421 return hmac_vector(key, key_len, num_elem, addr, len, mac, MBEDTLS_MD_SHA512); in hmac_sha512_vector()
424 int hmac_sha512(const u8 *key, size_t key_len, const u8 *data, size_t data_len, u8 *mac) in hmac_sha512() argument
426 return hmac_vector(key, key_len, 1, &data, &data_len, mac, MBEDTLS_MD_SHA512); in hmac_sha512()
429 int hmac_sha384_vector(const u8 *key, size_t key_len, size_t num_elem, const u8 *addr[], const size… in hmac_sha384_vector() argument
[all …]
Dsha512.h14 int hmac_sha512_vector(const u8 *key, size_t key_len, size_t num_elem,
16 int hmac_sha512(const u8 *key, size_t key_len, const u8 *data,
18 int sha512_prf(const u8 *key, size_t key_len, const char *label,
20 int sha512_prf_bits(const u8 *key, size_t key_len, const char *label,
Dcrypto_internal-cipher.c45 size_t key_len) in crypto_cipher_init() argument
57 if (key_len > sizeof(ctx->u.rc4.key)) { in crypto_cipher_init()
61 ctx->u.rc4.keylen = key_len; in crypto_cipher_init()
62 os_memcpy(ctx->u.rc4.key, key, key_len); in crypto_cipher_init()
65 ctx->u.aes.ctx_enc = aes_encrypt_init(key, key_len); in crypto_cipher_init()
70 ctx->u.aes.ctx_dec = aes_decrypt_init(key, key_len); in crypto_cipher_init()
79 if (key_len != 24) { in crypto_cipher_init()
87 if (key_len != 8) { in crypto_cipher_init()
Dsha1.h14 int hmac_sha1_vector(const u8 *key, size_t key_len, size_t num_elem,
16 int hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len,
18 int sha1_prf(const u8 *key, size_t key_len, const char *label,
20 int sha1_t_prf(const u8 *key, size_t key_len, const char *label,
Dsha256.h14 int hmac_sha256_vector(const u8 *key, size_t key_len, size_t num_elem,
16 int hmac_sha256(const u8 *key, size_t key_len, const u8 *data,
18 int sha256_prf(const u8 *key, size_t key_len, const char *label,
20 int sha256_prf_bits(const u8 *key, size_t key_len, const char *label,
/hostap-latest/src/wps/
Dwps_attr_process.c170 const u8 *key, size_t key_len) in wps_process_cred_network_key() argument
185 wpa_hexdump_key(MSG_DEBUG, "WPS: Network Key", key, key_len); in wps_process_cred_network_key()
186 if (key_len <= sizeof(cred->key)) { in wps_process_cred_network_key()
187 os_memcpy(cred->key, key, key_len); in wps_process_cred_network_key()
188 cred->key_len = key_len; in wps_process_cred_network_key()
214 cred->key_len > 8 && cred->key_len < 64 && in wps_workaround_cred_key()
215 cred->key[cred->key_len - 1] == 0) { in wps_workaround_cred_key()
220 cred->key, cred->key_len); in wps_workaround_cred_key()
230 cred->key_len--; in wps_workaround_cred_key()
236 (cred->key_len < 8 || has_ctrl_char(cred->key, cred->key_len))) { in wps_workaround_cred_key()
[all …]
/hostap-latest/tests/
Dtest-rc4.c16 size_t key_len; member
204 static int run_test(unsigned int i, const u8 *key, size_t key_len, in run_test() argument
209 if (rc4_skip(key, key_len, offset, res, sizeof(res)) < 0 || in run_test()
226 ret += run_test(i, test->key, test->key_len, in main()
228 ret += run_test(i, test->key, test->key_len, in main()
230 ret += run_test(i, test->key, test->key_len, in main()
232 ret += run_test(i, test->key, test->key_len, in main()
234 ret += run_test(i, test->key, test->key_len, in main()
236 ret += run_test(i, test->key, test->key_len, in main()
238 ret += run_test(i, test->key, test->key_len, in main()
[all …]
/hostap-latest/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 …]
Dikev2_common.h254 size_t key_len; member
260 size_t key_len; member
266 size_t key_len; member
271 int ikev2_integ_hash(int alg, const u8 *key, size_t key_len, const u8 *data,
274 int ikev2_prf_hash(int alg, const u8 *key, size_t key_len,
277 int ikev2_prf_plus(int alg, const u8 *key, size_t key_len,
281 int ikev2_encr_encrypt(int alg, const u8 *key, size_t key_len, const u8 *iv,
283 int ikev2_encr_decrypt(int alg, const u8 *key, size_t key_len, const u8 *iv,
/hostap-latest/src/eap_server/
Deap_server_vendor_test.c144 const int key_len = 64; in eap_vendor_test_getKey() local
149 key = os_malloc(key_len); in eap_vendor_test_getKey()
153 os_memset(key, 0x11, key_len / 2); in eap_vendor_test_getKey()
154 os_memset(key + key_len / 2, 0x22, key_len / 2); in eap_vendor_test_getKey()
155 *len = key_len; in eap_vendor_test_getKey()
/hostap-latest/src/eap_peer/
Deap_vendor_test.c152 const int key_len = 64; in eap_vendor_test_getKey() local
157 key = os_malloc(key_len); in eap_vendor_test_getKey()
161 os_memset(key, 0x11, key_len / 2); in eap_vendor_test_getKey()
162 os_memset(key + key_len / 2, 0x22, key_len / 2); in eap_vendor_test_getKey()
163 *len = key_len; in eap_vendor_test_getKey()

12345