Lines Matching defs:ctx
110 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
113 ctx->key_size = 0;
115 err = crypto_akcipher_set_pub_key(ctx->child, key, keylen);
120 err = crypto_akcipher_maxsize(ctx->child);
124 ctx->key_size = err;
131 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
134 ctx->key_size = 0;
136 err = crypto_akcipher_set_priv_key(ctx->child, key, keylen);
141 err = crypto_akcipher_maxsize(ctx->child);
145 ctx->key_size = err;
151 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
159 return ctx->key_size;
177 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
187 pad_len = ctx->key_size - len;
193 out_buf = kzalloc(ctx->key_size, GFP_KERNEL);
201 sg_nents_for_len(req->dst, ctx->key_size),
202 out_buf, ctx->key_size);
206 req->dst_len = ctx->key_size;
230 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
235 if (!ctx->key_size)
238 if (req->src_len > ctx->key_size - 11)
241 if (req->dst_len < ctx->key_size) {
242 req->dst_len = ctx->key_size;
246 req_ctx->in_buf = kmalloc(ctx->key_size - 1 - req->src_len,
251 ps_end = ctx->key_size - req->src_len - 2;
258 ctx->key_size - 1 - req->src_len, req->src);
260 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child);
266 req->dst, ctx->key_size - 1, req->dst_len);
278 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
289 if (dst_len < ctx->key_size - 1)
293 if (dst_len == ctx->key_size) {
346 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
350 if (!ctx->key_size || req->src_len != ctx->key_size)
353 req_ctx->out_buf = kmalloc(ctx->key_size, GFP_KERNEL);
358 ctx->key_size, NULL);
360 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child);
367 ctx->key_size);
379 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
387 if (!ctx->key_size)
393 if (req->src_len + digest_size > ctx->key_size - 11)
396 if (req->dst_len < ctx->key_size) {
397 req->dst_len = ctx->key_size;
401 req_ctx->in_buf = kmalloc(ctx->key_size - 1 - req->src_len,
406 ps_end = ctx->key_size - digest_size - req->src_len - 2;
416 ctx->key_size - 1 - req->src_len, req->src);
418 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child);
424 req->dst, ctx->key_size - 1, req->dst_len);
436 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
450 if (dst_len < ctx->key_size - 1)
454 if (dst_len == ctx->key_size) {
496 req_ctx->out_buf + ctx->key_size,
499 if (memcmp(req_ctx->out_buf + ctx->key_size, out_buf + pos,
533 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
539 !ctx->key_size || req->src_len != ctx->key_size)
542 req_ctx->out_buf = kmalloc(ctx->key_size + req->dst_len, GFP_KERNEL);
547 ctx->key_size, NULL);
549 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child);
556 ctx->key_size);
569 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
576 ctx->child = child_tfm;
582 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
584 crypto_free_akcipher(ctx->child);
589 struct pkcs1pad_inst_ctx *ctx = akcipher_instance_ctx(inst);
590 struct crypto_akcipher_spawn *spawn = &ctx->spawn;
600 struct pkcs1pad_inst_ctx *ctx;
609 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL);
613 ctx = akcipher_instance_ctx(inst);
615 err = crypto_grab_akcipher(&ctx->spawn, akcipher_crypto_instance(inst),
620 rsa_alg = crypto_spawn_akcipher_alg(&ctx->spawn);
641 ctx->digest_info = rsa_lookup_asn1(hash_name);
642 if (!ctx->digest_info) {