/crypto/ |
D | gcm.c | 63 void (*complete)(struct aead_request *req, int err); 86 struct aead_request *req) in crypto_gcm_reqctx() argument 88 unsigned long align = crypto_aead_alignmask(crypto_aead_reqtfm(req)); in crypto_gcm_reqctx() 90 return (void *)PTR_ALIGN((u8 *)aead_request_ctx(req), align + 1); in crypto_gcm_reqctx() 93 static void crypto_gcm_setkey_done(struct crypto_async_request *req, int err) in crypto_gcm_setkey_done() argument 95 struct crypto_gcm_setkey_result *result = req->data; in crypto_gcm_setkey_done() 117 struct ablkcipher_request req; in crypto_gcm_setkey() member 139 ablkcipher_request_set_tfm(&data->req, ctr); in crypto_gcm_setkey() 140 ablkcipher_request_set_callback(&data->req, CRYPTO_TFM_REQ_MAY_SLEEP | in crypto_gcm_setkey() 144 ablkcipher_request_set_crypt(&data->req, data->sg, data->sg, in crypto_gcm_setkey() [all …]
|
D | authenc.c | 26 typedef u8 *(*authenc_ahash_t)(struct aead_request *req, unsigned int flags); 49 static void authenc_request_complete(struct aead_request *req, int err) in authenc_request_complete() argument 52 aead_request_complete(req, err); in authenc_request_complete() 113 struct aead_request *req = areq->data; in authenc_geniv_ahash_update_done() local 114 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in authenc_geniv_ahash_update_done() 116 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in authenc_geniv_ahash_update_done() 124 ahash_request_set_callback(ahreq, aead_request_flags(req) & in authenc_geniv_ahash_update_done() 126 areq_ctx->complete, req); in authenc_geniv_ahash_update_done() 137 authenc_request_complete(req, err); in authenc_geniv_ahash_update_done() 142 struct aead_request *req = areq->data; in authenc_geniv_ahash_done() local [all …]
|
D | authencesn.c | 53 static void authenc_esn_request_complete(struct aead_request *req, int err) in authenc_esn_request_complete() argument 56 aead_request_complete(req, err); in authenc_esn_request_complete() 117 struct aead_request *req = areq->data; in authenc_esn_geniv_ahash_update_done() local 118 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); in authenc_esn_geniv_ahash_update_done() 120 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req); in authenc_esn_geniv_ahash_update_done() 128 ahash_request_set_callback(ahreq, aead_request_flags(req) & in authenc_esn_geniv_ahash_update_done() 130 areq_ctx->update_complete2, req); in authenc_esn_geniv_ahash_update_done() 138 ahash_request_set_callback(ahreq, aead_request_flags(req) & in authenc_esn_geniv_ahash_update_done() 140 areq_ctx->complete, req); in authenc_esn_geniv_ahash_update_done() 151 authenc_esn_request_complete(req, err); in authenc_esn_geniv_ahash_update_done() [all …]
|
D | zlib.c | 144 struct comp_request *req) in zlib_compress_update() argument 150 pr_debug("avail_in %u, avail_out %u\n", req->avail_in, req->avail_out); in zlib_compress_update() 151 stream->next_in = req->next_in; in zlib_compress_update() 152 stream->avail_in = req->avail_in; in zlib_compress_update() 153 stream->next_out = req->next_out; in zlib_compress_update() 154 stream->avail_out = req->avail_out; in zlib_compress_update() 170 ret = req->avail_out - stream->avail_out; in zlib_compress_update() 173 req->avail_in - stream->avail_in, ret); in zlib_compress_update() 174 req->next_in = stream->next_in; in zlib_compress_update() 175 req->avail_in = stream->avail_in; in zlib_compress_update() [all …]
|
D | ahash.c | 117 int crypto_hash_walk_first(struct ahash_request *req, in crypto_hash_walk_first() argument 120 walk->total = req->nbytes; in crypto_hash_walk_first() 125 walk->alignmask = crypto_ahash_alignmask(crypto_ahash_reqtfm(req)); in crypto_hash_walk_first() 126 walk->sg = req->src; in crypto_hash_walk_first() 127 walk->flags = req->base.flags; in crypto_hash_walk_first() 193 static void ahash_op_unaligned_finish(struct ahash_request *req, int err) in ahash_op_unaligned_finish() argument 195 struct ahash_request_priv *priv = req->priv; in ahash_op_unaligned_finish() 201 memcpy(priv->result, req->result, in ahash_op_unaligned_finish() 202 crypto_ahash_digestsize(crypto_ahash_reqtfm(req))); in ahash_op_unaligned_finish() 207 static void ahash_op_unaligned_done(struct crypto_async_request *req, int err) in ahash_op_unaligned_done() argument [all …]
|
D | chainiv.c | 48 static int chainiv_givencrypt(struct skcipher_givcrypt_request *req) in chainiv_givencrypt() argument 50 struct crypto_ablkcipher *geniv = skcipher_givcrypt_reqtfm(req); in chainiv_givencrypt() 52 struct ablkcipher_request *subreq = skcipher_givcrypt_reqctx(req); in chainiv_givencrypt() 57 ablkcipher_request_set_callback(subreq, req->creq.base.flags & in chainiv_givencrypt() 59 req->creq.base.complete, in chainiv_givencrypt() 60 req->creq.base.data); in chainiv_givencrypt() 61 ablkcipher_request_set_crypt(subreq, req->creq.src, req->creq.dst, in chainiv_givencrypt() 62 req->creq.nbytes, req->creq.info); in chainiv_givencrypt() 68 memcpy(req->giv, ctx->iv, ivsize); in chainiv_givencrypt() 83 static int chainiv_givencrypt_first(struct skcipher_givcrypt_request *req) in chainiv_givencrypt_first() argument [all …]
|
D | seqiv.c | 32 static void seqiv_complete2(struct skcipher_givcrypt_request *req, int err) in seqiv_complete2() argument 34 struct ablkcipher_request *subreq = skcipher_givcrypt_reqctx(req); in seqiv_complete2() 43 geniv = skcipher_givcrypt_reqtfm(req); in seqiv_complete2() 44 memcpy(req->creq.info, subreq->info, crypto_ablkcipher_ivsize(geniv)); in seqiv_complete2() 52 struct skcipher_givcrypt_request *req = base->data; in seqiv_complete() local 54 seqiv_complete2(req, err); in seqiv_complete() 55 skcipher_givcrypt_complete(req, err); in seqiv_complete() 58 static void seqiv_aead_complete2(struct aead_givcrypt_request *req, int err) in seqiv_aead_complete2() argument 60 struct aead_request *subreq = aead_givcrypt_reqctx(req); in seqiv_aead_complete2() 69 geniv = aead_givcrypt_reqtfm(req); in seqiv_aead_complete2() [all …]
|
D | cryptd.c | 137 struct crypto_async_request *req, *backlog; in cryptd_queue_worker() local 149 req = crypto_dequeue_request(&cpu_queue->queue); in cryptd_queue_worker() 153 if (!req) in cryptd_queue_worker() 158 req->complete(req, 0); in cryptd_queue_worker() 187 static void cryptd_blkcipher_crypt(struct ablkcipher_request *req, in cryptd_blkcipher_crypt() argument 198 rctx = ablkcipher_request_ctx(req); in cryptd_blkcipher_crypt() 204 desc.info = req->info; in cryptd_blkcipher_crypt() 207 err = crypt(&desc, req->dst, req->src, req->nbytes); in cryptd_blkcipher_crypt() 209 req->base.complete = rctx->complete; in cryptd_blkcipher_crypt() 213 rctx->complete(&req->base, err); in cryptd_blkcipher_crypt() [all …]
|
D | ccm.c | 51 struct aead_request *req) in crypto_ccm_reqctx() argument 53 unsigned long align = crypto_aead_alignmask(crypto_aead_reqtfm(req)); in crypto_ccm_reqctx() 55 return (void *)PTR_ALIGN((u8 *)aead_request_ctx(req), align + 1); in crypto_ccm_reqctx() 123 static int format_input(u8 *info, struct aead_request *req, in format_input() argument 126 struct crypto_aead *aead = crypto_aead_reqtfm(req); in format_input() 127 unsigned int lp = req->iv[0]; in format_input() 133 memcpy(info, req->iv, 16); in format_input() 139 if (req->assoclen) in format_input() 245 static int crypto_ccm_auth(struct aead_request *req, struct scatterlist *plain, in crypto_ccm_auth() argument 248 struct crypto_aead *aead = crypto_aead_reqtfm(req); in crypto_ccm_auth() [all …]
|
D | ablk_helper.c | 54 int __ablk_encrypt(struct ablkcipher_request *req) in __ablk_encrypt() argument 56 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in __ablk_encrypt() 61 desc.info = req->info; in __ablk_encrypt() 65 &desc, req->dst, req->src, req->nbytes); in __ablk_encrypt() 69 int ablk_encrypt(struct ablkcipher_request *req) in ablk_encrypt() argument 71 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in ablk_encrypt() 76 ablkcipher_request_ctx(req); in ablk_encrypt() 78 *cryptd_req = *req; in ablk_encrypt() 83 return __ablk_encrypt(req); in ablk_encrypt() 88 int ablk_decrypt(struct ablkcipher_request *req) in ablk_decrypt() argument [all …]
|
D | eseqiv.c | 42 static void eseqiv_complete2(struct skcipher_givcrypt_request *req) in eseqiv_complete2() argument 44 struct crypto_ablkcipher *geniv = skcipher_givcrypt_reqtfm(req); in eseqiv_complete2() 45 struct eseqiv_request_ctx *reqctx = skcipher_givcrypt_reqctx(req); in eseqiv_complete2() 47 memcpy(req->giv, PTR_ALIGN((u8 *)reqctx->tail, in eseqiv_complete2() 54 struct skcipher_givcrypt_request *req = base->data; in eseqiv_complete() local 59 eseqiv_complete2(req); in eseqiv_complete() 62 skcipher_givcrypt_complete(req, err); in eseqiv_complete() 65 static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req) in eseqiv_givencrypt() argument 67 struct crypto_ablkcipher *geniv = skcipher_givcrypt_reqtfm(req); in eseqiv_givencrypt() 69 struct eseqiv_request_ctx *reqctx = skcipher_givcrypt_reqctx(req); in eseqiv_givencrypt() [all …]
|
D | pcrypt.c | 120 struct aead_request *req = pcrypt_request_ctx(preq); in pcrypt_aead_serial() local 122 aead_request_complete(req->base.data, padata->info); in pcrypt_aead_serial() 128 struct aead_givcrypt_request *req = pcrypt_request_ctx(preq); in pcrypt_aead_giv_serial() local 130 aead_request_complete(req->areq.base.data, padata->info); in pcrypt_aead_giv_serial() 135 struct aead_request *req = areq->data; in pcrypt_aead_done() local 136 struct pcrypt_request *preq = aead_request_ctx(req); in pcrypt_aead_done() 140 req->base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; in pcrypt_aead_done() 148 struct aead_request *req = pcrypt_request_ctx(preq); in pcrypt_aead_enc() local 150 padata->info = crypto_aead_encrypt(req); in pcrypt_aead_enc() 158 static int pcrypt_aead_encrypt(struct aead_request *req) in pcrypt_aead_encrypt() argument [all …]
|
D | algif_hash.c | 34 struct ahash_request req; member 54 err = crypto_ahash_init(&ctx->req); in hash_sendmsg() 76 ahash_request_set_crypt(&ctx->req, ctx->sgl.sg, NULL, in hash_sendmsg() 80 crypto_ahash_update(&ctx->req), in hash_sendmsg() 98 ahash_request_set_crypt(&ctx->req, NULL, ctx->result, 0); in hash_sendmsg() 99 err = af_alg_wait_for_completion(crypto_ahash_final(&ctx->req), in hash_sendmsg() 121 ahash_request_set_crypt(&ctx->req, ctx->sgl.sg, ctx->result, size); in hash_sendpage() 125 err = crypto_ahash_finup(&ctx->req); in hash_sendpage() 127 err = crypto_ahash_digest(&ctx->req); in hash_sendpage() 130 err = crypto_ahash_init(&ctx->req); in hash_sendpage() [all …]
|
D | shash.c | 208 static int shash_async_init(struct ahash_request *req) in shash_async_init() argument 210 struct crypto_shash **ctx = crypto_ahash_ctx(crypto_ahash_reqtfm(req)); in shash_async_init() 211 struct shash_desc *desc = ahash_request_ctx(req); in shash_async_init() 214 desc->flags = req->base.flags; in shash_async_init() 219 int shash_ahash_update(struct ahash_request *req, struct shash_desc *desc) in shash_ahash_update() argument 224 for (nbytes = crypto_hash_walk_first(req, &walk); nbytes > 0; in shash_ahash_update() 232 static int shash_async_update(struct ahash_request *req) in shash_async_update() argument 234 return shash_ahash_update(req, ahash_request_ctx(req)); in shash_async_update() 237 static int shash_async_final(struct ahash_request *req) in shash_async_final() argument 239 return crypto_shash_final(ahash_request_ctx(req), req->result); in shash_async_final() [all …]
|
D | tcrypt.c | 477 static void tcrypt_complete(struct crypto_async_request *req, int err) in tcrypt_complete() argument 479 struct tcrypt_result *res = req->data; in tcrypt_complete() 488 static inline int do_one_ahash_op(struct ahash_request *req, int ret) in do_one_ahash_op() argument 491 struct tcrypt_result *tr = req->base.data; in do_one_ahash_op() 501 static int test_ahash_jiffies_digest(struct ahash_request *req, int blen, in test_ahash_jiffies_digest() argument 510 ret = do_one_ahash_op(req, crypto_ahash_digest(req)); in test_ahash_jiffies_digest() 521 static int test_ahash_jiffies(struct ahash_request *req, int blen, in test_ahash_jiffies() argument 529 return test_ahash_jiffies_digest(req, blen, out, sec); in test_ahash_jiffies() 533 ret = crypto_ahash_init(req); in test_ahash_jiffies() 537 ret = do_one_ahash_op(req, crypto_ahash_update(req)); in test_ahash_jiffies() [all …]
|
D | ablkcipher.c | 108 static int ablkcipher_walk_next(struct ablkcipher_request *req, 111 int ablkcipher_walk_done(struct ablkcipher_request *req, in ablkcipher_walk_done() argument 114 struct crypto_tfm *tfm = req->base.tfm; in ablkcipher_walk_done() 140 crypto_yield(req->base.flags); in ablkcipher_walk_done() 141 return ablkcipher_walk_next(req, walk); in ablkcipher_walk_done() 144 if (walk->iv != req->info) in ablkcipher_walk_done() 145 memcpy(req->info, walk->iv, tfm->crt_ablkcipher.ivsize); in ablkcipher_walk_done() 152 static inline int ablkcipher_next_slow(struct ablkcipher_request *req, in ablkcipher_next_slow() argument 169 return ablkcipher_walk_done(req, walk, -ENOMEM); in ablkcipher_next_slow() 217 static inline int ablkcipher_next_fast(struct ablkcipher_request *req, in ablkcipher_next_fast() argument [all …]
|
D | testmgr.c | 136 static void tcrypt_complete(struct crypto_async_request *req, int err) in tcrypt_complete() argument 138 struct tcrypt_result *res = req->data; in tcrypt_complete() 174 static int do_one_async_hash_op(struct ahash_request *req, in do_one_async_hash_op() argument 194 struct ahash_request *req; in test_hash() local 205 req = ahash_request_alloc(tfm, GFP_KERNEL); in test_hash() 206 if (!req) { in test_hash() 211 ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, in test_hash() 239 ahash_request_set_crypt(req, sg, result, template[i].psize); in test_hash() 241 ret = do_one_async_hash_op(req, &tresult, in test_hash() 242 crypto_ahash_digest(req)); in test_hash() [all …]
|
D | blkcipher.c | 418 static int async_encrypt(struct ablkcipher_request *req) in async_encrypt() argument 420 struct crypto_tfm *tfm = req->base.tfm; in async_encrypt() 424 .info = req->info, in async_encrypt() 425 .flags = req->base.flags, in async_encrypt() 429 return alg->encrypt(&desc, req->dst, req->src, req->nbytes); in async_encrypt() 432 static int async_decrypt(struct ablkcipher_request *req) in async_decrypt() argument 434 struct crypto_tfm *tfm = req->base.tfm; in async_decrypt() 438 .info = req->info, in async_decrypt() 439 .flags = req->base.flags, in async_decrypt() 442 return alg->decrypt(&desc, req->dst, req->src, req->nbytes); in async_decrypt() [all …]
|
D | ctr.c | 278 static int crypto_rfc3686_crypt(struct ablkcipher_request *req) in crypto_rfc3686_crypt() argument 280 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in crypto_rfc3686_crypt() 285 (void *)PTR_ALIGN((u8 *)ablkcipher_request_ctx(req), align + 1); in crypto_rfc3686_crypt() 291 memcpy(iv + CTR_RFC3686_NONCE_SIZE, req->info, CTR_RFC3686_IV_SIZE); in crypto_rfc3686_crypt() 298 ablkcipher_request_set_callback(subreq, req->base.flags, in crypto_rfc3686_crypt() 299 req->base.complete, req->base.data); in crypto_rfc3686_crypt() 300 ablkcipher_request_set_crypt(subreq, req->src, req->dst, req->nbytes, in crypto_rfc3686_crypt()
|
D | xts.c | 171 struct xts_crypt_req *req) in xts_crypt() argument 174 const unsigned int max_blks = req->tbuflen / bsize; in xts_crypt() 178 be128 *t_buf = req->tbuf; in xts_crypt() 195 req->tweak_fn(req->tweak_ctx, (u8 *)&t_buf[0], walk.iv); in xts_crypt() 212 req->crypt_fn(req->crypt_ctx, (u8 *)dst, in xts_crypt()
|
D | algif_skcipher.c | 49 struct ablkcipher_request req; member 248 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(&ctx->req); in skcipher_sendmsg() 425 &ctx->req)); in skcipher_recvmsg() 470 ablkcipher_request_set_crypt(&ctx->req, sg, in skcipher_recvmsg() 476 crypto_ablkcipher_encrypt(&ctx->req) : in skcipher_recvmsg() 477 crypto_ablkcipher_decrypt(&ctx->req), in skcipher_recvmsg() 564 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(&ctx->req); in skcipher_sock_destruct() 601 ablkcipher_request_set_tfm(&ctx->req, private); in skcipher_accept_parent() 602 ablkcipher_request_set_callback(&ctx->req, CRYPTO_TFM_REQ_MAY_BACKLOG, in skcipher_accept_parent()
|
D | lrw.c | 219 struct lrw_crypt_req *req) in lrw_crypt() argument 222 const unsigned int max_blks = req->tbuflen / bsize; in lrw_crypt() 223 struct lrw_table_ctx *ctx = req->table_ctx; in lrw_crypt() 227 be128 *t_buf = req->tbuf; in lrw_crypt() 269 req->crypt_fn(req->crypt_ctx, (u8 *)dst, in lrw_crypt()
|
D | aead.c | 88 static int no_givcrypt(struct aead_givcrypt_request *req) in no_givcrypt() argument 167 static int aead_null_givencrypt(struct aead_givcrypt_request *req) in aead_null_givencrypt() argument 169 return crypto_aead_encrypt(&req->areq); in aead_null_givencrypt() 172 static int aead_null_givdecrypt(struct aead_givcrypt_request *req) in aead_null_givdecrypt() argument 174 return crypto_aead_decrypt(&req->areq); in aead_null_givdecrypt()
|
D | af_alg.c | 446 void af_alg_complete(struct crypto_async_request *req, int err) in af_alg_complete() argument 448 struct af_alg_completion *completion = req->data; in af_alg_complete()
|
D | algapi.c | 897 struct crypto_async_request *req; in crypto_tfm_in_queue() local 899 list_for_each_entry(req, &queue->list, list) { in crypto_tfm_in_queue() 900 if (req->tfm == tfm) in crypto_tfm_in_queue()
|