Lines Matching refs:areq

989 			    struct aead_request *areq, bool encrypt)  in ipsec_esp_unmap()  argument
991 struct crypto_aead *aead = crypto_aead_reqtfm(areq); in ipsec_esp_unmap()
995 unsigned int cryptlen = areq->cryptlen - (encrypt ? 0 : authsize); in ipsec_esp_unmap()
1004 talitos_sg_unmap(dev, edesc, areq->src, areq->dst, in ipsec_esp_unmap()
1005 cryptlen + authsize, areq->assoclen); in ipsec_esp_unmap()
1014 sg_pcopy_to_buffer(areq->dst, dst_nents, ctx->iv, ivsize, in ipsec_esp_unmap()
1015 areq->assoclen + cryptlen - ivsize); in ipsec_esp_unmap()
1026 struct aead_request *areq = context; in ipsec_esp_encrypt_done() local
1027 struct crypto_aead *authenc = crypto_aead_reqtfm(areq); in ipsec_esp_encrypt_done()
1033 ipsec_esp_unmap(dev, edesc, areq, true); in ipsec_esp_encrypt_done()
1039 aead_request_complete(areq, err); in ipsec_esp_encrypt_done()
1193 static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq, in ipsec_esp() argument
1199 struct crypto_aead *aead = crypto_aead_reqtfm(areq); in ipsec_esp()
1204 unsigned int cryptlen = areq->cryptlen - (encrypt ? 0 : authsize); in ipsec_esp()
1222 sg_copy_to_buffer(areq->src, sg_count, edesc->buf, in ipsec_esp()
1223 areq->assoclen + cryptlen); in ipsec_esp()
1225 sg_count = dma_map_sg(dev, areq->src, sg_count, in ipsec_esp()
1226 (areq->src == areq->dst) ? in ipsec_esp()
1230 ret = talitos_sg_map(dev, areq->src, areq->assoclen, edesc, in ipsec_esp()
1254 ret = talitos_sg_map_ext(dev, areq->src, cryptlen, edesc, &desc->ptr[4], in ipsec_esp()
1255 sg_count, areq->assoclen, tbl_off, elen, in ipsec_esp()
1264 if (areq->src != areq->dst) { in ipsec_esp()
1267 dma_map_sg(dev, areq->dst, sg_count, DMA_FROM_DEVICE); in ipsec_esp()
1274 ret = talitos_sg_map_ext(dev, areq->dst, cryptlen, edesc, &desc->ptr[5], in ipsec_esp()
1275 sg_count, areq->assoclen, tbl_off, elen, in ipsec_esp()
1294 talitos_sg_map(dev, areq->dst, authsize, edesc, &desc->ptr[6], in ipsec_esp()
1295 sg_count, areq->assoclen + cryptlen, tbl_off); in ipsec_esp()
1308 ret = talitos_submit(dev, ctx->ch, desc, callback, areq); in ipsec_esp()
1310 ipsec_esp_unmap(dev, edesc, areq, encrypt); in ipsec_esp()
1417 static struct talitos_edesc *aead_edesc_alloc(struct aead_request *areq, u8 *iv, in aead_edesc_alloc() argument
1420 struct crypto_aead *authenc = crypto_aead_reqtfm(areq); in aead_edesc_alloc()
1424 unsigned int cryptlen = areq->cryptlen - (encrypt ? 0 : authsize); in aead_edesc_alloc()
1426 return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst, in aead_edesc_alloc()
1427 iv, areq->assoclen, cryptlen, in aead_edesc_alloc()
1429 areq->base.flags, encrypt); in aead_edesc_alloc()
1534 struct skcipher_request *areq) in common_nonsnoop_unmap() argument
1538 talitos_sg_unmap(dev, edesc, areq->src, areq->dst, areq->cryptlen, 0); in common_nonsnoop_unmap()
1550 struct skcipher_request *areq = context; in skcipher_done() local
1551 struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(areq); in skcipher_done()
1558 common_nonsnoop_unmap(dev, edesc, areq); in skcipher_done()
1559 memcpy(areq->iv, ctx->iv, ivsize); in skcipher_done()
1563 skcipher_request_complete(areq, err); in skcipher_done()
1567 struct skcipher_request *areq, in common_nonsnoop() argument
1572 struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(areq); in common_nonsnoop()
1576 unsigned int cryptlen = areq->cryptlen; in common_nonsnoop()
1595 sg_copy_to_buffer(areq->src, sg_count, edesc->buf, in common_nonsnoop()
1598 sg_count = dma_map_sg(dev, areq->src, sg_count, in common_nonsnoop()
1599 (areq->src == areq->dst) ? in common_nonsnoop()
1604 sg_count = talitos_sg_map_ext(dev, areq->src, cryptlen, edesc, &desc->ptr[3], in common_nonsnoop()
1610 if (areq->src != areq->dst) { in common_nonsnoop()
1613 dma_map_sg(dev, areq->dst, sg_count, DMA_FROM_DEVICE); in common_nonsnoop()
1616 ret = talitos_sg_map(dev, areq->dst, cryptlen, edesc, &desc->ptr[4], in common_nonsnoop()
1631 ret = talitos_submit(dev, ctx->ch, desc, callback, areq); in common_nonsnoop()
1633 common_nonsnoop_unmap(dev, edesc, areq); in common_nonsnoop()
1640 areq, bool encrypt) in skcipher_edesc_alloc()
1642 struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(areq); in skcipher_edesc_alloc()
1646 return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst, in skcipher_edesc_alloc()
1647 areq->iv, 0, areq->cryptlen, 0, ivsize, 0, in skcipher_edesc_alloc()
1648 areq->base.flags, encrypt); in skcipher_edesc_alloc()
1651 static int skcipher_encrypt(struct skcipher_request *areq) in skcipher_encrypt() argument
1653 struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(areq); in skcipher_encrypt()
1659 if (!areq->cryptlen) in skcipher_encrypt()
1662 if (areq->cryptlen % blocksize) in skcipher_encrypt()
1666 edesc = skcipher_edesc_alloc(areq, true); in skcipher_encrypt()
1673 return common_nonsnoop(edesc, areq, skcipher_done); in skcipher_encrypt()
1676 static int skcipher_decrypt(struct skcipher_request *areq) in skcipher_decrypt() argument
1678 struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(areq); in skcipher_decrypt()
1684 if (!areq->cryptlen) in skcipher_decrypt()
1687 if (areq->cryptlen % blocksize) in skcipher_decrypt()
1691 edesc = skcipher_edesc_alloc(areq, false); in skcipher_decrypt()
1697 return common_nonsnoop(edesc, areq, skcipher_done); in skcipher_decrypt()
1702 struct ahash_request *areq) in common_nonsnoop_hash_unmap() argument
1704 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in common_nonsnoop_hash_unmap()
1705 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in common_nonsnoop_hash_unmap()
1717 memcpy(areq->result, req_ctx->hw_context, in common_nonsnoop_hash_unmap()
1748 struct ahash_request *areq = context; in ahash_done() local
1751 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_done()
1758 common_nonsnoop_hash_unmap(dev, edesc, areq); in ahash_done()
1762 ahash_request_complete(areq, err); in ahash_done()
1787 struct ahash_request *areq, unsigned int length, in common_nonsnoop_hash() argument
1792 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in common_nonsnoop_hash()
1794 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in common_nonsnoop_hash()
1904 ret = talitos_submit(dev, ctx->ch, desc, callback, areq); in common_nonsnoop_hash()
1906 common_nonsnoop_hash_unmap(dev, edesc, areq); in common_nonsnoop_hash()
1912 static struct talitos_edesc *ahash_edesc_alloc(struct ahash_request *areq, in ahash_edesc_alloc() argument
1915 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in ahash_edesc_alloc()
1917 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_edesc_alloc()
1925 nbytes, 0, 0, 0, areq->base.flags, false); in ahash_edesc_alloc()
1928 static int ahash_init(struct ahash_request *areq) in ahash_init() argument
1930 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in ahash_init()
1933 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init()
1958 static int ahash_init_sha224_swinit(struct ahash_request *areq) in ahash_init_sha224_swinit() argument
1960 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init_sha224_swinit()
1975 ahash_init(areq); in ahash_init_sha224_swinit()
1981 static int ahash_process_req(struct ahash_request *areq, unsigned int nbytes) in ahash_process_req() argument
1983 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in ahash_process_req()
1985 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_process_req()
2000 nents = sg_nents_for_len(areq->src, nbytes); in ahash_process_req()
2005 sg_copy_to_buffer(areq->src, nents, in ahash_process_req()
2032 sg_chain(req_ctx->bufsl, 2, areq->src); in ahash_process_req()
2041 nents = sg_nents_for_len(areq->src, offset); in ahash_process_req()
2046 sg_copy_to_buffer(areq->src, nents, in ahash_process_req()
2049 req_ctx->psrc = scatterwalk_ffwd(req_ctx->bufsl, areq->src, in ahash_process_req()
2052 req_ctx->psrc = areq->src; in ahash_process_req()
2055 nents = sg_nents_for_len(areq->src, nbytes); in ahash_process_req()
2060 sg_pcopy_to_buffer(areq->src, nents, in ahash_process_req()
2068 edesc = ahash_edesc_alloc(areq, nbytes_to_hash); in ahash_process_req()
2090 return common_nonsnoop_hash(edesc, areq, nbytes_to_hash, ahash_done); in ahash_process_req()
2093 static int ahash_update(struct ahash_request *areq) in ahash_update() argument
2095 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_update()
2099 return ahash_process_req(areq, areq->nbytes); in ahash_update()
2102 static int ahash_final(struct ahash_request *areq) in ahash_final() argument
2104 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_final()
2108 return ahash_process_req(areq, 0); in ahash_final()
2111 static int ahash_finup(struct ahash_request *areq) in ahash_finup() argument
2113 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_finup()
2117 return ahash_process_req(areq, areq->nbytes); in ahash_finup()
2120 static int ahash_digest(struct ahash_request *areq) in ahash_digest() argument
2122 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_digest()
2123 struct crypto_ahash *ahash = crypto_ahash_reqtfm(areq); in ahash_digest()
2125 ahash->init(areq); in ahash_digest()
2128 return ahash_process_req(areq, areq->nbytes); in ahash_digest()
2131 static int ahash_export(struct ahash_request *areq, void *out) in ahash_export() argument
2133 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_export()
2135 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in ahash_export()
2156 static int ahash_import(struct ahash_request *areq, const void *in) in ahash_import() argument
2158 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_import()
2159 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in ahash_import()