Lines Matching refs: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_ATOMIC);
201 sg_nents_for_len(req->dst, ctx->key_size),
202 out_buf, ctx->key_size);
206 req->dst_len = ctx->key_size;
229 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
234 if (!ctx->key_size)
237 if (req->src_len > ctx->key_size - 11)
240 if (req->dst_len < ctx->key_size) {
241 req->dst_len = ctx->key_size;
245 req_ctx->in_buf = kmalloc(ctx->key_size - 1 - req->src_len,
250 ps_end = ctx->key_size - req->src_len - 2;
257 ctx->key_size - 1 - req->src_len, req->src);
259 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child);
265 req->dst, ctx->key_size - 1, req->dst_len);
277 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
288 if (dst_len < ctx->key_size - 1)
292 if (dst_len == ctx->key_size) {
344 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
348 if (!ctx->key_size || req->src_len != ctx->key_size)
351 req_ctx->out_buf = kmalloc(ctx->key_size, GFP_KERNEL);
356 ctx->key_size, NULL);
358 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child);
365 ctx->key_size);
377 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
385 if (!ctx->key_size)
391 if (req->src_len + digest_info_size > ctx->key_size - 11)
394 if (req->dst_len < ctx->key_size) {
395 req->dst_len = ctx->key_size;
399 req_ctx->in_buf = kmalloc(ctx->key_size - 1 - req->src_len,
404 ps_end = ctx->key_size - digest_info_size - req->src_len - 2;
414 ctx->key_size - 1 - req->src_len, req->src);
416 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child);
422 req->dst, ctx->key_size - 1, req->dst_len);
434 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
450 if (dst_len < ctx->key_size - 1)
454 if (dst_len == ctx->key_size) {
495 req_ctx->out_buf + ctx->key_size,
498 if (memcmp(req_ctx->out_buf + ctx->key_size, out_buf + pos,
531 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
538 !ctx->key_size || sig_size != ctx->key_size)
541 req_ctx->out_buf = kmalloc(ctx->key_size + digest_size, GFP_KERNEL);
546 ctx->key_size, NULL);
548 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child);
554 req_ctx->out_sg, sig_size, ctx->key_size);
567 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
574 ctx->child = child_tfm;
584 struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm);
586 crypto_free_akcipher(ctx->child);
591 struct pkcs1pad_inst_ctx *ctx = akcipher_instance_ctx(inst);
592 struct crypto_akcipher_spawn *spawn = &ctx->spawn;
602 struct pkcs1pad_inst_ctx *ctx;
611 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL);
615 ctx = akcipher_instance_ctx(inst);
617 err = crypto_grab_akcipher(&ctx->spawn, akcipher_crypto_instance(inst),
622 rsa_alg = crypto_spawn_akcipher_alg(&ctx->spawn);
643 ctx->digest_info = rsa_lookup_asn1(hash_name);
644 if (!ctx->digest_info) {