Lines Matching refs:ctx
57 struct af_alg_ctx *ctx = ask->private; in _skcipher_recvmsg() local
64 if (!ctx->used) { in _skcipher_recvmsg()
82 if (len > ctx->used) in _skcipher_recvmsg()
83 len = ctx->used; in _skcipher_recvmsg()
89 if (ctx->more || len < ctx->used) in _skcipher_recvmsg()
112 areq->first_rsgl.sgl.sg, len, ctx->iv); in _skcipher_recvmsg()
125 err = ctx->enc ? in _skcipher_recvmsg()
139 crypto_req_done, &ctx->wait); in _skcipher_recvmsg()
140 err = crypto_wait_req(ctx->enc ? in _skcipher_recvmsg()
143 &ctx->wait); in _skcipher_recvmsg()
322 struct af_alg_ctx *ctx = ask->private; in skcipher_sock_destruct() local
327 af_alg_pull_tsgl(sk, ctx->used, NULL, 0); in skcipher_sock_destruct()
328 sock_kzfree_s(sk, ctx->iv, crypto_skcipher_ivsize(tfm)); in skcipher_sock_destruct()
329 sock_kfree_s(sk, ctx, ctx->len); in skcipher_sock_destruct()
335 struct af_alg_ctx *ctx; in skcipher_accept_parent_nokey() local
338 unsigned int len = sizeof(*ctx); in skcipher_accept_parent_nokey()
340 ctx = sock_kmalloc(sk, len, GFP_KERNEL); in skcipher_accept_parent_nokey()
341 if (!ctx) in skcipher_accept_parent_nokey()
344 ctx->iv = sock_kmalloc(sk, crypto_skcipher_ivsize(tfm), in skcipher_accept_parent_nokey()
346 if (!ctx->iv) { in skcipher_accept_parent_nokey()
347 sock_kfree_s(sk, ctx, len); in skcipher_accept_parent_nokey()
351 memset(ctx->iv, 0, crypto_skcipher_ivsize(tfm)); in skcipher_accept_parent_nokey()
353 INIT_LIST_HEAD(&ctx->tsgl_list); in skcipher_accept_parent_nokey()
354 ctx->len = len; in skcipher_accept_parent_nokey()
355 ctx->used = 0; in skcipher_accept_parent_nokey()
356 atomic_set(&ctx->rcvused, 0); in skcipher_accept_parent_nokey()
357 ctx->more = 0; in skcipher_accept_parent_nokey()
358 ctx->merge = 0; in skcipher_accept_parent_nokey()
359 ctx->enc = 0; in skcipher_accept_parent_nokey()
360 crypto_init_wait(&ctx->wait); in skcipher_accept_parent_nokey()
362 ask->private = ctx; in skcipher_accept_parent_nokey()