Lines Matching refs:req
180 static int ppc_ecb_crypt(struct skcipher_request *req, bool enc) in ppc_ecb_crypt() argument
182 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in ppc_ecb_crypt()
188 err = skcipher_walk_virt(&walk, req, false); in ppc_ecb_crypt()
209 static int ppc_ecb_encrypt(struct skcipher_request *req) in ppc_ecb_encrypt() argument
211 return ppc_ecb_crypt(req, true); in ppc_ecb_encrypt()
214 static int ppc_ecb_decrypt(struct skcipher_request *req) in ppc_ecb_decrypt() argument
216 return ppc_ecb_crypt(req, false); in ppc_ecb_decrypt()
219 static int ppc_cbc_crypt(struct skcipher_request *req, bool enc) in ppc_cbc_crypt() argument
221 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in ppc_cbc_crypt()
227 err = skcipher_walk_virt(&walk, req, false); in ppc_cbc_crypt()
250 static int ppc_cbc_encrypt(struct skcipher_request *req) in ppc_cbc_encrypt() argument
252 return ppc_cbc_crypt(req, true); in ppc_cbc_encrypt()
255 static int ppc_cbc_decrypt(struct skcipher_request *req) in ppc_cbc_decrypt() argument
257 return ppc_cbc_crypt(req, false); in ppc_cbc_decrypt()
260 static int ppc_ctr_crypt(struct skcipher_request *req) in ppc_ctr_crypt() argument
262 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in ppc_ctr_crypt()
268 err = skcipher_walk_virt(&walk, req, false); in ppc_ctr_crypt()
286 static int ppc_xts_crypt(struct skcipher_request *req, bool enc) in ppc_xts_crypt() argument
288 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in ppc_xts_crypt()
295 err = skcipher_walk_virt(&walk, req, false); in ppc_xts_crypt()
320 static int ppc_xts_encrypt(struct skcipher_request *req) in ppc_xts_encrypt() argument
322 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in ppc_xts_encrypt()
324 int tail = req->cryptlen % AES_BLOCK_SIZE; in ppc_xts_encrypt()
325 int offset = req->cryptlen - tail - AES_BLOCK_SIZE; in ppc_xts_encrypt()
330 if (req->cryptlen < AES_BLOCK_SIZE) in ppc_xts_encrypt()
334 subreq = *req; in ppc_xts_encrypt()
335 skcipher_request_set_crypt(&subreq, req->src, req->dst, in ppc_xts_encrypt()
336 req->cryptlen - tail, req->iv); in ppc_xts_encrypt()
337 req = &subreq; in ppc_xts_encrypt()
340 err = ppc_xts_crypt(req, true); in ppc_xts_encrypt()
344 scatterwalk_map_and_copy(b[0], req->dst, offset, AES_BLOCK_SIZE, 0); in ppc_xts_encrypt()
346 scatterwalk_map_and_copy(b[0], req->src, offset + AES_BLOCK_SIZE, tail, 0); in ppc_xts_encrypt()
350 req->iv, NULL); in ppc_xts_encrypt()
353 scatterwalk_map_and_copy(b[0], req->dst, offset, AES_BLOCK_SIZE + tail, 1); in ppc_xts_encrypt()
358 static int ppc_xts_decrypt(struct skcipher_request *req) in ppc_xts_decrypt() argument
360 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in ppc_xts_decrypt()
362 int tail = req->cryptlen % AES_BLOCK_SIZE; in ppc_xts_decrypt()
363 int offset = req->cryptlen - tail - AES_BLOCK_SIZE; in ppc_xts_decrypt()
369 if (req->cryptlen < AES_BLOCK_SIZE) in ppc_xts_decrypt()
373 subreq = *req; in ppc_xts_decrypt()
374 skcipher_request_set_crypt(&subreq, req->src, req->dst, in ppc_xts_decrypt()
375 offset, req->iv); in ppc_xts_decrypt()
376 req = &subreq; in ppc_xts_decrypt()
379 err = ppc_xts_crypt(req, false); in ppc_xts_decrypt()
383 scatterwalk_map_and_copy(b[1], req->src, offset, AES_BLOCK_SIZE + tail, 0); in ppc_xts_decrypt()
387 ppc_encrypt_ecb(req->iv, req->iv, ctx->key_twk, ctx->rounds, in ppc_xts_decrypt()
390 gf128mul_x_ble(&twk, (le128 *)req->iv); in ppc_xts_decrypt()
397 req->iv, NULL); in ppc_xts_decrypt()
400 scatterwalk_map_and_copy(b[0], req->dst, offset, AES_BLOCK_SIZE + tail, 1); in ppc_xts_decrypt()