Lines Matching refs:req

125 		struct skcipher_request req; /* must be last */
147 skcipher_request_set_tfm(&data->req, tctx->streamcipher);
148 skcipher_request_set_callback(&data->req, CRYPTO_TFM_REQ_MAY_SLEEP |
151 skcipher_request_set_crypt(&data->req, &data->sg, &data->sg,
153 err = crypto_wait_req(crypto_skcipher_encrypt(&data->req), &data->wait);
218 static void adiantum_hash_header(struct skcipher_request *req)
220 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
222 struct adiantum_request_ctx *rctx = skcipher_request_ctx(req);
223 const unsigned int bulk_len = req->cryptlen - BLOCKCIPHER_BLOCK_SIZE;
239 poly1305_core_blocks(&state, &tctx->header_hash_key, req->iv,
246 static int adiantum_hash_message(struct skcipher_request *req,
249 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
251 struct adiantum_request_ctx *rctx = skcipher_request_ctx(req);
252 const unsigned int bulk_len = req->cryptlen - BLOCKCIPHER_BLOCK_SIZE;
281 static int adiantum_finish(struct skcipher_request *req)
283 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
285 struct adiantum_request_ctx *rctx = skcipher_request_ctx(req);
286 const unsigned int bulk_len = req->cryptlen - BLOCKCIPHER_BLOCK_SIZE;
300 err = adiantum_hash_message(req, req->dst, &digest);
305 scatterwalk_map_and_copy(&rctx->rbuf.bignum, req->dst,
313 struct skcipher_request *req = areq->data;
316 err = adiantum_finish(req);
318 skcipher_request_complete(req, err);
321 static int adiantum_crypt(struct skcipher_request *req, bool enc)
323 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
325 struct adiantum_request_ctx *rctx = skcipher_request_ctx(req);
326 const unsigned int bulk_len = req->cryptlen - BLOCKCIPHER_BLOCK_SIZE;
331 if (req->cryptlen < BLOCKCIPHER_BLOCK_SIZE)
341 adiantum_hash_header(req);
342 err = adiantum_hash_message(req, req->src, &digest);
346 scatterwalk_map_and_copy(&rctx->rbuf.bignum, req->src,
373 if (round_up(stream_len, CHACHA_BLOCK_SIZE) <= req->cryptlen)
377 skcipher_request_set_crypt(&rctx->u.streamcipher_req, req->src,
378 req->dst, stream_len, &rctx->rbuf);
380 req->base.flags,
381 adiantum_streamcipher_done, req);
383 adiantum_finish(req);
386 static int adiantum_encrypt(struct skcipher_request *req)
388 return adiantum_crypt(req, true);
391 static int adiantum_decrypt(struct skcipher_request *req)
393 return adiantum_crypt(req, false);