Lines Matching refs:req
284 struct crypto_async_request *req;
285 void (*complete)(struct crypto_async_request *req);
364 artpec6_crypto_complete_crypto(struct crypto_async_request *req);
366 artpec6_crypto_complete_cbc_encrypt(struct crypto_async_request *req);
368 artpec6_crypto_complete_cbc_decrypt(struct crypto_async_request *req);
370 artpec6_crypto_complete_aead(struct crypto_async_request *req);
372 artpec6_crypto_complete_hash(struct crypto_async_request *req);
456 static int artpec6_crypto_submit(struct artpec6_crypto_req_common *req)
464 list_add_tail(&req->list, &ac->pending);
465 artpec6_crypto_start_dma(req);
467 } else if (req->req->flags & CRYPTO_TFM_REQ_MAY_BACKLOG) {
468 list_add_tail(&req->list, &ac->queue);
470 artpec6_crypto_common_destroy(req);
1040 void (*complete)(struct crypto_async_request *req),
1054 common->req = parent;
1085 static int artpec6_crypto_encrypt(struct skcipher_request *req)
1087 struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(req);
1090 void (*complete)(struct crypto_async_request *req);
1093 req_ctx = skcipher_request_ctx(req);
1115 &req->base,
1117 req->dst, req->cryptlen);
1121 ret = artpec6_crypto_prepare_crypto(req);
1130 static int artpec6_crypto_decrypt(struct skcipher_request *req)
1133 struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(req);
1136 void (*complete)(struct crypto_async_request *req);
1138 req_ctx = skcipher_request_ctx(req);
1160 ret = artpec6_crypto_common_init(&req_ctx->common, &req->base,
1162 req->dst, req->cryptlen);
1166 ret = artpec6_crypto_prepare_crypto(req);
1176 artpec6_crypto_ctr_crypt(struct skcipher_request *req, bool encrypt)
1178 struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(req);
1182 (req->iv + iv_len - 4));
1183 unsigned int nblks = ALIGN(req->cryptlen, AES_BLOCK_SIZE) /
1207 skcipher_request_set_callback(subreq, req->base.flags,
1209 skcipher_request_set_crypt(subreq, req->src, req->dst,
1210 req->cryptlen, req->iv);
1218 return encrypt ? artpec6_crypto_encrypt(req)
1219 : artpec6_crypto_decrypt(req);
1222 static int artpec6_crypto_ctr_encrypt(struct skcipher_request *req)
1224 return artpec6_crypto_ctr_crypt(req, true);
1227 static int artpec6_crypto_ctr_decrypt(struct skcipher_request *req)
1229 return artpec6_crypto_ctr_crypt(req, false);
1261 static int artpec6_crypto_aead_encrypt(struct aead_request *req)
1264 struct artpec6_crypto_aead_req_ctx *req_ctx = aead_request_ctx(req);
1267 ret = artpec6_crypto_common_init(&req_ctx->common, &req->base,
1273 ret = artpec6_crypto_prepare_aead(req);
1282 static int artpec6_crypto_aead_decrypt(struct aead_request *req)
1285 struct artpec6_crypto_aead_req_ctx *req_ctx = aead_request_ctx(req);
1288 if (req->cryptlen < AES_BLOCK_SIZE)
1292 &req->base,
1298 ret = artpec6_crypto_prepare_aead(req);
1643 * @req: The asynch request to process
2043 struct artpec6_crypto_req_common *req;
2046 req = list_first_entry(&ac->queue,
2049 list_move_tail(&req->list, &ac->pending);
2050 artpec6_crypto_start_dma(req);
2052 list_add_tail(&req->complete_in_progress, completions);
2080 struct artpec6_crypto_req_common *req;
2095 list_for_each_entry_safe(req, n, &ac->pending, list) {
2096 struct artpec6_crypto_dma_descriptors *dma = req->dma;
2100 stataddr = dma->stat_dma_addr + 4 * (req->dma->in_cnt - 1);
2106 stat = req->dma->stat[req->dma->in_cnt-1];
2111 pr_debug("Request %p status is %X\n", req, stat);
2121 pr_debug("Completing request %p\n", req);
2123 list_move_tail(&req->list, &complete_done);
2135 list_for_each_entry_safe(req, n, &complete_done, list) {
2136 artpec6_crypto_dma_unmap_all(req);
2137 artpec6_crypto_copy_bounce_buffers(req);
2138 artpec6_crypto_common_destroy(req);
2140 req->complete(req->req);
2143 list_for_each_entry_safe(req, n, &complete_in_progress,
2145 req->req->complete(req->req, -EINPROGRESS);
2149 static void artpec6_crypto_complete_crypto(struct crypto_async_request *req)
2151 req->complete(req, 0);
2155 artpec6_crypto_complete_cbc_decrypt(struct crypto_async_request *req)
2157 struct skcipher_request *cipher_req = container_of(req,
2163 req->complete(req, 0);
2167 artpec6_crypto_complete_cbc_encrypt(struct crypto_async_request *req)
2169 struct skcipher_request *cipher_req = container_of(req,
2175 req->complete(req, 0);
2178 static void artpec6_crypto_complete_aead(struct crypto_async_request *req)
2183 struct aead_request *areq = container_of(req,
2213 req->complete(req, result);
2216 static void artpec6_crypto_complete_hash(struct crypto_async_request *req)
2218 req->complete(req, 0);
2257 artpec6_crypto_init_hash(struct ahash_request *req, u8 type, int hmac)
2261 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2290 static int artpec6_crypto_prepare_submit_hash(struct ahash_request *req)
2292 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2297 &req->base,
2305 ret = artpec6_crypto_prepare_hash(req);
2323 static int artpec6_crypto_hash_final(struct ahash_request *req)
2325 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2329 return artpec6_crypto_prepare_submit_hash(req);
2332 static int artpec6_crypto_hash_update(struct ahash_request *req)
2334 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2338 return artpec6_crypto_prepare_submit_hash(req);
2341 static int artpec6_crypto_sha1_init(struct ahash_request *req)
2343 return artpec6_crypto_init_hash(req, ARTPEC6_CRYPTO_HASH_SHA1, 0);
2346 static int artpec6_crypto_sha1_digest(struct ahash_request *req)
2348 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2350 artpec6_crypto_init_hash(req, ARTPEC6_CRYPTO_HASH_SHA1, 0);
2354 return artpec6_crypto_prepare_submit_hash(req);
2357 static int artpec6_crypto_sha256_init(struct ahash_request *req)
2359 return artpec6_crypto_init_hash(req, ARTPEC6_CRYPTO_HASH_SHA256, 0);
2362 static int artpec6_crypto_sha256_digest(struct ahash_request *req)
2364 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2366 artpec6_crypto_init_hash(req, ARTPEC6_CRYPTO_HASH_SHA256, 0);
2369 return artpec6_crypto_prepare_submit_hash(req);
2372 static int artpec6_crypto_hmac_sha256_init(struct ahash_request *req)
2374 return artpec6_crypto_init_hash(req, ARTPEC6_CRYPTO_HASH_SHA256, 1);
2377 static int artpec6_crypto_hmac_sha256_digest(struct ahash_request *req)
2379 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2381 artpec6_crypto_init_hash(req, ARTPEC6_CRYPTO_HASH_SHA256, 1);
2384 return artpec6_crypto_prepare_submit_hash(req);
2432 static int artpec6_crypto_hash_export(struct ahash_request *req, void *out)
2434 const struct artpec6_hash_request_context *ctx = ahash_request_ctx(req);
2460 static int artpec6_crypto_hash_import(struct ahash_request *req, const void *in)
2462 struct artpec6_hash_request_context *ctx = ahash_request_ctx(req);