Lines Matching refs:req
73 static void gcm_calculate_auth_mac(struct aead_request *req, u8 ghash[])
75 struct crypto_aead *aead = crypto_aead_reqtfm(req);
78 u32 assoclen = req->assoclen;
82 scatterwalk_start(&walk, req->src);
137 static int gcm_crypt(struct aead_request *req, struct skcipher_walk *walk,
144 struct crypto_aead *aead = crypto_aead_reqtfm(req);
151 lengths.a = cpu_to_be64(req->assoclen * 8);
154 memcpy(iv, req->iv, GCM_IV_SIZE);
159 if (req->assoclen)
160 gcm_calculate_auth_mac(req, ghash);
198 static int gcm_encrypt(struct aead_request *req)
200 struct crypto_aead *aead = crypto_aead_reqtfm(req);
205 err = skcipher_walk_aead_encrypt(&walk, req, false);
206 err = gcm_crypt(req, &walk, ghash, err, sm4_ce_pmull_gcm_enc);
211 scatterwalk_map_and_copy(ghash, req->dst, req->assoclen + req->cryptlen,
217 static int gcm_decrypt(struct aead_request *req)
219 struct crypto_aead *aead = crypto_aead_reqtfm(req);
226 err = skcipher_walk_aead_decrypt(&walk, req, false);
227 err = gcm_crypt(req, &walk, ghash, err, sm4_ce_pmull_gcm_dec);
232 scatterwalk_map_and_copy(authtag, req->src,
233 req->assoclen + req->cryptlen - authsize,