Searched refs:req_ctx (Results 1 - 5 of 5) sorted by relevance

/linux-4.1.27/drivers/crypto/
H A Dmv_cesa.c257 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); mv_process_current_q() local
260 switch (req_ctx->op) { mv_process_current_q()
273 if (req_ctx->decrypt) { mv_process_current_q()
311 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); mv_crypto_algo_completion() local
316 if (req_ctx->op != COP_AES_CBC) mv_crypto_algo_completion()
326 struct mv_req_hash_ctx *req_ctx = ahash_request_ctx(req); mv_process_hash_current() local
331 switch (req_ctx->op) { mv_process_hash_current()
345 req_ctx-> mv_process_hash_current()
356 is_last = req_ctx->last_chunk mv_process_hash_current()
358 && (req_ctx->count <= MAX_HW_HASH_SIZE); mv_process_hash_current()
359 if (req_ctx->first_hash) { mv_process_hash_current()
365 req_ctx->first_hash = 0; mv_process_hash_current()
373 writel(req_ctx->state[0], cpg->reg + DIGEST_INITIAL_VAL_A); mv_process_hash_current()
374 writel(req_ctx->state[1], cpg->reg + DIGEST_INITIAL_VAL_B); mv_process_hash_current()
375 writel(req_ctx->state[2], cpg->reg + DIGEST_INITIAL_VAL_C); mv_process_hash_current()
376 writel(req_ctx->state[3], cpg->reg + DIGEST_INITIAL_VAL_D); mv_process_hash_current()
377 writel(req_ctx->state[4], cpg->reg + DIGEST_INITIAL_VAL_E); mv_process_hash_current()
404 struct mv_req_hash_ctx *req_ctx = ahash_request_ctx(req); mv_hash_final_fallback() local
410 if (unlikely(req_ctx->first_hash)) { mv_hash_final_fallback()
412 crypto_shash_update(shash, req_ctx->buffer, mv_hash_final_fallback()
413 req_ctx->extra_bytes); mv_hash_final_fallback()
417 rc = mv_hash_import_sha1_ctx(req_ctx, shash); mv_hash_final_fallback()
655 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); mv_enc_aes_ecb() local
657 req_ctx->op = COP_AES_ECB; mv_enc_aes_ecb()
658 req_ctx->decrypt = 0; mv_enc_aes_ecb()
666 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); mv_dec_aes_ecb() local
668 req_ctx->op = COP_AES_ECB; mv_dec_aes_ecb()
669 req_ctx->decrypt = 1; mv_dec_aes_ecb()
677 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); mv_enc_aes_cbc() local
679 req_ctx->op = COP_AES_CBC; mv_enc_aes_cbc()
680 req_ctx->decrypt = 0; mv_enc_aes_cbc()
688 struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req); mv_dec_aes_cbc() local
690 req_ctx->op = COP_AES_CBC; mv_dec_aes_cbc()
691 req_ctx->decrypt = 1; mv_dec_aes_cbc()
H A Dixp4xx_crypto.c339 struct aead_ctx *req_ctx = aead_request_ctx(req); finish_scattered_hmac() local
344 if (req_ctx->encrypt) { finish_scattered_hmac()
345 scatterwalk_map_and_copy(req_ctx->hmac_virt, finish_scattered_hmac()
348 dma_pool_free(buffer_pool, req_ctx->hmac_virt, crypt->icv_rev_aes); finish_scattered_hmac()
365 struct aead_ctx *req_ctx = aead_request_ctx(req); one_packet() local
367 free_buf_chain(dev, req_ctx->buffer, crypt->src_buf); one_packet()
368 if (req_ctx->hmac_virt) { one_packet()
376 struct ablk_ctx *req_ctx = ablkcipher_request_ctx(req); one_packet() local
378 if (req_ctx->dst) { one_packet()
379 free_buf_chain(dev, req_ctx->dst, crypt->dst_buf); one_packet()
381 free_buf_chain(dev, req_ctx->src, crypt->src_buf); one_packet()
875 struct ablk_ctx *req_ctx = ablkcipher_request_ctx(req); ablk_perform() local
907 req_ctx->dst = NULL; ablk_perform()
912 req_ctx->dst = dst_hook.next; ablk_perform()
915 req_ctx->dst = NULL; ablk_perform()
917 req_ctx->src = NULL; ablk_perform()
922 req_ctx->src = src_hook.next; ablk_perform()
930 free_buf_chain(dev, req_ctx->src, crypt->src_buf); ablk_perform()
933 free_buf_chain(dev, req_ctx->dst, crypt->dst_buf); ablk_perform()
1000 struct aead_ctx *req_ctx = aead_request_ctx(req); aead_perform() local
1043 req_ctx->buffer = src_hook.next; aead_perform()
1048 sg_init_table(&req_ctx->ivlist, 1); aead_perform()
1049 sg_set_buf(&req_ctx->ivlist, iv, ivsize); aead_perform()
1050 buf = chainup_buffers(dev, &req_ctx->ivlist, ivsize, buf, flags, aead_perform()
1057 req_ctx->hmac_virt = dma_pool_alloc(buffer_pool, flags, aead_perform()
1059 if (unlikely(!req_ctx->hmac_virt)) aead_perform()
1062 scatterwalk_map_and_copy(req_ctx->hmac_virt, aead_perform()
1065 req_ctx->encrypt = encrypt; aead_perform()
1067 req_ctx->hmac_virt = NULL; aead_perform()
1074 if (!req_ctx->hmac_virt) { aead_perform()
1083 if (req_ctx->hmac_virt) { aead_perform()
1084 dma_pool_free(buffer_pool, req_ctx->hmac_virt, aead_perform()
1088 free_buf_chain(dev, req_ctx->buffer, crypt->src_buf); aead_perform()
H A Dtalitos.c1510 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); common_nonsnoop_hash_unmap() local
1523 talitos_sg_unmap(dev, edesc, req_ctx->psrc, NULL); common_nonsnoop_hash_unmap()
1538 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); ahash_done() local
1540 if (!req_ctx->last && req_ctx->to_hash_later) { ahash_done()
1542 memcpy(req_ctx->buf, req_ctx->bufnext, req_ctx->to_hash_later); ahash_done()
1543 req_ctx->nbuf = req_ctx->to_hash_later; ahash_done()
1560 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); common_nonsnoop_hash() local
1569 if (!req_ctx->first || req_ctx->swinit) { common_nonsnoop_hash()
1571 req_ctx->hw_context_size, common_nonsnoop_hash()
1572 (char *)req_ctx->hw_context, 0, common_nonsnoop_hash()
1574 req_ctx->swinit = 0; common_nonsnoop_hash()
1578 req_ctx->first = 0; common_nonsnoop_hash()
1594 sg_count = talitos_map_sg(dev, req_ctx->psrc, common_nonsnoop_hash()
1599 to_talitos_ptr(&desc->ptr[3], sg_dma_address(req_ctx->psrc)); common_nonsnoop_hash()
1601 sg_count = sg_to_link_tbl(req_ctx->psrc, sg_count, length, common_nonsnoop_hash()
1613 sg_dma_address(req_ctx->psrc)); common_nonsnoop_hash()
1621 if (req_ctx->last) common_nonsnoop_hash()
1627 req_ctx->hw_context_size, common_nonsnoop_hash()
1628 req_ctx->hw_context, 0, DMA_FROM_DEVICE); common_nonsnoop_hash()
1646 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); ahash_edesc_alloc() local
1648 return talitos_edesc_alloc(ctx->dev, NULL, req_ctx->psrc, NULL, NULL, 0, ahash_edesc_alloc()
1655 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); ahash_init() local
1658 req_ctx->nbuf = 0; ahash_init()
1659 req_ctx->first = 1; /* first indicates h/w must init its context */ ahash_init()
1660 req_ctx->swinit = 0; /* assume h/w init of context */ ahash_init()
1661 req_ctx->hw_context_size = ahash_init()
1675 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); ahash_init_sha224_swinit() local
1678 req_ctx->swinit = 1;/* prevent h/w initting context with sha256 values*/ ahash_init_sha224_swinit()
1680 req_ctx->hw_context[0] = SHA224_H0; ahash_init_sha224_swinit()
1681 req_ctx->hw_context[1] = SHA224_H1; ahash_init_sha224_swinit()
1682 req_ctx->hw_context[2] = SHA224_H2; ahash_init_sha224_swinit()
1683 req_ctx->hw_context[3] = SHA224_H3; ahash_init_sha224_swinit()
1684 req_ctx->hw_context[4] = SHA224_H4; ahash_init_sha224_swinit()
1685 req_ctx->hw_context[5] = SHA224_H5; ahash_init_sha224_swinit()
1686 req_ctx->hw_context[6] = SHA224_H6; ahash_init_sha224_swinit()
1687 req_ctx->hw_context[7] = SHA224_H7; ahash_init_sha224_swinit()
1690 req_ctx->hw_context[8] = 0; ahash_init_sha224_swinit()
1691 req_ctx->hw_context[9] = 0; ahash_init_sha224_swinit()
1700 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); ahash_process_req() local
1709 if (!req_ctx->last && (nbytes + req_ctx->nbuf <= blocksize)) { ahash_process_req()
1713 req_ctx->buf + req_ctx->nbuf, nbytes); ahash_process_req()
1714 req_ctx->nbuf += nbytes; ahash_process_req()
1719 nbytes_to_hash = nbytes + req_ctx->nbuf; ahash_process_req()
1722 if (req_ctx->last) ahash_process_req()
1734 if (req_ctx->nbuf) { ahash_process_req()
1735 nsg = (req_ctx->nbuf < nbytes_to_hash) ? 2 : 1; ahash_process_req()
1736 sg_init_table(req_ctx->bufsl, nsg); ahash_process_req()
1737 sg_set_buf(req_ctx->bufsl, req_ctx->buf, req_ctx->nbuf); ahash_process_req()
1739 scatterwalk_sg_chain(req_ctx->bufsl, 2, areq->src); ahash_process_req()
1740 req_ctx->psrc = req_ctx->bufsl; ahash_process_req()
1742 req_ctx->psrc = areq->src; ahash_process_req()
1747 req_ctx->bufnext, ahash_process_req()
1751 req_ctx->to_hash_later = to_hash_later; ahash_process_req()
1761 if (req_ctx->last) ahash_process_req()
1767 if (req_ctx->first && !req_ctx->swinit) ahash_process_req()
1773 if (ctx->keylen && (req_ctx->first || req_ctx->last)) ahash_process_req()
1782 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); ahash_update() local
1784 req_ctx->last = 0; ahash_update()
1791 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); ahash_final() local
1793 req_ctx->last = 1; ahash_final()
1800 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); ahash_finup() local
1802 req_ctx->last = 1; ahash_finup()
1809 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); ahash_digest() local
1813 req_ctx->last = 1; ahash_digest()
/linux-4.1.27/drivers/crypto/ux500/hash/
H A Dhash_core.c568 struct hash_req_ctx *req_ctx = ahash_request_ctx(req); hash_init() local
573 memset(&req_ctx->state, 0, sizeof(struct hash_state)); hash_init()
574 req_ctx->updated = 0; hash_init()
577 req_ctx->dma_mode = false; /* Don't use DMA */ hash_init()
584 req_ctx->dma_mode = true; hash_init()
586 req_ctx->dma_mode = false; hash_init()
779 struct hash_ctx *ctx, struct hash_req_ctx *req_ctx, hash_process_data()
795 if (req_ctx->updated) { hash_process_data()
798 memmove(req_ctx->state.buffer, hash_process_data()
815 req_ctx->updated = 1; hash_process_data()
840 hash_incrementlength(req_ctx, HASH_BLOCK_SIZE); hash_process_data()
850 req_ctx->state.buffer, hash_process_data()
873 struct hash_req_ctx *req_ctx = ahash_request_ctx(req); hash_dma_final() local
884 if (req_ctx->updated) { hash_dma_final()
894 if (!req_ctx->updated) { hash_dma_final()
904 if (hash_mode != HASH_MODE_DMA || !req_ctx->dma_mode) { hash_dma_final()
921 req_ctx->updated = 1; hash_dma_final()
979 struct hash_req_ctx *req_ctx = ahash_request_ctx(req); hash_hw_final() local
989 if (req_ctx->updated) { hash_hw_final()
1030 if (!req_ctx->updated) { hash_hw_final()
1039 if (req_ctx->state.index) { hash_hw_final()
1040 hash_messagepad(device_data, req_ctx->state.buffer, hash_hw_final()
1041 req_ctx->state.index); hash_hw_final()
1086 struct hash_req_ctx *req_ctx = ahash_request_ctx(req); hash_hw_update() local
1094 index = req_ctx->state.index; hash_hw_update()
1095 buffer = (u8 *)req_ctx->state.buffer; hash_hw_update()
1099 if (msg_length > (req_ctx->state.length.low_word + msg_length) && hash_hw_update()
1100 HASH_HIGH_WORD_MAX_VAL == req_ctx->state.length.high_word) { hash_hw_update()
1112 ret = hash_process_data(device_data, ctx, req_ctx, msg_length, hash_hw_update()
1124 req_ctx->state.index = index; hash_hw_update()
1126 __func__, req_ctx->state.index, req_ctx->state.bit_index); hash_hw_update()
1310 struct hash_req_ctx *req_ctx = ahash_request_ctx(req); ahash_update() local
1312 if (hash_mode != HASH_MODE_DMA || !req_ctx->dma_mode) ahash_update()
1330 struct hash_req_ctx *req_ctx = ahash_request_ctx(req); ahash_final() local
1334 if ((hash_mode == HASH_MODE_DMA) && req_ctx->dma_mode) ahash_final()
778 hash_process_data(struct hash_device_data *device_data, struct hash_ctx *ctx, struct hash_req_ctx *req_ctx, int msg_length, u8 *data_buffer, u8 *buffer, u8 *index) hash_process_data() argument
/linux-4.1.27/arch/x86/crypto/sha-mb/
H A Dsha1_mb.c431 struct mcryptd_hash_request_ctx *req_ctx; sha_complete_job() local
450 req_ctx = cast_hash_to_mcryptd_ctx(sha_ctx); sha_complete_job()
451 ret = sha_finish_walk(&req_ctx, cstate, false); sha_complete_job()
452 if (req_ctx) { sha_complete_job()
454 list_del(&req_ctx->waiter); sha_complete_job()
457 req = cast_mcryptd_ctx_to_req(req_ctx); sha_complete_job()
459 req_ctx->complete(&req->base, ret); sha_complete_job()
462 req_ctx->complete(&req->base, ret); sha_complete_job()

Completed in 138 milliseconds