Home
last modified time | relevance | path

Searched full:hmac (Results 1 – 25 of 141) sorted by relevance

123456

/linux/include/crypto/
H A Dsha2.h135 * HMAC key and message context structs, shared by HMAC-SHA224 and HMAC-SHA256.
206 * struct hmac_sha224_key - Prepared key for HMAC-SHA224
214 * struct hmac_sha224_ctx - Context for computing HMAC-SHA224 of a message
222 * hmac_sha224_preparekey() - Prepare a key for HMAC-SHA224
224 * @raw_key: the raw HMAC-SHA224 key
236 * hmac_sha224_init() - Initialize an HMAC-SHA224 context for a new message
237 * @ctx: (output) the HMAC context to initialize
238 * @key: the prepared HMAC key
251 * hmac_sha224_init_usingrawkey() - Initialize an HMAC-SHA224 context for a new
253 * @ctx: (output) the HMAC context to initialize
[all …]
H A Dmd5.h92 * struct hmac_md5_key - Prepared key for HMAC-MD5
102 * struct hmac_md5_ctx - Context for computing HMAC-MD5 of a message
112 * hmac_md5_preparekey() - Prepare a key for HMAC-MD5
114 * @raw_key: the raw HMAC-MD5 key
126 * hmac_md5_init() - Initialize an HMAC-MD5 context for a new message
127 * @ctx: (output) the HMAC context to initialize
128 * @key: the prepared HMAC key
137 * hmac_md5_init_usingrawkey() - Initialize an HMAC-MD5 context for a new
139 * @ctx: (output) the HMAC context to initialize
140 * @raw_key: the raw HMAC-MD5 key
[all …]
/linux/fs/ubifs/
H A Dauth.c38 * ubifs_hash_calc_hmac - calculate a HMAC from a hash
40 * @hash: the node to calculate a HMAC for
41 * @hmac: the returned HMAC
46 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()
58 * It creates a HMAC from the given input hash and writes it to the node.
80 err = ubifs_hash_calc_hmac(c, hash, auth->hmac); in ubifs_prepare_auth_node()
275 snprintf(hmac_name, CRYPTO_MAX_ALG_NAME, "hmac(%s)", in ubifs_init_authentication()
326 ubifs_err(c, "hmac %s is bigger than maximum allowed hmac size (%d > %d)", in ubifs_init_authentication()
376 * ubifs_node_calc_hmac - calculate the HMAC of a UBIFS node
[all …]
/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_name, in nvme_auth_hmac_id()
126 strlen(hash_map[i].hmac))) in nvme_auth_hmac_id()
225 * Start computing an HMAC value, given the algorithm ID and raw key.
231 int nvme_auth_hmac_init(struct nvme_auth_hmac_ctx *hmac, u8 hmac_id, in nvme_auth_hmac_init() argument
[all …]
/linux/drivers/nvme/target/
H A Dauth.c3 * NVMe over Fabrics DH-HMAC-CHAP authentication.
43 pr_warn("Invalid DH-HMAC-CHAP hash id %d\n", in nvmet_auth_set_key()
283 struct nvme_auth_hmac_ctx hmac; in nvmet_auth_host_hash() local
295 ret = nvme_auth_hmac_init(&hmac, ctrl->shash_id, transformed_key->key, in nvmet_auth_host_hash()
325 nvme_auth_hmac_update(&hmac, challenge, shash_len); in nvmet_auth_host_hash()
328 nvme_auth_hmac_update(&hmac, buf, 4); in nvmet_auth_host_hash()
331 nvme_auth_hmac_update(&hmac, buf, 2); in nvmet_auth_host_hash()
334 nvme_auth_hmac_update(&hmac, buf, 1); in nvmet_auth_host_hash()
335 nvme_auth_hmac_update(&hmac, "HostHost", 8); in nvmet_auth_host_hash()
337 nvme_auth_hmac_update(&hmac, ctrl->hostnqn, strlen(ctrl->hostnqn)); in nvmet_auth_host_hash()
[all …]
/linux/drivers/crypto/caam/
H A Dcaamalg.c2246 .cra_name = "authenc(hmac(md5),"
2248 .cra_driver_name = "authenc-hmac-md5-"
2270 .cra_name = "authenc(hmac(sha1),"
2272 .cra_driver_name = "authenc-hmac-sha1-"
2294 .cra_name = "authenc(hmac(sha224),"
2296 .cra_driver_name = "authenc-hmac-sha224-"
2318 .cra_name = "authenc(hmac(sha256),"
2320 .cra_driver_name = "authenc-hmac-sha256-"
2342 .cra_name = "authenc(hmac(sha384),"
2344 .cra_driver_name = "authenc-hmac-sha384-"
[all …]
H A Dcaamalg_qi.c1653 .cra_name = "authenc(hmac(md5),cbc(aes))",
1654 .cra_driver_name = "authenc-hmac-md5-"
1674 .cra_name = "echainiv(authenc(hmac(md5),"
1676 .cra_driver_name = "echainiv-authenc-hmac-md5-"
1697 .cra_name = "authenc(hmac(sha1),cbc(aes))",
1698 .cra_driver_name = "authenc-hmac-sha1-"
1718 .cra_name = "echainiv(authenc(hmac(sha1),"
1721 "hmac-sha1-cbc-aes-caam-qi",
1741 .cra_name = "authenc(hmac(sha224),cbc(aes))",
1742 .cra_driver_name = "authenc-hmac-sha224-"
[all …]
H A Dcaamalg_qi2.c1864 .cra_name = "authenc(hmac(md5),cbc(aes))",
1865 .cra_driver_name = "authenc-hmac-md5-"
1885 .cra_name = "echainiv(authenc(hmac(md5),"
1887 .cra_driver_name = "echainiv-authenc-hmac-md5-"
1908 .cra_name = "authenc(hmac(sha1),cbc(aes))",
1909 .cra_driver_name = "authenc-hmac-sha1-"
1929 .cra_name = "echainiv(authenc(hmac(sha1),"
1932 "hmac-sha1-cbc-aes-caam-qi2",
1952 .cra_name = "authenc(hmac(sha224),cbc(aes))",
1953 .cra_driver_name = "authenc-hmac-sha224-"
[all …]
/linux/security/integrity/evm/
H A DKconfig22 Include filesystem UUID for HMAC calculation.
27 WARNING: changing the HMAC calculation method or adding
36 Include additional SMACK xattrs for HMAC calculation.
40 in the HMAC calculation, enabling this option includes newly defined
44 WARNING: changing the HMAC calculation method or adding
53 Allow userland to provide additional xattrs for HMAC calculation.
H A Devm_main.c113 pr_info("HMAC attrs: 0x%x\n", evm_hmac_attrs);
123 * errors, based on the ability of EVM to calculate HMACs. If the HMAC key in evm_hmac_disabled()
182 * evm_verify_hmac - calculate and compare the HMAC with the EVM xattr in evm_verify_hmac()
184 * Compute the HMAC on the dentry's protected set of extended attributes in evm_verify_hmac()
189 * HMAC.) in evm_verify_hmac()
435 * Calculate the HMAC for the given dentry and verify it against the stored
437 * previously retrieved to calculate the HMAC.
549 /* Exception if the HMAC is not going to be calculated. */ in evm_protect_xattr()
569 /* Exception if the HMAC is not going to be calculated. */ in evm_protect_xattr()
606 * access to the EVM encrypted key needed to calculate the HMAC, preven in evm_inode_setxattr()
[all...]
H A Devm_crypto.c10 * Using root's kernel master key (kmk), calculate the HMAC
39 static const char evm_hmac[] = "hmac(sha1)";
42 * evm_set_key() - set EVM HMAC key from the kernel
46 * This function allows setting the EVM HMAC key from the kernel
84 pr_err_once("HMAC key is not set\n"); in init_desc()
149 * unsigned long to allow existing HMAC and signatures from in hmac_add_misc()
168 /* The hmac uid and gid must be encoded in the initial user in hmac_add_misc()
221 * Calculate the HMAC value across the set of protected security xattrs. in evm_calc_hmac_or_hash()
224 * the hmac using the requested xattr value. Don't alloc/free memory for in evm_calc_hmac_or_hash()
369 * Calculate the hmac an in evm_update_evmxattr()
[all...]
/linux/Documentation/networking/
H A Dseg6-sysctl.rst20 Define HMAC policy for ingress SR-enabled packets on this interface.
22 * -1 - Ignore HMAC field
23 * 0 - Accept SR packets without HMAC, validate SR packets with HMAC
24 * 1 - Drop SR packets without HMAC, validate SR packets with HMAC
/linux/drivers/crypto/inside-secure/
H A Dsafexcel_hash.c9 #include <crypto/hmac.h>
42 bool hmac; member
161 /* Hash continuation or HMAC, setup (inner) digest from state */ in safexcel_context_control()
165 /* Compute digest count for hash/HMAC finish operations */ in safexcel_context_control()
183 /* Special case: zero length HMAC */ in safexcel_context_control()
185 /* PE HW < 4.4 cannot do HMAC continue, fake using hash */ in safexcel_context_control()
192 /* For zero-len HMAC, don't finalize, already padded! */ in safexcel_context_control()
202 /* Clear zero-length HMAC flag for next operation! */ in safexcel_context_control()
204 } else { /* HMAC */ in safexcel_context_control()
205 /* Need outer digest for HMAC finalization */ in safexcel_context_control()
[all …]
/linux/drivers/nvme/host/
H A Dauth.c417 struct nvme_auth_hmac_ctx hmac; in nvme_auth_dhchap_setup_host_response() local
437 ret = nvme_auth_hmac_init(&hmac, chap->hash_id, in nvme_auth_dhchap_setup_host_response()
458 nvme_auth_hmac_update(&hmac, challenge, chap->hash_len); in nvme_auth_dhchap_setup_host_response()
461 nvme_auth_hmac_update(&hmac, buf, 4); in nvme_auth_dhchap_setup_host_response()
464 nvme_auth_hmac_update(&hmac, buf, 2); in nvme_auth_dhchap_setup_host_response()
467 nvme_auth_hmac_update(&hmac, buf, 1); in nvme_auth_dhchap_setup_host_response()
468 nvme_auth_hmac_update(&hmac, "HostHost", 8); in nvme_auth_dhchap_setup_host_response()
469 nvme_auth_hmac_update(&hmac, ctrl->opts->host->nqn, in nvme_auth_dhchap_setup_host_response()
472 nvme_auth_hmac_update(&hmac, buf, 1); in nvme_auth_dhchap_setup_host_response()
473 nvme_auth_hmac_update(&hmac, ctrl->opts->subsysnqn, in nvme_auth_dhchap_setup_host_response()
[all …]
/linux/crypto/
H A Dsha256.c3 * Crypto API support for SHA-224, SHA-256, HMAC-SHA224, and HMAC-SHA256
182 /* HMAC-SHA224 */
249 /* HMAC-SHA256 */
356 .base.cra_name = "hmac(sha224)",
357 .base.cra_driver_name = "hmac-sha224-lib",
376 .base.cra_name = "hmac(sha256)",
377 .base.cra_driver_name = "hmac-sha256-lib",
410 MODULE_DESCRIPTION("Crypto API support for SHA-224, SHA-256, HMAC-SHA224, and HMAC-SHA256");
416 MODULE_ALIAS_CRYPTO("hmac(sha224)");
417 MODULE_ALIAS_CRYPTO("hmac-sha224-lib");
[all …]
H A Dsha512.c3 * Crypto API support for SHA-384, SHA-512, HMAC-SHA384, and HMAC-SHA512
188 /* HMAC-SHA384 */
255 /* HMAC-SHA512 */
362 .base.cra_name = "hmac(sha384)",
363 .base.cra_driver_name = "hmac-sha384-lib",
382 .base.cra_name = "hmac(sha512)",
383 .base.cra_driver_name = "hmac-sha512-lib",
416 MODULE_DESCRIPTION("Crypto API support for SHA-384, SHA-512, HMAC-SHA384, and HMAC-SHA512");
422 MODULE_ALIAS_CRYPTO("hmac(sha384)");
423 MODULE_ALIAS_CRYPTO("hmac-sha384-lib");
[all …]
/linux/Documentation/translations/zh_CN/filesystems/
H A Dubifs-authentication.rst211 为确保整个索引真实性,UBIFS 主节点存储基于密钥的哈希(HMAC),覆盖自身内容及
249 图3:索引节点哈希与主节点 HMAC 的覆盖范围
264 状态的 HMAC。因此日志可认证至最后一个认证节点。日志尾部无认证节点的部分无法
272 ,. | , . |hmac . |hmac
279 , | , |hmac
292 日志区位置存储于主节点。因为主节点通过 HMAC 认证,所以未经检测无法篡改。日
294 改此值及其他参数,超级块结构添加 HMAC。超级块节点存储在 LEB 0,仅在功能标
311 节点的 HMAC。创建文件系统(`mkfs.ubifs`) 时需提供此密钥以认证超级块节点。
312 挂载文件系统时也需此密钥验证认证节点并为变更生成新 HMAC
334 证密钥的前提下实现。方法是在每个 HMAC 外额外存储数字签名,供应商随文件系统
[all …]
/linux/drivers/crypto/allwinner/sun8i-ss/
H A Dsun8i-ss-hash.c13 #include <crypto/hmac.h>
496 /* HMAC step: in sun8i_ss_hash_run()
501 int hmac = 0; in sun8i_ss_hash_run() local
575 if (tfmctx->keylen && hmac == 0) { in sun8i_ss_hash_run()
576 hmac = 1; in sun8i_ss_hash_run()
597 if (tfmctx->keylen && hmac == 2) { in sun8i_ss_hash_run()
659 * flow start for hmac = 0 (and HMAC = 1) in sun8i_ss_hash_run()
660 * HMAC = 0 in sun8i_ss_hash_run()
665 * if hmac then hmac = 1 in sun8i_ss_hash_run()
667 * if hmac == 2 in sun8i_ss_hash_run()
[all …]
/linux/drivers/char/tpm/
H A Dtpm2-sessions.c7 * authorization HMAC and request response encryption.
9 * The idea is to ensure that every TPM command is HMAC protected by a
36 * The design is all the crypto, hash and hmac gunk is confined in this
50 * calculating the HMAC. In particular, for NV, volatile and
52 * tpm_buf_append_hmac_session() which appends the hmac session to the
56 * command buffer is finalized so it can fill in the correct HMAC
123 * because several HMAC/KDF schemes use the combination of the
350 * for the HMAC which cannot be computed until the command buffer is
360 * tpm_buf_fill_hmac_session() otherwise the HMAC will be incorrect
388 * before computing the HMAC in tpm_buf_append_hmac_session()
[all …]
/linux/net/sunrpc/auth_gss/
H A Dgss_krb5_crypto.c158 * @cksumout: OUT: a buffer to be filled in with the computed HMAC
160 * Usually expressed as H = HMAC(K, message)[1..h] .
586 struct xdr_netobj hmac; in gss_krb5_aes_encrypt() local
625 hmac.len = kctx->gk5e->cksumlength; in gss_krb5_aes_encrypt()
626 hmac.data = buf->tail[0].iov_base + buf->tail[0].iov_len; in gss_krb5_aes_encrypt()
633 * the hmac. in gss_krb5_aes_encrypt()
639 offset + GSS_KRB5_TOK_HDR_LEN, &hmac); in gss_krb5_aes_encrypt()
650 /* Now update buf to account for HMAC */ in gss_krb5_aes_encrypt()
694 /* Get the packet's hmac value */ in gss_krb5_aes_decrypt()
718 * @cksumout: OUT: a buffer to be filled in with the computed HMAC
[all …]
/linux/Documentation/devicetree/bindings/crypto/
H A Dnvidia,tegra234-se-hash.yaml12 HMAC(SHA224), HMAC(SHA256), HMAC(SHA384), HMAC(SHA512)
/linux/Documentation/security/tpm/
H A Dtpm-security.rst60 The first can be thwarted by always doing HMAC protection of the PCR
62 substituted without producing a detectable HMAC failure in the
72 interception which HMAC protection alone cannot protect against, so
131 All TPM commands the kernel uses allow sessions. HMAC sessions may be
134 HMAC and encryption keys are usually derived from the shared
136 known (and usually empty). Thus, every HMAC session used by the
144 session may also be reused for the in-kernel HMAC, encryption and
150 For every in-kernel operation we use null primary salted HMAC to
189 decryption HMAC session salted to the EK primary (which also does not
193 succeeds and the HMAC verifies on return we know we have a loadable
/linux/net/ipv6/
H A Dseg6_hmac.c3 * SR-IPv6 implementation -- HMAC functions
114 /* Let's build the HMAC text on the ring buffer. The text is composed in seg6_hmac_compute()
120 * 4. HMAC Key ID (32 bits) in seg6_hmac_compute()
139 /* HMAC Key ID */ in seg6_hmac_compute()
171 /* checks if an incoming SR-enabled packet's HMAC status matches
216 if (crypto_memneq(hmac_output, tlv->hmac, SEG6_HMAC_FIELD_LEN)) in seg6_hmac_validate_skb()
299 memset(tlv->hmac, 0, SEG6_HMAC_FIELD_LEN); in seg6_push_hmac()
300 err = seg6_hmac_compute(hinfo, srh, saddr, tlv->hmac); in seg6_push_hmac()
/linux/net/mptcp/
H A Dcrypto_test.c35 char hmac[32], hmac_hex[65]; in mptcp_crypto_test_basic() local
42 /* mptcp hmap will convert to be before computing the hmac */ in mptcp_crypto_test_basic()
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()
/linux/lib/crypto/tests/
H A Dhash-test-template.h469 #ifdef HMAC
471 * Test the corresponding HMAC variant.
473 * This test case is fairly short, since HMAC is just a simple C wrapper around
476 * interrupt context again for HMAC, nor to have a long list of test vectors.
480 * a key length, generate the inputs from a seed, and compute the HMAC value.
481 * Concatenate all these HMAC values together, and compute the HMAC of that.
482 * Verify that value. If this fails, then the HMAC implementation is wrong.
518 /* Verify that HMAC() is consistent with HMAC_USINGRAWKEY(). */ in test_hmac()
520 HMAC(&key, test_buf, data_len, mac2); in test_hmac()
523 "HMAC gave different results with raw and prepared keys"); in test_hmac()
[all …]

123456