Home
last modified time | relevance | path

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

12345678

/netbsd-src/external/bsd/libfido2/dist/src/
H A Dhid.c11 get_key_len(uint8_t tag, uint8_t *key, size_t *key_len) in get_key_len() argument
19 *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()
28 get_key_val(const void *body, size_t key_len, uint32_t *val) in get_key_val() argument
32 switch (key_len) { in get_key_val()
43 fido_log_debug("%s: key_len=%zu", __func__, 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()
67 get_key_val(ptr, key_len, &key_val) < 0) { in fido_hid_get_usage()
[all …]
/netbsd-src/external/bsd/wpa/dist/src/crypto/
H A 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 …]
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 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()
H A 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()
H A 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,
/netbsd-src/sys/netinet/
H A Dsctp_hashdriver.c69 void sctp_hash_digest(char *key, int key_len, char *text, int text_len, in sctp_hash_digest() argument
84 if (key_len > 64) { in sctp_hash_digest()
88 MD5Update(&tctx, key, key_len); in sctp_hash_digest()
91 key_len = 16; in sctp_hash_digest()
95 SHA1Update(&tctx, key, key_len); in sctp_hash_digest()
98 key_len = 20; in sctp_hash_digest()
116 bcopy(key, k_ipad, key_len); in sctp_hash_digest()
117 bcopy(key, k_opad, key_len); in sctp_hash_digest()
155 void sctp_hash_digest_m(char *key, int key_len, struct mbuf *m, int offset, in sctp_hash_digest_m() argument
171 if (key_len > 64) { in sctp_hash_digest_m()
[all …]
/netbsd-src/external/ibm-public/postfix/dist/src/util/
H A Dbinhash.c177 BINHASH_INFO **_h = table->data + binhash_hash(elm->key, elm->key_len, table->size);\
236 BINHASH_INFO *binhash_enter(BINHASH *table, const void *key, ssize_t key_len, void *value) in binhash_enter() argument
243 ht->key = mymemdup(key, key_len); in binhash_enter()
244 ht->key_len = key_len; in binhash_enter()
252 void *binhash_find(BINHASH *table, const void *key, ssize_t key_len) in binhash_find() argument
259 for (ht = table->data[binhash_hash(key, key_len, table->size)]; ht; ht = ht->next) in binhash_find()
260 if (key_len == ht->key_len && KEY_EQ(key, ht->key, key_len)) in binhash_find()
267 BINHASH_INFO *binhash_locate(BINHASH *table, const void *key, ssize_t key_len) in binhash_locate() argument
272 for (ht = table->data[binhash_hash(key, key_len, table->size)]; ht; ht = ht->next) in binhash_locate()
273 if (key_len == ht->key_len && KEY_EQ(key, ht->key, key_len)) in binhash_locate()
[all …]
/netbsd-src/external/mpl/bind/dist/lib/dns/rdata/generic/
H A Dhip_55.c28 isc_buffer_t key_len; in fromtext_hip() local
57 key_len = *target; in fromtext_hip()
92 RETERR(uint16_tobuffer((uint32_t)len, &key_len)); in fromtext_hip()
125 unsigned int length, key_len, hit_len; in totext_hip() local
140 key_len = uint16_fromregion(&region); in totext_hip()
166 INSIST(key_len <= region.length); in totext_hip()
168 region.length = key_len; in totext_hip()
170 region.length = length - key_len; in totext_hip()
199 uint16_t key_len; in fromwire_hip() local
218 key_len in fromwire_hip()
478 uint16_t key_len; casecompare_hip() local
[all...]
/netbsd-src/external/mpl/dhcp/bind/dist/lib/dns/rdata/generic/
H A Dhip_55.c29 isc_buffer_t key_len; in fromtext_hip() local
58 key_len = *target; in fromtext_hip()
93 RETERR(uint16_tobuffer((uint32_t)len, &key_len)); in fromtext_hip()
126 unsigned int length, key_len, hit_len; in totext_hip() local
141 key_len = uint16_fromregion(&region); in totext_hip()
167 INSIST(key_len <= region.length); in totext_hip()
169 region.length = key_len; in totext_hip()
171 region.length = length - key_len; in totext_hip()
200 uint16_t key_len; in fromwire_hip() local
219 key_len = uint16_fromregion(&region); in fromwire_hip()
[all …]
/netbsd-src/lib/libresolv/
H A Dhmac_link.c272 int len, key_len; in dst_hmac_md5_key_to_file_format() local
296 for (key_len = 0; key_len < HMAC_LEN; key_len++) in dst_hmac_md5_key_to_file_format()
297 key[key_len] = hkey->hk_ipad[key_len] ^ HMAC_IPAD; in dst_hmac_md5_key_to_file_format()
298 for (key_len = HMAC_LEN - 1; key_len >= 0; key_len--) in dst_hmac_md5_key_to_file_format()
299 if (key[key_len] != 0) in dst_hmac_md5_key_to_file_format()
301 key_len++; in dst_hmac_md5_key_to_file_format()
303 len = b64_ntop(key, key_len, bp, BUF_LEFT); in dst_hmac_md5_key_to_file_format()
340 int key_len, len; in dst_hmac_md5_key_from_file_format() local
361 key_len = b64_pton((char *)tmp, key, HMAC_LEN+1); /*%< see above */ in dst_hmac_md5_key_from_file_format()
364 if (dst_buffer_to_hmac_md5(dkey, key, key_len) < 0) { in dst_hmac_md5_key_from_file_format()
/netbsd-src/external/bsd/ntp/dist/sntp/tests/
H A DkeyFile.c13 bool CompareKeysAlternative(int key_id,int key_len,const char* type,const char* key_seq,struct key …
32 if (expected.key_len != actual.key_len) { in CompareKeys()
34 expected.key_len, actual.key_len); in CompareKeys()
43 if (memcmp(expected.key_seq, actual.key_seq, expected.key_len) != 0) { in CompareKeys()
54 int key_len, in CompareKeysAlternative() argument
63 temp.key_len = key_len; in CompareKeysAlternative()
65 memcpy(temp.key_seq, key_seq, key_len); in CompareKeysAlternative()
/netbsd-src/crypto/external/bsd/openssl.old/dist/crypto/kdf/
H A Dhkdf.c22 const unsigned char *key, size_t key_len,
28 const unsigned char *key, size_t key_len,
42 size_t key_len; member
65 OPENSSL_clear_free(kctx->key, kctx->key_len); in pkey_hkdf_cleanup()
108 OPENSSL_clear_free(kctx->key, kctx->key_len); in pkey_hkdf_ctrl()
114 kctx->key_len = p1; in pkey_hkdf_ctrl()
182 OPENSSL_clear_free(kctx->key, kctx->key_len); in pkey_hkdf_derive_init()
207 kctx->key_len, kctx->info, kctx->info_len, key, in pkey_hkdf_derive()
216 kctx->key_len, key, keylen) != NULL; in pkey_hkdf_derive()
219 return HKDF_Expand(kctx->md, kctx->key, kctx->key_len, kctx->info, in pkey_hkdf_derive()
[all …]
/netbsd-src/external/gpl2/groff/dist/src/utils/indxbib/
H A Dindxbib.cpp391 int key_len = 0; in read_common_words_file() local
399 if (key_len < truncate_len) in read_common_words_file()
400 key_buffer[key_len++] = cmlower(c); in read_common_words_file()
403 if (key_len >= shortest_len) { in read_common_words_file()
404 int h = hash(key_buffer, key_len) % hash_table_size; in read_common_words_file()
405 common_words_table[h] = new word_list(key_buffer, key_len, in read_common_words_file()
410 key_len = 0; in read_common_words_file()
427 int key_len = 0; in do_whole_file() local
431 key_len = 1; in do_whole_file()
436 if (key_len < truncate_len) in do_whole_file()
[all …]
/netbsd-src/crypto/external/bsd/openssl.old/dist/include/crypto/
H A Devp.h135 int key_len; member
248 key_len, iv_len, flags, init_key, cleanup, \ argument
251 nid##_##nmode, block_size, key_len, iv_len, \
263 #define BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, \ argument
266 BLOCK_CIPHER_def1(cname, cbc, cbc, CBC, kstruct, nid, block_size, key_len, \
269 #define BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, \ argument
273 key_len, iv_len, flags, init_key, cleanup, set_asn1, \
276 #define BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, \ argument
280 key_len, iv_len, flags, init_key, cleanup, set_asn1, \
283 #define BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, \ argument
[all …]
/netbsd-src/crypto/external/bsd/openssl/dist/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()
328 const unsigned char *key, size_t key_len) in cipher_init() argument
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()
[all …]
H A Dsshkdf.c36 const unsigned char *key, size_t key_len,
45 size_t key_len; member
83 OPENSSL_clear_free(ctx->key, ctx->key_len); in kdf_sshkdf_reset()
129 return SSHKDF(md, ctx->key, ctx->key_len, in kdf_sshkdf_derive()
148 if (!sshkdf_set_membuf(&ctx->key, &ctx->key_len, p)) in kdf_sshkdf_set_ctx_params()
228 const unsigned char *key, size_t key_len, in SSHKDF() argument
246 if (!EVP_DigestUpdate(md, key, key_len)) in SSHKDF()
274 if (!EVP_DigestUpdate(md, key, key_len)) in SSHKDF()
/netbsd-src/lib/libcrypt/
H A Dhmac.c68 const unsigned char *key, size_t key_len, in HMAC_FUNC() argument
84 if (key_len > HMAC_BLOCKSZ) { in HMAC_FUNC()
88 HASH_Update(&tctx, key, key_len); in HMAC_FUNC()
92 key_len = HASH_LENGTH; in HMAC_FUNC()
111 for (i = 0; i < key_len; i++) { in HMAC_FUNC()
287 int key_len; in main() local
303 key_len = strlen(key); in main()
305 HMAC_FUNC(data, data_len, key, key_len, digest); in main()
/netbsd-src/external/bsd/wpa/dist/src/eap_common/
H A 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 …]
H A 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,
/netbsd-src/crypto/external/bsd/openssl.old/dist/test/
H A Dcmactest.c30 int key_len; member
85 || !TEST_true(CMAC_Init(ctx, test[0].key, test[0].key_len, NULL, NULL)) in test_cmac_bad()
110 if (!TEST_true(CMAC_Init(ctx, test[0].key, test[0].key_len, in test_cmac_run()
120 if (!TEST_true(CMAC_Init(ctx, test[1].key, test[1].key_len, in test_cmac_run()
130 if (!TEST_true(CMAC_Init(ctx, test[2].key, test[2].key_len, NULL, NULL)) in test_cmac_run()
148 || !TEST_true(CMAC_Init(ctx, test[2].key, test[2].key_len, NULL, NULL)) in test_cmac_run()
175 if (!TEST_true(CMAC_Init(ctx, test[0].key, test[0].key_len, in test_cmac_copy()
/netbsd-src/crypto/external/bsd/openssl/dist/test/
H A Dcmactest.c36 int key_len; member
91 || !TEST_true(CMAC_Init(ctx, test[0].key, test[0].key_len, NULL, NULL)) in test_cmac_bad()
116 if (!TEST_true(CMAC_Init(ctx, test[0].key, test[0].key_len, in test_cmac_run()
126 if (!TEST_true(CMAC_Init(ctx, test[1].key, test[1].key_len, in test_cmac_run()
136 if (!TEST_true(CMAC_Init(ctx, test[2].key, test[2].key_len, NULL, NULL)) in test_cmac_run()
154 || !TEST_true(CMAC_Init(ctx, test[2].key, test[2].key_len, NULL, NULL)) in test_cmac_run()
181 if (!TEST_true(CMAC_Init(ctx, test[0].key, test[0].key_len, in test_cmac_copy()

12345678