Lines Matching refs:req

285 	struct crypto_async_request *req;
286 void (*complete)(struct crypto_async_request *req);
365 artpec6_crypto_complete_crypto(struct crypto_async_request *req);
367 artpec6_crypto_complete_cbc_encrypt(struct crypto_async_request *req);
369 artpec6_crypto_complete_cbc_decrypt(struct crypto_async_request *req);
371 artpec6_crypto_complete_aead(struct crypto_async_request *req);
373 artpec6_crypto_complete_hash(struct crypto_async_request *req);
457 static int artpec6_crypto_submit(struct artpec6_crypto_req_common *req)
465 list_add_tail(&req->list, &ac->pending);
466 artpec6_crypto_start_dma(req);
468 } else if (req->req->flags & CRYPTO_TFM_REQ_MAY_BACKLOG) {
469 list_add_tail(&req->list, &ac->queue);
471 artpec6_crypto_common_destroy(req);
1041 void (*complete)(struct crypto_async_request *req),
1055 common->req = parent;
1086 static int artpec6_crypto_encrypt(struct skcipher_request *req)
1088 struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(req);
1091 void (*complete)(struct crypto_async_request *req);
1094 req_ctx = skcipher_request_ctx(req);
1116 &req->base,
1118 req->dst, req->cryptlen);
1122 ret = artpec6_crypto_prepare_crypto(req);
1131 static int artpec6_crypto_decrypt(struct skcipher_request *req)
1134 struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(req);
1137 void (*complete)(struct crypto_async_request *req);
1139 req_ctx = skcipher_request_ctx(req);
1161 ret = artpec6_crypto_common_init(&req_ctx->common, &req->base,
1163 req->dst, req->cryptlen);
1167 ret = artpec6_crypto_prepare_crypto(req);
1177 artpec6_crypto_ctr_crypt(struct skcipher_request *req, bool encrypt)
1179 struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(req);
1183 (req->iv + iv_len - 4));
1184 unsigned int nblks = ALIGN(req->cryptlen, AES_BLOCK_SIZE) /
1208 skcipher_request_set_callback(subreq, req->base.flags,
1210 skcipher_request_set_crypt(subreq, req->src, req->dst,
1211 req->cryptlen, req->iv);
1219 return encrypt ? artpec6_crypto_encrypt(req)
1220 : artpec6_crypto_decrypt(req);
1223 static int artpec6_crypto_ctr_encrypt(struct skcipher_request *req)
1225 return artpec6_crypto_ctr_crypt(req, true);
1228 static int artpec6_crypto_ctr_decrypt(struct skcipher_request *req)
1230 return artpec6_crypto_ctr_crypt(req, false);
1262 static int artpec6_crypto_aead_encrypt(struct aead_request *req)
1265 struct artpec6_crypto_aead_req_ctx *req_ctx = aead_request_ctx(req);
1268 ret = artpec6_crypto_common_init(&req_ctx->common, &req->base,
1274 ret = artpec6_crypto_prepare_aead(req);
1283 static int artpec6_crypto_aead_decrypt(struct aead_request *req)
1286 struct artpec6_crypto_aead_req_ctx *req_ctx = aead_request_ctx(req);
1289 if (req->cryptlen < AES_BLOCK_SIZE)
1293 &req->base,
1299 ret = artpec6_crypto_prepare_aead(req);
1644 * @req: The asynch request to process
2044 struct artpec6_crypto_req_common *req;
2047 req = list_first_entry(&ac->queue,
2050 list_move_tail(&req->list, &ac->pending);
2051 artpec6_crypto_start_dma(req);
2053 list_add_tail(&req->complete_in_progress, completions);
2081 struct artpec6_crypto_req_common *req;
2096 list_for_each_entry_safe(req, n, &ac->pending, list) {
2097 struct artpec6_crypto_dma_descriptors *dma = req->dma;
2101 stataddr = dma->stat_dma_addr + 4 * (req->dma->in_cnt - 1);
2107 stat = req->dma->stat[req->dma->in_cnt-1];
2112 pr_debug("Request %p status is %X\n", req, stat);
2122 pr_debug("Completing request %p\n", req);
2124 list_move_tail(&req->list, &complete_done);
2136 list_for_each_entry_safe(req, n, &complete_done, list) {
2137 artpec6_crypto_dma_unmap_all(req);
2138 artpec6_crypto_copy_bounce_buffers(req);
2139 artpec6_crypto_common_destroy(req);
2141 req->complete(req->req);
2144 list_for_each_entry_safe(req, n, &complete_in_progress,
2146 crypto_request_complete(req->req, -EINPROGRESS);
2150 static void artpec6_crypto_complete_crypto(struct crypto_async_request *req)
2152 crypto_request_complete(req, 0);
2156 artpec6_crypto_complete_cbc_decrypt(struct crypto_async_request *req)
2158 struct skcipher_request *cipher_req = container_of(req,
2168 artpec6_crypto_complete_cbc_encrypt(struct crypto_async_request *req)
2170 struct skcipher_request *cipher_req = container_of(req,
2179 static void artpec6_crypto_complete_aead(struct crypto_async_request *req)
2184 struct aead_request *areq = container_of(req,
2217 static void artpec6_crypto_complete_hash(struct crypto_async_request *req)
2219 crypto_request_complete(req, 0);
2258 artpec6_crypto_init_hash(struct ahash_request *req, u8 type, int hmac)
2262 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2291 static int artpec6_crypto_prepare_submit_hash(struct ahash_request *req)
2293 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2298 &req->base,
2306 ret = artpec6_crypto_prepare_hash(req);
2324 static int artpec6_crypto_hash_final(struct ahash_request *req)
2326 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2330 return artpec6_crypto_prepare_submit_hash(req);
2333 static int artpec6_crypto_hash_update(struct ahash_request *req)
2335 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2339 return artpec6_crypto_prepare_submit_hash(req);
2342 static int artpec6_crypto_sha1_init(struct ahash_request *req)
2344 return artpec6_crypto_init_hash(req, ARTPEC6_CRYPTO_HASH_SHA1, 0);
2347 static int artpec6_crypto_sha1_digest(struct ahash_request *req)
2349 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2351 artpec6_crypto_init_hash(req, ARTPEC6_CRYPTO_HASH_SHA1, 0);
2355 return artpec6_crypto_prepare_submit_hash(req);
2358 static int artpec6_crypto_sha256_init(struct ahash_request *req)
2360 return artpec6_crypto_init_hash(req, ARTPEC6_CRYPTO_HASH_SHA256, 0);
2363 static int artpec6_crypto_sha256_digest(struct ahash_request *req)
2365 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2367 artpec6_crypto_init_hash(req, ARTPEC6_CRYPTO_HASH_SHA256, 0);
2370 return artpec6_crypto_prepare_submit_hash(req);
2373 static int artpec6_crypto_hmac_sha256_init(struct ahash_request *req)
2375 return artpec6_crypto_init_hash(req, ARTPEC6_CRYPTO_HASH_SHA256, 1);
2378 static int artpec6_crypto_hmac_sha256_digest(struct ahash_request *req)
2380 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2382 artpec6_crypto_init_hash(req, ARTPEC6_CRYPTO_HASH_SHA256, 1);
2385 return artpec6_crypto_prepare_submit_hash(req);
2433 static int artpec6_crypto_hash_export(struct ahash_request *req, void *out)
2435 const struct artpec6_hash_request_context *ctx = ahash_request_ctx(req);
2461 static int artpec6_crypto_hash_import(struct ahash_request *req, const void *in)
2463 struct artpec6_hash_request_context *ctx = ahash_request_ctx(req);