Lines Matching refs:req

126 		struct skcipher_request req; /* must be last */  in adiantum_setkey()  member
148 skcipher_request_set_tfm(&data->req, tctx->streamcipher); in adiantum_setkey()
149 skcipher_request_set_callback(&data->req, CRYPTO_TFM_REQ_MAY_SLEEP | in adiantum_setkey()
152 skcipher_request_set_crypt(&data->req, &data->sg, &data->sg, in adiantum_setkey()
154 err = crypto_wait_req(crypto_skcipher_encrypt(&data->req), &data->wait); in adiantum_setkey()
219 static void adiantum_hash_header(struct skcipher_request *req) in adiantum_hash_header() argument
221 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in adiantum_hash_header()
223 struct adiantum_request_ctx *rctx = skcipher_request_ctx(req); in adiantum_hash_header()
224 const unsigned int bulk_len = req->cryptlen - BLOCKCIPHER_BLOCK_SIZE; in adiantum_hash_header()
240 poly1305_core_blocks(&state, &tctx->header_hash_key, req->iv, in adiantum_hash_header()
247 static int adiantum_hash_message(struct skcipher_request *req, in adiantum_hash_message() argument
251 struct adiantum_request_ctx *rctx = skcipher_request_ctx(req); in adiantum_hash_message()
252 const unsigned int bulk_len = req->cryptlen - BLOCKCIPHER_BLOCK_SIZE; in adiantum_hash_message()
278 static int adiantum_finish(struct skcipher_request *req) in adiantum_finish() argument
280 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in adiantum_finish()
282 struct adiantum_request_ctx *rctx = skcipher_request_ctx(req); in adiantum_finish()
283 const unsigned int bulk_len = req->cryptlen - BLOCKCIPHER_BLOCK_SIZE; in adiantum_finish()
284 struct scatterlist *dst = req->dst; in adiantum_finish()
301 if (dst_nents == 1 && dst->offset + req->cryptlen <= PAGE_SIZE) { in adiantum_finish()
318 err = adiantum_hash_message(req, dst, dst_nents, &digest); in adiantum_finish()
330 struct skcipher_request *req = data; in adiantum_streamcipher_done() local
333 err = adiantum_finish(req); in adiantum_streamcipher_done()
335 skcipher_request_complete(req, err); in adiantum_streamcipher_done()
338 static int adiantum_crypt(struct skcipher_request *req, bool enc) in adiantum_crypt() argument
340 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in adiantum_crypt()
342 struct adiantum_request_ctx *rctx = skcipher_request_ctx(req); in adiantum_crypt()
343 const unsigned int bulk_len = req->cryptlen - BLOCKCIPHER_BLOCK_SIZE; in adiantum_crypt()
344 struct scatterlist *src = req->src; in adiantum_crypt()
350 if (req->cryptlen < BLOCKCIPHER_BLOCK_SIZE) in adiantum_crypt()
360 adiantum_hash_header(req); in adiantum_crypt()
362 if (src_nents == 1 && src->offset + req->cryptlen <= PAGE_SIZE) { in adiantum_crypt()
372 err = adiantum_hash_message(req, src, src_nents, &digest); in adiantum_crypt()
404 if (round_up(stream_len, CHACHA_BLOCK_SIZE) <= req->cryptlen) in adiantum_crypt()
408 skcipher_request_set_crypt(&rctx->u.streamcipher_req, req->src, in adiantum_crypt()
409 req->dst, stream_len, &rctx->rbuf); in adiantum_crypt()
411 req->base.flags, in adiantum_crypt()
412 adiantum_streamcipher_done, req); in adiantum_crypt()
414 adiantum_finish(req); in adiantum_crypt()
417 static int adiantum_encrypt(struct skcipher_request *req) in adiantum_encrypt() argument
419 return adiantum_crypt(req, true); in adiantum_encrypt()
422 static int adiantum_decrypt(struct skcipher_request *req) in adiantum_decrypt() argument
424 return adiantum_crypt(req, false); in adiantum_decrypt()