Lines Matching refs:req_ctx
178 struct pkcs1pad_request *req_ctx = akcipher_request_ctx(req); in pkcs1pad_encrypt_sign_complete() local
186 len = req_ctx->child_req.dst_len; in pkcs1pad_encrypt_sign_complete()
208 kfree(req_ctx->in_buf); in pkcs1pad_encrypt_sign_complete()
231 struct pkcs1pad_request *req_ctx = akcipher_request_ctx(req); in pkcs1pad_encrypt() local
246 req_ctx->in_buf = kmalloc(ctx->key_size - 1 - req->src_len, in pkcs1pad_encrypt()
248 if (!req_ctx->in_buf) in pkcs1pad_encrypt()
252 req_ctx->in_buf[0] = 0x02; in pkcs1pad_encrypt()
254 req_ctx->in_buf[i] = 1 + prandom_u32_max(255); in pkcs1pad_encrypt()
255 req_ctx->in_buf[ps_end] = 0x00; in pkcs1pad_encrypt()
257 pkcs1pad_sg_set_buf(req_ctx->in_sg, req_ctx->in_buf, in pkcs1pad_encrypt()
260 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child); in pkcs1pad_encrypt()
261 akcipher_request_set_callback(&req_ctx->child_req, req->base.flags, in pkcs1pad_encrypt()
265 akcipher_request_set_crypt(&req_ctx->child_req, req_ctx->in_sg, in pkcs1pad_encrypt()
268 err = crypto_akcipher_encrypt(&req_ctx->child_req); in pkcs1pad_encrypt()
279 struct pkcs1pad_request *req_ctx = akcipher_request_ctx(req); in pkcs1pad_decrypt_complete() local
288 dst_len = req_ctx->child_req.dst_len; in pkcs1pad_decrypt_complete()
292 out_buf = req_ctx->out_buf; in pkcs1pad_decrypt_complete()
324 kfree_sensitive(req_ctx->out_buf); in pkcs1pad_decrypt_complete()
347 struct pkcs1pad_request *req_ctx = akcipher_request_ctx(req); in pkcs1pad_decrypt() local
353 req_ctx->out_buf = kmalloc(ctx->key_size, GFP_KERNEL); in pkcs1pad_decrypt()
354 if (!req_ctx->out_buf) in pkcs1pad_decrypt()
357 pkcs1pad_sg_set_buf(req_ctx->out_sg, req_ctx->out_buf, in pkcs1pad_decrypt()
360 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child); in pkcs1pad_decrypt()
361 akcipher_request_set_callback(&req_ctx->child_req, req->base.flags, in pkcs1pad_decrypt()
365 akcipher_request_set_crypt(&req_ctx->child_req, req->src, in pkcs1pad_decrypt()
366 req_ctx->out_sg, req->src_len, in pkcs1pad_decrypt()
369 err = crypto_akcipher_decrypt(&req_ctx->child_req); in pkcs1pad_decrypt()
380 struct pkcs1pad_request *req_ctx = akcipher_request_ctx(req); in pkcs1pad_sign() local
401 req_ctx->in_buf = kmalloc(ctx->key_size - 1 - req->src_len, in pkcs1pad_sign()
403 if (!req_ctx->in_buf) in pkcs1pad_sign()
407 req_ctx->in_buf[0] = 0x01; in pkcs1pad_sign()
408 memset(req_ctx->in_buf + 1, 0xff, ps_end - 1); in pkcs1pad_sign()
409 req_ctx->in_buf[ps_end] = 0x00; in pkcs1pad_sign()
412 memcpy(req_ctx->in_buf + ps_end + 1, digest_info->data, in pkcs1pad_sign()
415 pkcs1pad_sg_set_buf(req_ctx->in_sg, req_ctx->in_buf, in pkcs1pad_sign()
418 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child); in pkcs1pad_sign()
419 akcipher_request_set_callback(&req_ctx->child_req, req->base.flags, in pkcs1pad_sign()
423 akcipher_request_set_crypt(&req_ctx->child_req, req_ctx->in_sg, in pkcs1pad_sign()
426 err = crypto_akcipher_decrypt(&req_ctx->child_req); in pkcs1pad_sign()
437 struct pkcs1pad_request *req_ctx = akcipher_request_ctx(req); in pkcs1pad_verify_complete() local
449 dst_len = req_ctx->child_req.dst_len; in pkcs1pad_verify_complete()
453 out_buf = req_ctx->out_buf; in pkcs1pad_verify_complete()
496 req_ctx->out_buf + ctx->key_size, in pkcs1pad_verify_complete()
499 if (memcmp(req_ctx->out_buf + ctx->key_size, out_buf + pos, in pkcs1pad_verify_complete()
503 kfree_sensitive(req_ctx->out_buf); in pkcs1pad_verify_complete()
534 struct pkcs1pad_request *req_ctx = akcipher_request_ctx(req); in pkcs1pad_verify() local
542 req_ctx->out_buf = kmalloc(ctx->key_size + req->dst_len, GFP_KERNEL); in pkcs1pad_verify()
543 if (!req_ctx->out_buf) in pkcs1pad_verify()
546 pkcs1pad_sg_set_buf(req_ctx->out_sg, req_ctx->out_buf, in pkcs1pad_verify()
549 akcipher_request_set_tfm(&req_ctx->child_req, ctx->child); in pkcs1pad_verify()
550 akcipher_request_set_callback(&req_ctx->child_req, req->base.flags, in pkcs1pad_verify()
554 akcipher_request_set_crypt(&req_ctx->child_req, req->src, in pkcs1pad_verify()
555 req_ctx->out_sg, req->src_len, in pkcs1pad_verify()
558 err = crypto_akcipher_encrypt(&req_ctx->child_req); in pkcs1pad_verify()