Lines Matching refs:req
131 int crypto_hash_walk_first(struct ahash_request *req, in crypto_hash_walk_first() argument
134 walk->total = req->nbytes; in crypto_hash_walk_first()
141 walk->alignmask = crypto_ahash_alignmask(crypto_ahash_reqtfm(req)); in crypto_hash_walk_first()
142 walk->sg = req->src; in crypto_hash_walk_first()
143 walk->flags = req->base.flags & CRYPTO_TFM_REQ_MASK; in crypto_hash_walk_first()
149 int crypto_ahash_walk_first(struct ahash_request *req, in crypto_ahash_walk_first() argument
152 walk->total = req->nbytes; in crypto_ahash_walk_first()
159 walk->alignmask = crypto_ahash_alignmask(crypto_ahash_reqtfm(req)); in crypto_ahash_walk_first()
160 walk->sg = req->src; in crypto_ahash_walk_first()
161 walk->flags = req->base.flags & CRYPTO_TFM_REQ_MASK; in crypto_ahash_walk_first()
232 static int ahash_save_req(struct ahash_request *req, crypto_completion_t cplt) in ahash_save_req() argument
234 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ahash_save_req()
240 (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ? in ahash_save_req()
270 priv->result = req->result; in ahash_save_req()
271 priv->complete = req->base.complete; in ahash_save_req()
272 priv->data = req->base.data; in ahash_save_req()
279 req->result = PTR_ALIGN((u8 *)priv->ubuf, alignmask + 1); in ahash_save_req()
280 req->base.complete = cplt; in ahash_save_req()
281 req->base.data = req; in ahash_save_req()
282 req->priv = priv; in ahash_save_req()
287 static void ahash_restore_req(struct ahash_request *req) in ahash_restore_req() argument
289 struct ahash_request_priv *priv = req->priv; in ahash_restore_req()
292 req->result = priv->result; in ahash_restore_req()
293 req->base.complete = priv->complete; in ahash_restore_req()
294 req->base.data = priv->data; in ahash_restore_req()
295 req->priv = NULL; in ahash_restore_req()
301 static void ahash_op_unaligned_finish(struct ahash_request *req, int err) in ahash_op_unaligned_finish() argument
303 struct ahash_request_priv *priv = req->priv; in ahash_op_unaligned_finish()
309 memcpy(priv->result, req->result, in ahash_op_unaligned_finish()
310 crypto_ahash_digestsize(crypto_ahash_reqtfm(req))); in ahash_op_unaligned_finish()
312 ahash_restore_req(req); in ahash_op_unaligned_finish()
315 static void ahash_op_unaligned_done(struct crypto_async_request *req, int err) in ahash_op_unaligned_done() argument
317 struct ahash_request *areq = req->data; in ahash_op_unaligned_done()
335 static int ahash_op_unaligned(struct ahash_request *req, in ahash_op_unaligned() argument
340 err = ahash_save_req(req, ahash_op_unaligned_done); in ahash_op_unaligned()
344 err = op(req); in ahash_op_unaligned()
345 ahash_op_unaligned_finish(req, err); in ahash_op_unaligned()
350 static int crypto_ahash_op(struct ahash_request *req, in crypto_ahash_op() argument
353 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_op()
356 if ((unsigned long)req->result & alignmask) in crypto_ahash_op()
357 return ahash_op_unaligned(req, op); in crypto_ahash_op()
359 return op(req); in crypto_ahash_op()
362 int crypto_ahash_final(struct ahash_request *req) in crypto_ahash_final() argument
364 return crypto_ahash_op(req, crypto_ahash_reqtfm(req)->final); in crypto_ahash_final()
368 int crypto_ahash_finup(struct ahash_request *req) in crypto_ahash_finup() argument
370 return crypto_ahash_op(req, crypto_ahash_reqtfm(req)->finup); in crypto_ahash_finup()
374 int crypto_ahash_digest(struct ahash_request *req) in crypto_ahash_digest() argument
376 return crypto_ahash_op(req, crypto_ahash_reqtfm(req)->digest); in crypto_ahash_digest()
380 static void ahash_def_finup_finish2(struct ahash_request *req, int err) in ahash_def_finup_finish2() argument
382 struct ahash_request_priv *priv = req->priv; in ahash_def_finup_finish2()
388 memcpy(priv->result, req->result, in ahash_def_finup_finish2()
389 crypto_ahash_digestsize(crypto_ahash_reqtfm(req))); in ahash_def_finup_finish2()
391 ahash_restore_req(req); in ahash_def_finup_finish2()
394 static void ahash_def_finup_done2(struct crypto_async_request *req, int err) in ahash_def_finup_done2() argument
396 struct ahash_request *areq = req->data; in ahash_def_finup_done2()
403 static int ahash_def_finup_finish1(struct ahash_request *req, int err) in ahash_def_finup_finish1() argument
408 req->base.complete = ahash_def_finup_done2; in ahash_def_finup_finish1()
409 req->base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; in ahash_def_finup_finish1()
410 err = crypto_ahash_reqtfm(req)->final(req); in ahash_def_finup_finish1()
413 ahash_def_finup_finish2(req, err); in ahash_def_finup_finish1()
417 static void ahash_def_finup_done1(struct crypto_async_request *req, int err) in ahash_def_finup_done1() argument
419 struct ahash_request *areq = req->data; in ahash_def_finup_done1()
426 static int ahash_def_finup(struct ahash_request *req) in ahash_def_finup() argument
428 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ahash_def_finup()
431 err = ahash_save_req(req, ahash_def_finup_done1); in ahash_def_finup()
435 err = tfm->update(req); in ahash_def_finup()
436 return ahash_def_finup_finish1(req, err); in ahash_def_finup()
439 static int ahash_no_export(struct ahash_request *req, void *out) in ahash_no_export() argument
444 static int ahash_no_import(struct ahash_request *req, const void *in) in ahash_no_import() argument