Lines Matching refs:req

388 static int crypto_aegis128_encrypt_generic(struct aead_request *req)
390 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
394 unsigned int cryptlen = req->cryptlen;
398 skcipher_walk_aead_encrypt(&walk, req, false);
399 crypto_aegis128_init(&state, &ctx->key, req->iv);
400 crypto_aegis128_process_ad(&state, req->src, req->assoclen, false);
403 crypto_aegis128_final(&state, &tag, req->assoclen, cryptlen);
405 scatterwalk_map_and_copy(tag.bytes, req->dst, req->assoclen + cryptlen,
410 static int crypto_aegis128_decrypt_generic(struct aead_request *req)
413 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
416 unsigned int cryptlen = req->cryptlen - authsize;
421 scatterwalk_map_and_copy(tag.bytes, req->src, req->assoclen + cryptlen,
424 skcipher_walk_aead_decrypt(&walk, req, false);
425 crypto_aegis128_init(&state, &ctx->key, req->iv);
426 crypto_aegis128_process_ad(&state, req->src, req->assoclen, false);
429 crypto_aegis128_final(&state, &tag, req->assoclen, cryptlen);
440 skcipher_walk_aead_decrypt(&walk, req, false);
449 static int crypto_aegis128_encrypt_simd(struct aead_request *req)
451 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
455 unsigned int cryptlen = req->cryptlen;
460 return crypto_aegis128_encrypt_generic(req);
462 skcipher_walk_aead_encrypt(&walk, req, false);
463 crypto_aegis128_init_simd(&state, &ctx->key, req->iv);
464 crypto_aegis128_process_ad(&state, req->src, req->assoclen, true);
467 crypto_aegis128_final_simd(&state, &tag, req->assoclen, cryptlen, 0);
469 scatterwalk_map_and_copy(tag.bytes, req->dst, req->assoclen + cryptlen,
474 static int crypto_aegis128_decrypt_simd(struct aead_request *req)
476 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
479 unsigned int cryptlen = req->cryptlen - authsize;
485 return crypto_aegis128_decrypt_generic(req);
487 scatterwalk_map_and_copy(tag.bytes, req->src, req->assoclen + cryptlen,
490 skcipher_walk_aead_decrypt(&walk, req, false);
491 crypto_aegis128_init_simd(&state, &ctx->key, req->iv);
492 crypto_aegis128_process_ad(&state, req->src, req->assoclen, true);
496 if (unlikely(crypto_aegis128_final_simd(&state, &tag, req->assoclen,
498 skcipher_walk_aead_decrypt(&walk, req, false);