Home
last modified time | relevance | path

Searched refs:hmac (Results 1 – 25 of 45) sorted by relevance

12

/linux/drivers/nvme/common/
H A Dauth.c91 char hmac[15]; member
95 .hmac = "hmac(sha256)",
99 .hmac = "hmac(sha384)",
103 .hmac = "hmac(sha512)",
111 return hash_map[hmac_id].hmac; in nvme_auth_hmac_name()
123 if (!strlen(hash_map[i].hmac)) in nvme_auth_hmac_id()
125 if (!strncmp(hash_map[i].hmac, hmac_nam in nvme_auth_hmac_id()
231 nvme_auth_hmac_init(struct nvme_auth_hmac_ctx * hmac,u8 hmac_id,const u8 * key,size_t key_len) nvme_auth_hmac_init() argument
251 nvme_auth_hmac_update(struct nvme_auth_hmac_ctx * hmac,const u8 * data,size_t data_len) nvme_auth_hmac_update() argument
271 nvme_auth_hmac_final(struct nvme_auth_hmac_ctx * hmac,u8 * out) nvme_auth_hmac_final() argument
292 struct nvme_auth_hmac_ctx hmac; nvme_auth_hmac() local
323 struct nvme_auth_hmac_ctx hmac; nvme_auth_transform_key() local
541 struct nvme_auth_hmac_ctx hmac; nvme_auth_generate_psk() local
604 struct nvme_auth_hmac_ctx hmac; nvme_auth_generate_digest() local
[all...]
H A Dkeyring.c94 u8 hmac, u8 psk_ver, bool generated) in nvme_tls_psk_lookup()
106 psk_ver, generated ? 'G' : 'R', hmac, hostnqn, subnqn); in nvme_tls_psk_lookup()
93 nvme_tls_psk_lookup(struct key * keyring,const char * hostnqn,const char * subnqn,u8 hmac,u8 psk_ver,bool generated) nvme_tls_psk_lookup() argument
/linux/drivers/nvme/target/
H A Dauth.c295 struct nvme_auth_hmac_ctx hmac; in nvmet_auth_host_hash()
307 ret = nvme_auth_hmac_init(&hmac, ctrl->shash_id, transformed_key->key, in nvmet_auth_host_hash()
337 nvme_auth_hmac_update(&hmac, challenge, shash_len); in nvmet_auth_host_hash()
340 nvme_auth_hmac_update(&hmac, buf, 4); in nvmet_auth_host_hash()
343 nvme_auth_hmac_update(&hmac, buf, 2); in nvmet_auth_host_hash()
346 nvme_auth_hmac_update(&hmac, buf, 1); in nvmet_auth_host_hash()
347 nvme_auth_hmac_update(&hmac, "HostHost", 8); in nvmet_auth_host_hash()
349 nvme_auth_hmac_update(&hmac, ctrl->hostnqn, strlen(ctrl->hostnqn)); in nvmet_auth_host_hash()
350 nvme_auth_hmac_update(&hmac, buf, 1); in nvmet_auth_host_hash()
351 nvme_auth_hmac_update(&hmac, ctr in nvmet_auth_host_hash()
289 struct nvme_auth_hmac_ctx hmac; nvmet_auth_host_hash() local
361 struct nvme_auth_hmac_ctx hmac; nvmet_auth_ctrl_hash() local
[all...]
/linux/fs/ubifs/
H A Dauth.c46 u8 *hmac) in ubifs_hash_calc_hmac() argument
48 return crypto_shash_tfm_digest(c->hmac_tfm, hash, c->hash_len, hmac); in ubifs_hash_calc_hmac()
80 err = ubifs_hash_calc_hmac(c, hash, auth->hmac); in ubifs_prepare_auth_node()
388 int len, int ofs_hmac, void *hmac) in ubifs_node_calc_hmac() argument
416 return crypto_shash_final(shash, hmac); in ubifs_node_calc_hmac()
451 u8 *hmac; in __ubifs_node_verify_hmac() local
454 hmac = kmalloc(hmac_len, GFP_NOFS); in __ubifs_node_verify_hmac()
455 if (!hmac) in __ubifs_node_verify_hmac()
458 err = ubifs_node_calc_hmac(c, node, len, ofs_hmac, hmac); in __ubifs_node_verify_hmac()
460 kfree(hmac); in __ubifs_node_verify_hmac()
[all …]
H A Dmaster.c28 int hmac_offs = offsetof(struct ubifs_mst_node, hmac); in ubifs_compare_master_node()
138 if (ubifs_hmac_zero(c, c->mst_node->hmac)) { in scan_for_master()
146 offsetof(struct ubifs_mst_node, hmac)); in scan_for_master()
461 offsetof(struct ubifs_mst_node, hmac)); in ubifs_write_master()
473 offsetof(struct ubifs_mst_node, hmac)); in ubifs_write_master()
H A Dubifs-media.h678 __u8 hmac[UBIFS_MAX_HMAC_LEN]; member
754 __u8 hmac[UBIFS_MAX_HMAC_LEN]; member
781 __u8 hmac[]; member
H A Dsb.c323 offsetof(struct ubifs_sb_node, hmac)); in create_default_filesystem()
343 offsetof(struct ubifs_mst_node, hmac)); in create_default_filesystem()
348 0, offsetof(struct ubifs_mst_node, hmac)); in create_default_filesystem()
587 if (ubifs_hmac_zero(c, sup->hmac)) { in authenticate_sb_node()
599 hmac)); in authenticate_sb_node()
621 offsetof(struct ubifs_sb_node, hmac), 1); in ubifs_write_sb_node()
/linux/drivers/nvme/host/
H A Dauth.c432 struct nvme_auth_hmac_ctx hmac; in nvme_auth_dhchap_setup_host_response()
452 ret = nvme_auth_hmac_init(&hmac, chap->hash_id, in nvme_auth_dhchap_setup_host_response()
473 nvme_auth_hmac_update(&hmac, challenge, chap->hash_len); in nvme_auth_dhchap_setup_host_response()
476 nvme_auth_hmac_update(&hmac, buf, 4); in nvme_auth_dhchap_setup_host_response()
479 nvme_auth_hmac_update(&hmac, buf, 2); in nvme_auth_dhchap_setup_host_response()
482 nvme_auth_hmac_update(&hmac, buf, 1); in nvme_auth_dhchap_setup_host_response()
483 nvme_auth_hmac_update(&hmac, "HostHost", 8); in nvme_auth_dhchap_setup_host_response()
484 nvme_auth_hmac_update(&hmac, ctrl->opts->host->nqn,
487 nvme_auth_hmac_update(&hmac, buf, 1); in nvme_auth_dhchap_setup_ctrl_response()
488 nvme_auth_hmac_update(&hmac, ctr in nvme_auth_dhchap_setup_ctrl_response() local
418 struct nvme_auth_hmac_ctx hmac; nvme_auth_dhchap_setup_host_response() local
[all...]
/linux/arch/s390/crypto/
H A Dhmac_s390.c379 struct s390_hmac_alg *hmac; in _s390_hmac_algs_unregister() local
383 hmac = &s390_hmac_algs[i]; in _s390_hmac_algs_unregister()
384 if (!hmac->registered) in _s390_hmac_algs_unregister()
386 crypto_unregister_shash(&hmac->alg); in _s390_hmac_algs_unregister()
392 struct s390_hmac_alg *hmac; in hmac_s390_init() local
401 hmac = &s390_hmac_algs[i]; in hmac_s390_init()
402 if (!cpacf_query_func(CPACF_KMAC, hmac->fc)) in hmac_s390_init()
405 rc = crypto_register_shash(&hmac->alg); in hmac_s390_init()
408 hmac->alg.halg.base.cra_name); in hmac_s390_init()
411 hmac->registered = true; in hmac_s390_init()
[all …]
/linux/drivers/crypto/
H A Datmel-sha.c1188 /* copy ready hash (+ finalize hmac) */ in atmel_sha_final()
1602 /* hmac functions */
1684 struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); in atmel_sha_hmac_setup()
1689 hmac->resume = resume; in atmel_sha_hmac_setup()
1721 if (likely(!atmel_sha_hmac_key_get(&hmac->hkey, &key, &keylen))) in atmel_sha_hmac_setup()
1729 memcpy_and_pad(hmac->ipad, bs, key, keylen, 0);
1744 struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); in atmel_sha_hmac_prehash_key_done()
1752 hmac->ipad[i] = atmel_sha_read(dd, SHA_REG_DIGEST(i)); in atmel_sha_hmac_prehash_key_done()
1753 memset((u8 *)hmac->ipad + ds, 0, bs - ds);
1761 struct atmel_sha_hmac_ctx *hmac in atmel_sha_hmac_compute_ipad_hash()
1681 struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); atmel_sha_hmac_setup() local
1741 struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); atmel_sha_hmac_prehash_key_done() local
1758 struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); atmel_sha_hmac_compute_ipad_hash() local
1778 struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); atmel_sha_hmac_compute_opad_hash() local
1794 struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); atmel_sha_hmac_setup_done() local
1844 struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); atmel_sha_hmac_setkey() local
1865 struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); atmel_sha_hmac_init_done() local
1882 struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); atmel_sha_hmac_final() local
1941 struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); atmel_sha_hmac_digest2() local
2016 struct atmel_sha_hmac_ctx *hmac = crypto_tfm_ctx(tfm); atmel_sha_hmac_cra_init() local
2028 struct atmel_sha_hmac_ctx *hmac = crypto_tfm_ctx(tfm); atmel_sha_hmac_cra_exit() local
2276 struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); atmel_sha_authenc_init() local
2299 struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); atmel_sha_authenc_init2() local
[all...]
/linux/net/mptcp/
H A Dcrypto_test.c35 char hmac[32], hmac_hex[65]; in mptcp_crypto_test_basic() local
51 mptcp_crypto_hmac_sha(key1, key2, msg, 8, hmac); in mptcp_crypto_test_basic()
53 sprintf(&hmac_hex[j << 1], "%02x", hmac[j] & 0xff); in mptcp_crypto_test_basic()
H A Dsubflow.c86 void *hmac) in subflow_token_join_request()
93 mptcp_crypto_hmac_sha(key1, key2, msg, 8, hmac); in subflow_token_join_request()
104 /* validate received token and create truncated hmac and nonce for SYN-ACK */ in subflow_token_join_request()
108 u8 hmac[SHA256_DIGEST_SIZE];
115 subflow_req->remote_nonce, hmac); in subflow_init_req()
117 subflow_req->thmac = get_unaligned_be64(hmac); in subflow_init_req()
449 /* validate received truncated hmac and create hmac for third ACK */ in mptcp_subflow_reset()
453 u8 hmac[SHA256_DIGEST_SIZE]; in subflow_use_different_dport()
458 hmac); in __mptcp_sync_state()
51 subflow_generate_hmac(u64 key1,u64 key2,u32 nonce1,u32 nonce2,void * hmac) subflow_generate_hmac() argument
73 u8 hmac[SHA256_DIGEST_SIZE]; subflow_req_create_thmac() local
413 u8 hmac[SHA256_DIGEST_SIZE]; subflow_thmac_valid() local
569 u8 hmac[SHA256_DIGEST_SIZE]; subflow_finish_connect() local
759 u8 hmac[SHA256_DIGEST_SIZE]; subflow_hmac_valid() local
[all...]
H A Doptions.c167 memcpy(mp_opt->hmac, ptr, MPTCPOPT_HMAC_LEN); in mptcp_parse_option()
168 pr_debug("MP_JOIN hmac\n"); in mptcp_parse_option()
582 memcpy(opts->hmac, subflow->hmac, MPTCPOPT_HMAC_LEN); in mptcp_established_options_mp()
701 u8 hmac[SHA256_DIGEST_SIZE]; in add_addr_generate_hmac()
719 mptcp_crypto_hmac_sha(key1, key2, msg, i, hmac); in add_addr_generate_hmac()
721 return get_unaligned_be64(&hmac[SHA256_DIGEST_SIZE - sizeof(u64)]); in mptcp_established_options_add_addr()
1202 u64 hmac = 0; in mptcp_over_limit()
1207 hmac = add_addr_generate_hmac(READ_ONCE(msk->remote_key), in mptcp_over_limit()
1212 msk, hmac, mp_op in mptcp_over_limit()
698 u8 hmac[SHA256_DIGEST_SIZE]; add_addr_generate_hmac() local
1180 u64 hmac = 0; add_addr_hmac_valid() local
[all...]
/linux/include/linux/
H A Dnvme-auth.h34 int nvme_auth_hmac_init(struct nvme_auth_hmac_ctx *hmac, u8 hmac_id,
36 void nvme_auth_hmac_update(struct nvme_auth_hmac_ctx *hmac, const u8 *data,
38 void nvme_auth_hmac_final(struct nvme_auth_hmac_ctx *hmac, u8 *out);
/linux/scripts/crypto/
H A Dgen-fips-testvecs.py14 import hmac
129 ctx = hmac.new(fips_test_key, digestmod=alg)
H A Dgen-hash-testvecs.py13 import hmac
229 ctx = hmac.new(rand_bytes(32), digestmod=alg)
235 mac = hmac.digest(key, data[:data_len], alg)
/linux/tools/testing/selftests/tpm2/
H A Dtpm2.py252 session_attributes=0, hmac=bytes()): argument
256 self.hmac = hmac
259 fmt = '>I H%us B H%us' % (len(self.nonce), len(self.hmac))
261 self.nonce, self.session_attributes, len(self.hmac),
262 self.hmac)
265 fmt = '>I H%us B H%us' % (len(self.nonce), len(self.hmac))
651 auth_cmd = AuthCommand(session_handle=policy_handle, hmac=auth_value)
653 auth_cmd = AuthCommand(hmac=auth_value)
/linux/drivers/crypto/allwinner/sun8i-ss/
H A Dsun8i-ss-hash.c13 #include <crypto/hmac.h>
500 int hmac = 0; in sun8i_ss_hash_run()
574 if (tfmctx->keylen && hmac == 0) { in sun8i_ss_hash_run()
575 hmac = 1; in sun8i_ss_hash_run()
596 if (tfmctx->keylen && hmac == 2) { in sun8i_ss_hash_run()
658 * flow start for hmac = 0 (and HMAC = 1) in sun8i_ss_hash_run()
664 * if hmac then hmac = 1 in sun8i_ss_hash_run()
666 * if hmac == 2 in sun8i_ss_hash_run()
672 * if hmac in sun8i_ss_hash_run()
501 int hmac = 0; sun8i_ss_hash_run() local
[all...]
/linux/net/sunrpc/
H A DKconfig
/linux/Documentation/translations/zh_CN/filesystems/
H A Dubifs-authentication.rst272 ,. | , . |hmac . |hmac
279 , | , |hmac
/linux/net/ipv6/
H A Dseg6_hmac.c213 if (crypto_memneq(hmac_output, tlv->hmac, SEG6_HMAC_FIELD_LEN)) in seg6_hmac_validate_skb()
296 memset(tlv->hmac, 0, SEG6_HMAC_FIELD_LEN); in seg6_push_hmac()
297 err = seg6_hmac_compute(hinfo, srh, saddr, tlv->hmac); in seg6_push_hmac()
/linux/drivers/crypto/intel/keembay/
H A DKconfig81 bool "Enable sha224 and hmac(sha224) support in Intel Keem Bay OCS HCU"
84 Enables support for sha224 and hmac(sha224) algorithms in the Intel
88 Provides OCS HCU hardware acceleration of sha224 and hmac(224).
/linux/include/uapi/linux/
H A Dseg6_hmac.h15 __u8 hmac[SEG6_HMAC_FIELD_LEN]; member
/linux/drivers/thunderbolt/
H A Ddomain.c717 u8 hmac[TB_SWITCH_KEY_SIZE]; in tb_domain_challenge_switch_key() local
734 static_assert(sizeof(hmac) == SHA256_DIGEST_SIZE); in tb_domain_challenge_switch_key()
736 challenge, sizeof(challenge), hmac); in tb_domain_challenge_switch_key()
739 if (crypto_memneq(response, hmac, sizeof(hmac))) in tb_domain_challenge_switch_key()
/linux/drivers/crypto/inside-secure/
H A Dsafexcel_hash.c9 #include <crypto/hmac.h>
42 bool hmac; member
272 if (sreq->hmac && in safexcel_handle_req_result()
283 sreq->hmac = 0; in safexcel_handle_req_result()
703 (req->finish && req->hmac && in safexcel_ahash_enqueue()
827 } else if (unlikely(req->hmac && in safexcel_ahash_final()
861 } else if (req->hmac) { in safexcel_ahash_final()
1028 req->hmac = true; in safexcel_hmac_sha1_init()
1105 req->hmac = true; in safexcel_hmac_init_iv()
1220 .cra_name = "hmac(sha
[all...]

12