Home
last modified time | relevance | path

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

12345678910

/freebsd/contrib/wpa/src/crypto/
H A Dcrypto_internal.c35 size_t key_len; member
40 size_t key_len) in crypto_hash_init() argument
81 key_len = 16; in crypto_hash_init()
84 ctx->key_len = key_len; in crypto_hash_init()
88 os_memset(k_pad + key_len, 0, sizeof(k_pad) - key_len); in crypto_hash_init()
100 key_len = 20; in crypto_hash_init()
103 ctx->key_len = key_len; in crypto_hash_init()
107 os_memset(k_pad + key_len, 0, sizeof(k_pad) - key_len); in crypto_hash_init()
120 key_len = 32; in crypto_hash_init()
123 ctx->key_len = key_len; in crypto_hash_init()
[all …]
H A Daes-siv.c64 static int aes_s2v(const u8 *key, size_t key_len, in aes_s2v() argument
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()
146 if (aes_s2v(k1, key_len, num_elem + 1, _addr, _len, v)) in aes_siv_encrypt()
162 int aes_siv_decrypt(const u8 *key, size_t key_len, in aes_siv_decrypt() argument
177 (key_len != 32 && key_len != 48 && key_len != 64)) in aes_siv_decrypt()
180 key_len /= 2; in aes_siv_decrypt()
182 k2 = key + key_len; in aes_siv_decrypt()
[all …]
H A Dcrypto_gnutls.c114 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
139 return hmac_md5_vector(key, key_len, 1, &data, &data_len, mac); in hmac_md5()
154 return hmac_sha1_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha1()
168 int hmac_sha256(const u8 *key, size_t key_len, const u8 *data, in hmac_sha256() argument
187 int hmac_sha384(const u8 *key, size_t key_len, const u8 *data, in hmac_sha384() argument
206 int hmac_sha512(const u8 *key, size_t key_len, const u8 *data, in hmac_sha512() argument
404 size_t key_len) in crypto_cipher_init() argument
423 if (key_len == 24) in crypto_cipher_init()
425 else if (key_len == 32) in crypto_cipher_init()
[all …]
H A 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()
H A 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()
H A 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()
H A 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()
H A 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()
H A Dcrypto_nettle.c117 hmac_md5_set_key(&ctx, key_len, key); in hmac_md5_vector()
129 return hmac_md5_vector(key, key_len, 1, &data, &data_len, mac); in hmac_md5()
142 hmac_sha1_set_key(&ctx, key_len, key); in hmac_sha1_vector()
169 hmac_sha256_set_key(&ctx, key_len, key); in hmac_sha256_vector()
178 int hmac_sha256(const u8 *key, size_t key_len, const u8 *data, in hmac_sha256() argument
198 hmac_sha384_set_key(&ctx, key_len, key); in hmac_sha384_vector()
207 int hmac_sha384(const u8 *key, size_t key_len, const u8 *data, in hmac_sha384() argument
227 hmac_sha512_set_key(&ctx, key_len, key); in hmac_sha512_vector()
236 int hmac_sha512(const u8 *key, size_t key_len, const u8 *data, in hmac_sha512() argument
413 size_t key_len) in crypto_cipher_init() argument
[all …]
H A Dcrypto_wolfssl.c160 size_t key_len, size_t num_elem, in wolfssl_hmac_vector() argument
484 size_t key_len) in crypto_cipher_init() argument
496 wc_Arc4SetKey(&ctx->enc.arc4, key, key_len); in crypto_cipher_init()
503 switch (key_len) { in crypto_cipher_init()
523 if (key_len != DES3_KEYLEN || in crypto_cipher_init()
887 size_t key_len) in crypto_hash_init() argument
1779 word32 key_len = ecdh->ec->key.dp->size; in crypto_ecdh_set_peerkey() local
1781 size_t need_key_len = inc_y ? 2 * key_len : key_len; in crypto_ecdh_set_peerkey()
1785 pubkey = wpabuf_alloc(1 + 2 * key_len); in crypto_ecdh_set_peerkey()
1800 secret = wpabuf_alloc(key_len); in crypto_ecdh_set_peerkey()
[all …]
H A 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,
H A 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()
H A 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()
/freebsd/contrib/libfido2/src/
H A Dhid.c19 *key_len = tag & 0x3; in get_key_len()
20 if (*key_len == 3) { in get_key_len()
21 *key_len = 4; in get_key_len()
32 switch (key_len) { in get_key_val()
63 size_t key_len; in fido_hid_get_usage() local
66 if (get_key_len(tag, &key, &key_len) < 0 || key_len > len || in fido_hid_get_usage()
75 ptr += key_len; in fido_hid_get_usage()
76 len -= key_len; in fido_hid_get_usage()
99 if (get_key_len(tag, &key, &key_len) < 0 || key_len > len || in fido_hid_get_report_len()
112 ptr += key_len; in fido_hid_get_report_len()
[all …]
/freebsd/contrib/ntp/sntp/tests/
H A Dcrypto.c40 md5.key_len = 6; in test_MakeMd5Mac()
41 memcpy(&md5.key_seq, "md5seq", md5.key_len); in test_MakeMd5Mac()
67 sha1.key_len = 7; in test_MakeSHA1Mac()
68 memcpy(&sha1.key_seq, "sha1seq", sha1.key_len); in test_MakeSHA1Mac()
100 cmac.key_len = CMAC_LENGTH; in test_MakeCMac()
130 md5.key_len = 6; in test_VerifyCorrectMD5()
131 memcpy(&md5.key_seq, "md5key", md5.key_len); in test_VerifyCorrectMD5()
154 sha1.key_len = 7; in test_VerifySHA1()
182 cmac.key_len = CMAC_LENGTH; in test_VerifyCMAC()
238 md5.key_len = 6; in test_VerifyFailure()
[all …]
H A DkeyFile.c11 bool CompareKeysAlternative(int key_id,int key_len,const char* type,const char* key_seq,struct key …
30 if (expected.key_len != actual.key_len) { in CompareKeys()
32 expected.key_len, actual.key_len); in CompareKeys()
41 if (memcmp(expected.key_seq, actual.key_seq, expected.key_len) != 0) { in CompareKeys()
52 int key_len, in CompareKeysAlternative() argument
61 temp.key_len = key_len; in CompareKeysAlternative()
63 memcpy(temp.key_seq, key_seq, key_len); in CompareKeysAlternative()
/freebsd/contrib/libarchive/libarchive/
H A Darchive_cryptor.c169 ctx->key_len = key_len; in aes_ctr_init()
170 memcpy(ctx->key, key, key_len); in aes_ctr_init()
216 switch (key_len) { in aes_ctr_init()
307 ctx->key_len = key_len; in aes_ctr_init()
308 memcpy(ctx->key, key, key_len); in aes_ctr_init()
318 ctx->key_len * 8) != 0) in aes_ctr_encrypt_counter()
339 ctx->key_len = key_len; in aes_ctr_init()
354 switch(ctx->key_len) { in aes_ctr_encrypt_counter()
393 switch (key_len) { in aes_ctr_init()
400 ctx->key_len = key_len; in aes_ctr_init()
[all …]
H A Darchive_hmac.c51 __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) in __hmac_sha1_init() argument
53 CCHmacInit(ctx, kCCHmacAlgSHA1, key, key_len); in __hmac_sha1_init()
84 __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) in __hmac_sha1_init() argument
113 (PUCHAR)key, (ULONG)key_len, BCRYPT_HASH_REUSABLE_FLAG); in __hmac_sha1_init()
156 __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) in __hmac_sha1_init() argument
172 ret = mbedtls_md_hmac_starts(ctx, key, key_len); in __hmac_sha1_init()
203 __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) in __hmac_sha1_init() argument
205 hmac_sha1_set_key(ctx, key_len, key); in __hmac_sha1_init()
248 EVP_MAC_init(*ctx, key, key_len, params); in __hmac_sha1_init()
253 HMAC_Init_ex(*ctx, key, key_len, EVP_sha1(), NULL); in __hmac_sha1_init()
[all …]
H A Darchive_cryptor_private.h59 unsigned key_len; member
96 unsigned key_len; member
120 unsigned key_len; member
135 unsigned key_len; member
153 #define archive_decrypto_aes_ctr_init(ctx, key, key_len) \ argument
154 __archive_cryptor.decrypto_aes_ctr_init(ctx, key, key_len)
160 #define archive_encrypto_aes_ctr_init(ctx, key, key_len) \ argument
161 __archive_cryptor.encrypto_aes_ctr_init(ctx, key, key_len)
/freebsd/contrib/wpa/src/wps/
H A 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 …]
/freebsd/lib/libcrypt/
H A Dcrypt-sha256.c68 size_t salt_len, key_len, cnt, rounds; in crypt_sha256() local
96 key_len = strlen(key); in crypt_sha256()
102 SHA256_Update(&ctx, key, key_len); in crypt_sha256()
114 SHA256_Update(&alt_ctx, key, key_len); in crypt_sha256()
120 SHA256_Update(&alt_ctx, key, key_len); in crypt_sha256()
132 for (cnt = key_len; cnt > 0; cnt >>= 1) in crypt_sha256()
136 SHA256_Update(&ctx, key, key_len); in crypt_sha256()
145 for (cnt = 0; cnt < key_len; ++cnt) in crypt_sha256()
146 SHA256_Update(&alt_ctx, key, key_len); in crypt_sha256()
152 cp = p_bytes = alloca(key_len); in crypt_sha256()
[all …]
H A Dcrypt-sha512.c68 size_t salt_len, key_len, cnt, rounds; in crypt_sha512() local
96 key_len = strlen(key); in crypt_sha512()
102 SHA512_Update(&ctx, key, key_len); in crypt_sha512()
114 SHA512_Update(&alt_ctx, key, key_len); in crypt_sha512()
120 SHA512_Update(&alt_ctx, key, key_len); in crypt_sha512()
132 for (cnt = key_len; cnt > 0; cnt >>= 1) in crypt_sha512()
136 SHA512_Update(&ctx, key, key_len); in crypt_sha512()
145 for (cnt = 0; cnt < key_len; ++cnt) in crypt_sha512()
146 SHA512_Update(&alt_ctx, key, key_len); in crypt_sha512()
152 cp = p_bytes = alloca(key_len); in crypt_sha512()
[all …]
/freebsd/contrib/bearssl/src/mac/
H A Dhmac.c39 const void *key, size_t key_len, unsigned bb) in process_key() argument
45 memcpy(tmp, key, key_len); in process_key()
46 for (u = 0; u < key_len; u ++) { in process_key()
49 memset(tmp + key_len, bb, blen - key_len); in process_key()
58 const br_hash_class *dig, const void *key, size_t key_len) in br_hmac_key_init() argument
65 if (key_len > block_size(dig)) { in br_hmac_key_init()
67 dig->update(&hc.vtable, key, key_len); in br_hmac_key_init()
70 key_len = br_digest_size(dig); in br_hmac_key_init()
72 process_key(&hc.vtable, kc->ksi, key, key_len, 0x36); in br_hmac_key_init()
73 process_key(&hc.vtable, kc->kso, key, key_len, 0x5C); in br_hmac_key_init()
/freebsd/crypto/openssl/providers/implementations/kdfs/
H A Dkrb5kdf.c46 const unsigned char *key, size_t key_len,
54 size_t key_len; member
90 OPENSSL_clear_free(ctx->key, ctx->key_len); in krb5kdf_reset()
129 return KRB5KDF(cipher, engine, ctx->key, ctx->key_len, in krb5kdf_derive()
147 if (!krb5kdf_set_membuf(&ctx->key, &ctx->key_len, p)) in krb5kdf_set_ctx_params()
337 if (key_len != (size_t)klen) { in cipher_init()
338 ret = EVP_CIPHER_CTX_set_key_length(ctx, key_len); in cipher_init()
356 const unsigned char *key, size_t key_len, in KRB5KDF() argument
371 if (key_len != okey_len) { in KRB5KDF()
376 key_len == 24 && okey_len == 21) { in KRB5KDF()
[all …]
/freebsd/contrib/tcpdump/
H A Dsignature.c52 unsigned int key_len, uint8_t *digest) in signature_compute_hmac_md5() argument
61 if (key_len > 64) { in signature_compute_hmac_md5()
66 MD5_Update(&tctx, key, key_len); in signature_compute_hmac_md5()
70 key_len = 16; in signature_compute_hmac_md5()
87 memcpy(k_ipad, key, key_len); in signature_compute_hmac_md5()
88 memcpy(k_opad, key, key_len); in signature_compute_hmac_md5()

12345678910