Lines Matching refs:rctx

74 		struct chachapoly_req_ctx *rctx = aead_request_ctx(req);  in async_done_continue()  local
76 rctx->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; in async_done_continue()
97 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in poly_verify_tag() local
98 u8 tag[sizeof(rctx->tag)]; in poly_verify_tag()
101 req->assoclen + rctx->cryptlen, in poly_verify_tag()
103 if (crypto_memneq(tag, rctx->tag, sizeof(tag))) in poly_verify_tag()
110 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in poly_copy_tag() local
112 scatterwalk_map_and_copy(rctx->tag, req->dst, in poly_copy_tag()
113 req->assoclen + rctx->cryptlen, in poly_copy_tag()
114 sizeof(rctx->tag), 1); in poly_copy_tag()
126 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in chacha_decrypt() local
127 struct chacha_req *creq = &rctx->u.chacha; in chacha_decrypt()
131 if (rctx->cryptlen == 0) in chacha_decrypt()
136 src = scatterwalk_ffwd(rctx->src, req->src, req->assoclen); in chacha_decrypt()
139 dst = scatterwalk_ffwd(rctx->dst, req->dst, req->assoclen); in chacha_decrypt()
141 skcipher_request_set_callback(&creq->req, rctx->flags, in chacha_decrypt()
145 rctx->cryptlen, creq->iv); in chacha_decrypt()
156 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in poly_tail_continue() local
158 if (rctx->cryptlen == req->cryptlen) /* encrypting */ in poly_tail_continue()
173 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in poly_tail() local
174 struct poly_req *preq = &rctx->u.poly; in poly_tail()
177 preq->tail.assoclen = cpu_to_le64(rctx->assoclen); in poly_tail()
178 preq->tail.cryptlen = cpu_to_le64(rctx->cryptlen); in poly_tail()
181 ahash_request_set_callback(&preq->req, rctx->flags, in poly_tail()
185 rctx->tag, sizeof(preq->tail)); in poly_tail()
202 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in poly_cipherpad() local
203 struct poly_req *preq = &rctx->u.poly; in poly_cipherpad()
207 padlen = -rctx->cryptlen % POLY1305_BLOCK_SIZE; in poly_cipherpad()
211 ahash_request_set_callback(&preq->req, rctx->flags, in poly_cipherpad()
231 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in poly_cipher() local
232 struct poly_req *preq = &rctx->u.poly; in poly_cipher()
236 if (rctx->cryptlen == req->cryptlen) /* encrypting */ in poly_cipher()
239 crypt = scatterwalk_ffwd(rctx->src, crypt, req->assoclen); in poly_cipher()
241 ahash_request_set_callback(&preq->req, rctx->flags, in poly_cipher()
244 ahash_request_set_crypt(&preq->req, crypt, NULL, rctx->cryptlen); in poly_cipher()
261 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in poly_adpad() local
262 struct poly_req *preq = &rctx->u.poly; in poly_adpad()
266 padlen = -rctx->assoclen % POLY1305_BLOCK_SIZE; in poly_adpad()
270 ahash_request_set_callback(&preq->req, rctx->flags, in poly_adpad()
290 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in poly_ad() local
291 struct poly_req *preq = &rctx->u.poly; in poly_ad()
294 ahash_request_set_callback(&preq->req, rctx->flags, in poly_ad()
297 ahash_request_set_crypt(&preq->req, req->src, NULL, rctx->assoclen); in poly_ad()
314 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in poly_setkey() local
315 struct poly_req *preq = &rctx->u.poly; in poly_setkey()
318 sg_init_one(preq->src, rctx->key, sizeof(rctx->key)); in poly_setkey()
320 ahash_request_set_callback(&preq->req, rctx->flags, in poly_setkey()
323 ahash_request_set_crypt(&preq->req, preq->src, NULL, sizeof(rctx->key)); in poly_setkey()
340 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in poly_init() local
341 struct poly_req *preq = &rctx->u.poly; in poly_init()
344 ahash_request_set_callback(&preq->req, rctx->flags, in poly_init()
364 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in poly_genkey() local
365 struct chacha_req *creq = &rctx->u.chacha; in poly_genkey()
368 rctx->assoclen = req->assoclen; in poly_genkey()
371 if (rctx->assoclen < 8) in poly_genkey()
373 rctx->assoclen -= 8; in poly_genkey()
376 memset(rctx->key, 0, sizeof(rctx->key)); in poly_genkey()
377 sg_init_one(creq->src, rctx->key, sizeof(rctx->key)); in poly_genkey()
381 skcipher_request_set_callback(&creq->req, rctx->flags, in poly_genkey()
402 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in chacha_encrypt() local
403 struct chacha_req *creq = &rctx->u.chacha; in chacha_encrypt()
412 src = scatterwalk_ffwd(rctx->src, req->src, req->assoclen); in chacha_encrypt()
415 dst = scatterwalk_ffwd(rctx->dst, req->dst, req->assoclen); in chacha_encrypt()
417 skcipher_request_set_callback(&creq->req, rctx->flags, in chacha_encrypt()
432 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in chachapoly_encrypt() local
434 rctx->cryptlen = req->cryptlen; in chachapoly_encrypt()
435 rctx->flags = aead_request_flags(req); in chachapoly_encrypt()
454 struct chachapoly_req_ctx *rctx = aead_request_ctx(req); in chachapoly_decrypt() local
456 rctx->cryptlen = req->cryptlen - POLY1305_DIGEST_SIZE; in chachapoly_decrypt()
457 rctx->flags = aead_request_flags(req); in chachapoly_decrypt()