Lines Matching refs:req

42 static void krb5enc_request_complete(struct aead_request *req, int err)  in krb5enc_request_complete()  argument
45 aead_request_complete(req, err); in krb5enc_request_complete()
128 struct aead_request *req = data; in krb5enc_encrypt_done() local
130 krb5enc_request_complete(req, err); in krb5enc_encrypt_done()
137 static int krb5enc_dispatch_encrypt(struct aead_request *req, in krb5enc_dispatch_encrypt() argument
140 struct crypto_aead *krb5enc = crypto_aead_reqtfm(req); in krb5enc_dispatch_encrypt()
144 struct krb5enc_request_ctx *areq_ctx = aead_request_ctx(req); in krb5enc_dispatch_encrypt()
150 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in krb5enc_dispatch_encrypt()
151 if (req->src == req->dst) in krb5enc_dispatch_encrypt()
154 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in krb5enc_dispatch_encrypt()
157 skcipher_request_set_callback(skreq, aead_request_flags(req), in krb5enc_dispatch_encrypt()
158 krb5enc_encrypt_done, req); in krb5enc_dispatch_encrypt()
159 skcipher_request_set_crypt(skreq, src, dst, req->cryptlen, req->iv); in krb5enc_dispatch_encrypt()
168 static void krb5enc_insert_checksum(struct aead_request *req, u8 *hash) in krb5enc_insert_checksum() argument
170 struct crypto_aead *krb5enc = crypto_aead_reqtfm(req); in krb5enc_insert_checksum()
172 scatterwalk_map_and_copy(hash, req->dst, in krb5enc_insert_checksum()
173 req->assoclen + req->cryptlen, in krb5enc_insert_checksum()
183 struct aead_request *req = data; in krb5enc_encrypt_ahash_done() local
184 struct crypto_aead *krb5enc = crypto_aead_reqtfm(req); in krb5enc_encrypt_ahash_done()
187 struct krb5enc_request_ctx *areq_ctx = aead_request_ctx(req); in krb5enc_encrypt_ahash_done()
191 return krb5enc_request_complete(req, err); in krb5enc_encrypt_ahash_done()
193 krb5enc_insert_checksum(req, ahreq->result); in krb5enc_encrypt_ahash_done()
195 err = krb5enc_dispatch_encrypt(req, 0); in krb5enc_encrypt_ahash_done()
197 aead_request_complete(req, err); in krb5enc_encrypt_ahash_done()
205 static int krb5enc_dispatch_encrypt_hash(struct aead_request *req) in krb5enc_dispatch_encrypt_hash() argument
207 struct crypto_aead *krb5enc = crypto_aead_reqtfm(req); in krb5enc_dispatch_encrypt_hash()
212 struct krb5enc_request_ctx *areq_ctx = aead_request_ctx(req); in krb5enc_dispatch_encrypt_hash()
217 ahash_request_set_callback(ahreq, aead_request_flags(req), in krb5enc_dispatch_encrypt_hash()
218 krb5enc_encrypt_ahash_done, req); in krb5enc_dispatch_encrypt_hash()
220 ahash_request_set_crypt(ahreq, req->src, hash, req->assoclen + req->cryptlen); in krb5enc_dispatch_encrypt_hash()
226 krb5enc_insert_checksum(req, hash); in krb5enc_dispatch_encrypt_hash()
234 static int krb5enc_encrypt(struct aead_request *req) in krb5enc_encrypt() argument
238 err = krb5enc_dispatch_encrypt_hash(req); in krb5enc_encrypt()
242 return krb5enc_dispatch_encrypt(req, aead_request_flags(req)); in krb5enc_encrypt()
245 static int krb5enc_verify_hash(struct aead_request *req) in krb5enc_verify_hash() argument
247 struct crypto_aead *krb5enc = crypto_aead_reqtfm(req); in krb5enc_verify_hash()
250 struct krb5enc_request_ctx *areq_ctx = aead_request_ctx(req); in krb5enc_verify_hash()
256 scatterwalk_map_and_copy(msg_hash, req->src, ahreq->nbytes, authsize, 0); in krb5enc_verify_hash()
265 struct aead_request *req = data; in krb5enc_decrypt_hash_done() local
268 return krb5enc_request_complete(req, err); in krb5enc_decrypt_hash_done()
270 err = krb5enc_verify_hash(req); in krb5enc_decrypt_hash_done()
271 krb5enc_request_complete(req, err); in krb5enc_decrypt_hash_done()
277 static int krb5enc_dispatch_decrypt_hash(struct aead_request *req) in krb5enc_dispatch_decrypt_hash() argument
279 struct crypto_aead *krb5enc = crypto_aead_reqtfm(req); in krb5enc_dispatch_decrypt_hash()
283 struct krb5enc_request_ctx *areq_ctx = aead_request_ctx(req); in krb5enc_dispatch_decrypt_hash()
291 ahash_request_set_crypt(ahreq, req->dst, hash, in krb5enc_dispatch_decrypt_hash()
292 req->assoclen + req->cryptlen - authsize); in krb5enc_dispatch_decrypt_hash()
293 ahash_request_set_callback(ahreq, aead_request_flags(req), in krb5enc_dispatch_decrypt_hash()
294 krb5enc_decrypt_hash_done, req); in krb5enc_dispatch_decrypt_hash()
300 return krb5enc_verify_hash(req); in krb5enc_dispatch_decrypt_hash()
306 static int krb5enc_dispatch_decrypt(struct aead_request *req) in krb5enc_dispatch_decrypt() argument
308 struct crypto_aead *krb5enc = crypto_aead_reqtfm(req); in krb5enc_dispatch_decrypt()
312 struct krb5enc_request_ctx *areq_ctx = aead_request_ctx(req); in krb5enc_dispatch_decrypt()
318 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in krb5enc_dispatch_decrypt()
321 if (req->src != req->dst) in krb5enc_dispatch_decrypt()
322 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in krb5enc_dispatch_decrypt()
325 skcipher_request_set_callback(skreq, aead_request_flags(req), in krb5enc_dispatch_decrypt()
326 req->base.complete, req->base.data); in krb5enc_dispatch_decrypt()
328 req->cryptlen - authsize, req->iv); in krb5enc_dispatch_decrypt()
333 static int krb5enc_decrypt(struct aead_request *req) in krb5enc_decrypt() argument
337 err = krb5enc_dispatch_decrypt(req); in krb5enc_decrypt()
341 return krb5enc_dispatch_decrypt_hash(req); in krb5enc_decrypt()