Searched refs:ahash (Results 1 - 21 of 21) sorted by relevance

/linux-4.1.27/include/net/
H A Dah.h12 struct crypto_ahash *ahash; member in struct:ah_data
/linux-4.1.27/net/ipv4/
H A Dah4.c23 static void *ah_alloc_tmp(struct crypto_ahash *ahash, int nfrags, ah_alloc_tmp() argument
28 len = size + crypto_ahash_digestsize(ahash) + ah_alloc_tmp()
29 (crypto_ahash_alignmask(ahash) & ah_alloc_tmp()
34 len += sizeof(struct ahash_request) + crypto_ahash_reqsize(ahash); ah_alloc_tmp()
47 static inline u8 *ah_tmp_icv(struct crypto_ahash *ahash, void *tmp, ah_tmp_icv() argument
50 return PTR_ALIGN((u8 *)tmp + offset, crypto_ahash_alignmask(ahash) + 1); ah_tmp_icv()
53 static inline struct ahash_request *ah_tmp_req(struct crypto_ahash *ahash, ah_tmp_req() argument
58 req = (void *)PTR_ALIGN(icv + crypto_ahash_digestsize(ahash), ah_tmp_req()
61 ahash_request_set_tfm(req, ahash); ah_tmp_req()
66 static inline struct scatterlist *ah_req_sg(struct crypto_ahash *ahash, ah_req_sg() argument
70 crypto_ahash_reqsize(ahash), ah_req_sg()
130 icv = ah_tmp_icv(ahp->ahash, iph, ihl); ah_output_done()
152 struct crypto_ahash *ahash; ah_output() local
164 ahash = ahp->ahash; ah_output()
179 iph = ah_alloc_tmp(ahash, nfrags + sglists, ihl + seqhi_len); ah_output()
183 icv = ah_tmp_icv(ahash, seqhi, seqhi_len); ah_output()
184 req = ah_tmp_req(ahash, icv); ah_output()
185 sg = ah_req_sg(ahash, req); ah_output()
275 icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len); ah_input_done()
305 struct crypto_ahash *ahash; ah_input() local
322 ahash = ahp->ahash; ah_input()
361 work_iph = ah_alloc_tmp(ahash, nfrags + sglists, ihl + ah_input()
368 icv = ah_tmp_icv(ahash, auth_data, ahp->icv_trunc_len); ah_input()
369 req = ah_tmp_req(ahash, icv); ah_input()
370 sg = ah_req_sg(ahash, req); ah_input()
466 struct crypto_ahash *ahash; ah_init_state() local
478 ahash = crypto_alloc_ahash(x->aalg->alg_name, 0, 0); ah_init_state()
479 if (IS_ERR(ahash)) ah_init_state()
482 ahp->ahash = ahash; ah_init_state()
483 if (crypto_ahash_setkey(ahash, x->aalg->alg_key, ah_init_state()
497 crypto_ahash_digestsize(ahash)) { ah_init_state()
500 crypto_ahash_digestsize(ahash), ah_init_state()
522 crypto_free_ahash(ahp->ahash); ah_init_state()
535 crypto_free_ahash(ahp->ahash); ah_destroy()
/linux-4.1.27/net/ipv6/
H A Dah6.c60 static void *ah_alloc_tmp(struct crypto_ahash *ahash, int nfrags, ah_alloc_tmp() argument
65 len = size + crypto_ahash_digestsize(ahash) + ah_alloc_tmp()
66 (crypto_ahash_alignmask(ahash) & ah_alloc_tmp()
71 len += sizeof(struct ahash_request) + crypto_ahash_reqsize(ahash); ah_alloc_tmp()
89 static inline u8 *ah_tmp_icv(struct crypto_ahash *ahash, void *tmp, ah_tmp_icv() argument
92 return PTR_ALIGN((u8 *)tmp + offset, crypto_ahash_alignmask(ahash) + 1); ah_tmp_icv()
95 static inline struct ahash_request *ah_tmp_req(struct crypto_ahash *ahash, ah_tmp_req() argument
100 req = (void *)PTR_ALIGN(icv + crypto_ahash_digestsize(ahash), ah_tmp_req()
103 ahash_request_set_tfm(req, ahash); ah_tmp_req()
108 static inline struct scatterlist *ah_req_sg(struct crypto_ahash *ahash, ah_req_sg() argument
112 crypto_ahash_reqsize(ahash), ah_req_sg()
315 icv = ah_tmp_icv(ahp->ahash, iph_ext, extlen); ah6_output_done()
341 struct crypto_ahash *ahash; ah6_output() local
354 ahash = ahp->ahash; ah6_output()
371 iph_base = ah_alloc_tmp(ahash, nfrags + sglists, IPV6HDR_BASELEN + ah6_output()
378 icv = ah_tmp_icv(ahash, seqhi, seqhi_len); ah6_output()
379 req = ah_tmp_req(ahash, icv); ah6_output()
380 sg = ah_req_sg(ahash, req); ah6_output()
479 icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len); ah6_input_done()
522 struct crypto_ahash *ahash; ah6_input() local
551 ahash = ahp->ahash; ah6_input()
578 work_iph = ah_alloc_tmp(ahash, nfrags + sglists, hdr_len + ah6_input()
585 icv = ah_tmp_icv(ahash, seqhi, seqhi_len); ah6_input()
586 req = ah_tmp_req(ahash, icv); ah6_input()
587 sg = ah_req_sg(ahash, req); ah6_input()
675 struct crypto_ahash *ahash; ah6_init_state() local
687 ahash = crypto_alloc_ahash(x->aalg->alg_name, 0, 0); ah6_init_state()
688 if (IS_ERR(ahash)) ah6_init_state()
691 ahp->ahash = ahash; ah6_init_state()
692 if (crypto_ahash_setkey(ahash, x->aalg->alg_key, ah6_init_state()
706 crypto_ahash_digestsize(ahash)) { ah6_init_state()
708 x->aalg->alg_name, crypto_ahash_digestsize(ahash), ah6_init_state()
734 crypto_free_ahash(ahp->ahash); ah6_init_state()
747 crypto_free_ahash(ahp->ahash); ah6_destroy()
/linux-4.1.27/drivers/crypto/qce/
H A Dsha.h31 * struct qce_sha_reqctx - holds private ahash objects per request
72 struct crypto_ahash *ahash = __crypto_ahash_cast(tfm); to_ahash_tmpl() local
73 struct ahash_alg *alg = container_of(crypto_hash_alg_common(ahash), to_ahash_tmpl()
76 return container_of(alg, struct qce_alg_template, alg.ahash); to_ahash_tmpl()
H A Dsha.c41 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); qce_ahash_done() local
46 unsigned int digestsize = crypto_ahash_digestsize(ahash); qce_ahash_done()
52 dev_dbg(qce->dev, "ahash dma termination error (%d)\n", error); qce_ahash_done()
67 dev_dbg(qce->dev, "ahash operation error (%x)\n", status); qce_ahash_done()
148 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); qce_ahash_export() local
151 unsigned int digestsize = crypto_ahash_digestsize(ahash); qce_ahash_export()
153 crypto_tfm_alg_blocksize(crypto_ahash_tfm(ahash)); qce_ahash_export()
179 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); qce_import_common() local
181 unsigned int digestsize = crypto_ahash_digestsize(ahash); qce_import_common()
185 blocksize = crypto_tfm_alg_blocksize(crypto_ahash_tfm(ahash)); qce_import_common()
442 struct crypto_ahash *ahash = __crypto_ahash_cast(tfm); qce_ahash_cra_init() local
445 crypto_ahash_set_reqsize(ahash, sizeof(struct qce_sha_reqctx)); qce_ahash_cra_init()
513 alg = &tmpl->alg.ahash; qce_ahash_register_one()
561 crypto_unregister_ahash(&tmpl->alg.ahash); qce_ahash_unregister()
H A Dcommon.h91 struct ahash_alg ahash; member in union:qce_alg_template::__anon3849
H A Dcommon.c234 struct crypto_ahash *ahash = __crypto_ahash_cast(async_req->tfm); qce_setup_regs_ahash() local
238 unsigned int digestsize = crypto_ahash_digestsize(ahash); qce_setup_regs_ahash()
/linux-4.1.27/drivers/crypto/caam/
H A Dcaamhash.c2 * caam - Freescale FSL CAAM support for ahash functions of crypto API
100 /* ahash per-session context */
122 /* ahash state */
256 * For ahash read data from seqin following state->caam_ctx,
275 * For ahash update, final and finup, import context, read and write to seqout
296 /* For ahash firsts and digest, read and write to seqout */ ahash_data_to_out()
311 static int ahash_set_sh_desc(struct crypto_ahash *ahash) ahash_set_sh_desc() argument
313 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_set_sh_desc()
314 int digestsize = crypto_ahash_digestsize(ahash); ahash_set_sh_desc()
346 "ahash update shdesc@"__stringify(__LINE__)": ", ahash_set_sh_desc()
365 "ahash update first shdesc@"__stringify(__LINE__)": ", ahash_set_sh_desc()
382 print_hex_dump(KERN_ERR, "ahash final shdesc@"__stringify(__LINE__)": ", ahash_set_sh_desc()
400 print_hex_dump(KERN_ERR, "ahash finup shdesc@"__stringify(__LINE__)": ", ahash_set_sh_desc()
420 "ahash digest shdesc@"__stringify(__LINE__)": ", ahash_set_sh_desc()
512 static int ahash_setkey(struct crypto_ahash *ahash, ahash_setkey() argument
517 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_setkey()
519 int blocksize = crypto_tfm_alg_blocksize(&ahash->base); ahash_setkey()
520 int digestsize = crypto_ahash_digestsize(ahash); ahash_setkey()
569 ret = ahash_set_sh_desc(ahash); ahash_setkey()
580 crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_KEY_LEN); ahash_setkey()
585 * ahash_edesc - s/w-extended ahash descriptor
623 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_unmap_ctx() local
624 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_unmap_ctx()
637 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_done() local
638 int digestsize = crypto_ahash_digestsize(ahash); ahash_done()
640 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_done()
672 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_done_bi() local
673 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_done_bi()
676 int digestsize = crypto_ahash_digestsize(ahash); ahash_done_bi()
707 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_done_ctx_src() local
708 int digestsize = crypto_ahash_digestsize(ahash); ahash_done_ctx_src()
710 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_done_ctx_src()
742 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_done_ctx_dst() local
743 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_done_ctx_dst()
746 int digestsize = crypto_ahash_digestsize(ahash); ahash_done_ctx_dst()
775 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_update_ctx() local
776 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_update_ctx()
796 *next_buflen = in_len & (crypto_tfm_alg_blocksize(&ahash->base) - 1); ahash_update_ctx()
900 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_final_ctx() local
901 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_final_ctx()
913 int digestsize = crypto_ahash_digestsize(ahash); ahash_final_ctx()
983 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_finup_ctx() local
984 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_finup_ctx()
997 int digestsize = crypto_ahash_digestsize(ahash); ahash_finup_ctx()
1073 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_digest() local
1074 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_digest()
1080 int digestsize = crypto_ahash_digestsize(ahash); ahash_digest()
1150 /* submit ahash final if it the first job descriptor */ ahash_final_no_ctx()
1153 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_final_no_ctx() local
1154 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_final_no_ctx()
1163 int digestsize = crypto_ahash_digestsize(ahash); ahash_final_no_ctx()
1213 /* submit ahash update if it the first job descriptor after update */ ahash_update_no_ctx()
1216 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_update_no_ctx() local
1217 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_update_no_ctx()
1236 *next_buflen = in_len & (crypto_tfm_alg_blocksize(&ahash->base) - 1); ahash_update_no_ctx()
1328 /* submit ahash finup if it the first job descriptor after update */ ahash_finup_no_ctx()
1331 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_finup_no_ctx() local
1332 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_finup_no_ctx()
1344 int digestsize = crypto_ahash_digestsize(ahash); ahash_finup_no_ctx()
1416 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_update_first() local
1417 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_update_first()
1436 *next_buflen = req->nbytes & (crypto_tfm_alg_blocksize(&ahash->base) - ahash_update_first()
1577 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_export() local
1578 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_export()
1589 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); ahash_import() local
1590 struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); ahash_import()
1610 /* ahash descriptors */
1750 struct crypto_ahash *ahash = __crypto_ahash_cast(tfm); caam_hash_cra_init() local
1787 ret = ahash_set_sh_desc(ahash); caam_hash_cra_init()
1963 MODULE_DESCRIPTION("FSL CAAM support for ahash functions of crypto API");
/linux-4.1.27/drivers/crypto/
H A Dn2_core.c360 struct crypto_ahash *ahash = __crypto_ahash_cast(tfm); n2_hash_cra_init() local
361 struct n2_hash_ctx *ctx = crypto_ahash_ctx(ahash); n2_hash_cra_init()
374 crypto_ahash_set_reqsize(ahash, (sizeof(struct n2_hash_req_ctx) + n2_hash_cra_init()
386 struct crypto_ahash *ahash = __crypto_ahash_cast(tfm); n2_hash_cra_exit() local
387 struct n2_hash_ctx *ctx = crypto_ahash_ctx(ahash); n2_hash_cra_exit()
395 struct crypto_ahash *ahash = __crypto_ahash_cast(tfm); n2_hmac_cra_init() local
396 struct n2_hmac_ctx *ctx = crypto_ahash_ctx(ahash); n2_hmac_cra_init()
419 crypto_ahash_set_reqsize(ahash, (sizeof(struct n2_hash_req_ctx) + n2_hmac_cra_init()
435 struct crypto_ahash *ahash = __crypto_ahash_cast(tfm); n2_hmac_cra_exit() local
436 struct n2_hmac_ctx *ctx = crypto_ahash_ctx(ahash); n2_hmac_cra_exit()
1427 struct ahash_alg *ahash; __n2_register_one_hmac() local
1438 ahash = &p->derived.alg; __n2_register_one_hmac()
1439 ahash->digest = n2_hmac_async_digest; __n2_register_one_hmac()
1440 ahash->setkey = n2_hmac_async_setkey; __n2_register_one_hmac()
1442 base = &ahash->halg.base; __n2_register_one_hmac()
1451 err = crypto_register_ahash(ahash); __n2_register_one_hmac()
1467 struct ahash_alg *ahash; __n2_register_one_ahash() local
1480 ahash = &p->alg; __n2_register_one_ahash()
1481 ahash->init = n2_hash_async_init; __n2_register_one_ahash()
1482 ahash->update = n2_hash_async_update; __n2_register_one_ahash()
1483 ahash->final = n2_hash_async_final; __n2_register_one_ahash()
1484 ahash->finup = n2_hash_async_finup; __n2_register_one_ahash()
1485 ahash->digest = n2_hash_async_digest; __n2_register_one_ahash()
1487 halg = &ahash->halg; __n2_register_one_ahash()
1504 err = crypto_register_ahash(ahash); __n2_register_one_ahash()
H A Dsahara.c1222 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); sahara_sha_export() local
1223 struct sahara_ctx *ctx = crypto_ahash_ctx(ahash); sahara_sha_export()
1235 struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); sahara_sha_import() local
1236 struct sahara_ctx *ctx = crypto_ahash_ctx(ahash); sahara_sha_import()
H A Dbfin_crc.c681 "Can't register crypto ahash device\n"); bfin_crypto_crc_probe()
H A Dtalitos.c1810 struct crypto_ahash *ahash = crypto_ahash_reqtfm(areq); ahash_digest() local
1812 ahash->init(areq); ahash_digest()
/linux-4.1.27/security/integrity/ima/
H A Dima_crypto.c35 /* minimum file size for ahash use */
38 MODULE_PARM_DESC(ahash_minsize, "Minimum file size for ahash use");
65 MODULE_PARM_DESC(ahash_bufsize, "Maximum ahash buffer size");
221 pr_crit_ratelimited("ahash calculation failed: err: %d\n", err); ahash_wait()
429 * Asynchronous hash (ahash) allows using HW acceleration for calculating
430 * a hash. ahash performance varies for different data sizes on different
433 * minimum file size for using ahash on the system.
436 * shash for the hash calculation. If ahash fails, it falls back to using
/linux-4.1.27/include/crypto/
H A Dhash.h60 /* This field may only be used by the ahash API code. */
215 * CRYPTO_ALG_TYPE_AHASH (listed as type "ahash" in /proc/crypto)
227 * crypto_alloc_ahash() - allocate ahash cipher handle
229 * ahash cipher
233 * Allocate a cipher handle for an ahash. The returned struct
235 * API invocation for that ahash.
249 * crypto_free_ahash() - zeroize and free the ahash handle
312 * @req: asynchronous request handle that contains the reference to the ahash
315 * Return the ahash cipher handle that is registered with the asynchronous
318 * Return: ahash cipher handle
330 * Return the size of the ahash state size. With the crypto_ahash_export
334 * Return: size of the ahash state
352 * The caller provided key is set for the ahash cipher. The cipher
481 * similar way as ahash handle to the crypto_ahash_* API calls.
489 * Allow the caller to replace the existing ahash handle in the request
503 * Allocate the request data structure that must be used with the ahash
505 * the allocation, the provided ahash handle
/linux-4.1.27/drivers/crypto/ccp/
H A Dccp-crypto-sha.c291 struct crypto_ahash *ahash = __crypto_ahash_cast(tfm); ccp_sha_cra_init() local
296 crypto_ahash_set_reqsize(ahash, sizeof(struct ccp_sha_req_ctx)); ccp_sha_cra_init()
399 pr_err("%s ahash algorithm registration error (%d)\n", ccp_register_hmac_alg()
457 pr_err("%s ahash algorithm registration error (%d)\n", ccp_register_sha_alg()
H A Dccp-crypto-aes-cmac.c323 struct crypto_ahash *ahash = __crypto_ahash_cast(tfm); ccp_aes_cmac_cra_init() local
329 crypto_ahash_set_reqsize(ahash, sizeof(struct ccp_aes_cmac_req_ctx)); ccp_aes_cmac_cra_init()
397 pr_err("%s ahash algorithm registration error (%d)\n", ccp_register_aes_cmac_algs()
/linux-4.1.27/crypto/
H A DMakefile25 crypto_hash-y += ahash.o
H A Dahash.c493 strncpy(rhash.type, "ahash", sizeof(rhash.type)); crypto_ahash_report()
517 seq_printf(m, "type : ahash\n"); crypto_ahash_show()
H A Dtcrypt.c955 pr_err("ahash request allocation failure\n"); test_ahash_speed()
/linux-4.1.27/net/netfilter/ipvs/
H A Dip_vs_ctl.c271 __u32 ahash; ip_vs_svc_hashkey() local
278 ahash = ntohl(addr_fold); ip_vs_svc_hashkey()
279 ahash ^= ((size_t) net >> 8); ip_vs_svc_hashkey()
281 return (proto ^ ahash ^ (porth >> IP_VS_SVC_TAB_BITS) ^ porth) & ip_vs_svc_hashkey()
/linux-4.1.27/include/linux/
H A Dcrypto.h489 * buffer; ahash -- For output hash destination buf; shash --
517 * for ahash, shash.

Completed in 645 milliseconds