linux/crypto/cryptd.c
<<
aluealuealo/spa3.4alospa3 class="lxr_search">aluealuealuealue typ Search.4 aluealo/spa3.4uealoinput typ aue4 odiv id/ /1o/a>ospa3 class="comment">/*o/spa3.4/ /2o/a>ospa3 class="comment"> * Software async crypto daemon.o/spa3.4/ /3o/a>ospa3 class="comment"> *o/spa3.4/ /4o/a>ospa3 class="comment"> * Copyright (c) 2006 Herbert Xu <herbert@gondor.apa3a.org.au>o/spa3.4/ /5o/a>ospa3 class="comment"> *o/spa3.4/ /6o/a>ospa3 class="comment"> * Added AEAD support to cryptd.o/spa3.4/ /7o/a>ospa3 class="comment"> * Authors: Tadeusz Struk (tadeusz.struk@intel.com)o/spa3.4/ /8o/a>ospa3 class="comment"> * Adria3 Hoba3 <adria3.hoba3@intel.com>o/spa3.4/ /9o/a>ospa3 class="comment"> * Gabriele Paoloni <gabriele.paoloni@intel.com>o/spa3.4/ a>ospa3 class="comment"> * Aida3 O'Mahony (aida3.o.mahony@intel.com)o/spa3.4/ 11o/a>ospa3 class="comment"> * Copyright (c) 2010, Intel Corpora v3.o/spa3.4/ 12o/a>ospa3 class="comment"> *o/spa3.4/ 13o/a>ospa3 class="comment"> * This program is free software; you ca3 redistribute it and/or modify ito/spa3.4/ 14o/a>ospa3 class="comment"> * under the terms of the GNU General Public License as published by the Freeo/spa3.4/ 15o/a>ospa3 class="comment"> * Software Founda v3; either verson> 2 of the License, or (at your > v3)o/spa3.4/ 16o/a>ospa3 class="comment"> * any later verson>.o/spa3.4/ 17o/a>ospa3 class="comment"> *o/spa3.4/ 18o/a>ospa3 class="comment"> */o/spa3.4/ 19o/a>4/ 2 a>#include <crypto/algapi.h a>>4/ 21 a>#include <crypto/internal/hash.h a>>4/ 22 a>#include <crypto/internal/aead.h a>>4/ 23 a>#include <crypto/cryptd.h a>>4/ 24 a>#include <crypto/crypto_wq.h a>>4/ 25 a>#include <linux/err.h a>>4/ 26 a>#include <linux/init.h a>>4/ 27 a>#include <linux/kernel.h a>>4/ 28 a>#include <linux/list.h a>>4/ 29 a>#include <linux/module.h a>>4/ 3 a>#include <linux/scatterlist.h a>>4/ 31 a>#include <linux/sched.h a>>4/ 32 a>#include <linux/slab.h a>>4/ 33o/a>4/ 34 a>#define/oa href="+code=CRYPTD_MAX_CPU_QLEN" class="sref">CRYPTD_MAX_CPU_QLEN a> 04/ 35o/a>4/ 36 a>struct/oa href="+code=cryptd_cpu_queue" class="sref">cryptd_cpu_queue a> {4/ 37 a> struct/oa href="+code=crypto_queue" class="sref">crypto_queue a> oa href="+code=queue" class="sref">queue a>;4/ 38 a> struct/oa href="+code=work_struct" class="sref">work_struct a> oa href="+code=work" class="sref">work a>;4/ 39 a>};4/ 40o/a>4/ 41 a>struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> {4/ 42 a> struct/oa href="+code=cryptd_cpu_queue" class="sref">cryptd_cpu_queue a> oa href="+code=__percpu" class="sref">__percpu a> *oa href="+code=cpu_queue" class="sref">cpu_queue a>;4/ 43 a>};4/ 44o/a>4/ 45 a>struct/oa href="+code=cryptd_instance_ctx" class="sref">cryptd_instance_ctx a> {4/ 46 a> struct/oa href="+code=crypto_spawn" class="sref">crypto_spawn a> oa href="+code=spawn" class="sref">spawn a>;4/ 47 a> struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> *oa href="+code=queue" class="sref">queue a>;4/ 48 a>};4/ 49o/a>4/ 50 a>struct/oa href="+code=hashd_instance_ctx" class="sref">hashd_instance_ctx a> {4/ 51 a> struct/oa href="+code=crypto_shash_spawn" class="sref">crypto_shash_spawn a> oa href="+code=spawn" class="sref">spawn a>;4/ 52 a> struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> *oa href="+code=queue" class="sref">queue a>;4/ 53 a>};4/ 54o/a>4/ 55 a>struct/oa href="+code=aead_instance_ctx" class="sref">aead_instance_ctx a> {4/ 56 a> struct/oa href="+code=crypto_aead_spawn" class="sref">crypto_aead_spawn a> oa href="+code=aead_spawn" class="sref">aead_spawn a>;4/ 57 a> struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> *oa href="+code=queue" class="sref">queue a>;4/ 58 a>};4/ 59o/a>4/ 60 a>struct/oa href="+code=cryptd_blkcipher_ctx" class="sref">cryptd_blkcipher_ctx a> {4/ 61 a> struct/oa href="+code=crypto_blkcipher" class="sref">crypto_blkcipher a> *oa href="+code=child" class="sref">child a>;4/ 62 a>};4/ 63o/a>4/ 64 a>struct/oa href="+code=cryptd_blkcipher_request_ctx" class="sref">cryptd_blkcipher_request_ctx a> {4/ 65 a> oa href="+code=crypto_comple v3_t" class="sref">crypto_comple v3_t a> oa href="+code=comple e" class="sref">comple e a>;4/ 66 a>};4/ 67o/a>4/ 68 a>struct/oa href="+code=cryptd_hash_ctx" class="sref">cryptd_hash_ctx a> {4/ 69 a> struct/oa href="+code=crypto_shash" class="sref">crypto_shash a> *oa href="+code=child" class="sref">child a>;4/ 70 a>};4/ 71o/a>4/ 72 a>struct/oa href="+code=cryptd_hash_request_ctx" class="sref">cryptd_hash_request_ctx a> {4/ 73 a> oa href="+code=crypto_comple v3_t" class="sref">crypto_comple v3_t a> oa href="+code=comple e" class="sref">comple e a>;4/ 74 a> struct/oa href="+code=shash_desc" class="sref">shash_desc a> oa href="+code=desc" class="sref">desc a>;4/ 75 a>};4/ 76o/a>4/ 77 a>struct/oa href="+code=cryptd_aead_ctx" class="sref">cryptd_aead_ctx a> {4/ 78 a> struct/oa href="+code=crypto_aead" class="sref">crypto_aead a> *oa href="+code=child" class="sref">child a>;4/ 79 a>};4/ 80o/a>4/ 81 a>struct/oa href="+code=cryptd_aead_request_ctx" class="sref">cryptd_aead_request_ctx a> {4/ 82 a> oa href="+code=crypto_comple v3_t" class="sref">crypto_comple v3_t a> oa href="+code=comple e" class="sref">comple e a>;4/ 83 a>};4/ 84o/a>4/ 85 a>static void/oa href="+code=cryptd_queue_worker" class="sref">cryptd_queue_worker a>(struct/oa href="+code=work_struct" class="sref">work_struct a> *oa href="+code=work" class="sref">work a>);4/ 86o/a>4/ 87 a>static int/oa href="+code=cryptd_init_queue" class="sref">cryptd_init_queue a>(struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> *oa href="+code=queue" class="sref">queue a>,4/ 88 a> unsigned int/oa href="+code=max_cpu_qlen" class="sref">max_cpu_qlen a>)4/ 89 a>{4/ 90 a> int/oa href="+code=cpu" class="sref">cpu a>;4/ 91 a> struct/oa href="+code=cryptd_cpu_queue" class="sref">cryptd_cpu_queue a> *oa href="+code=cpu_queue" class="sref">cpu_queue a>;4/ 92o/a>4/ 93 a> oa href="+code=queue" class="sref">queue a>->oa href="+code=cpu_queue" class="sref">cpu_queue a> = oa href="+code=alloc_percpu" class="sref">alloc_percpu a>(struct/oa href="+code=cryptd_cpu_queue" class="sref">cryptd_cpu_queue a>);4/ 94 a> if (!oa href="+code=queue" class="sref">queue a>->oa href="+code=cpu_queue" class="sref">cpu_queue a>)4/ 95 a> return -oa href="+code=ENOMEM" class="sref">ENOMEM a>;4/ 96 a> oa href="+code=for_each_possible_cpu" class="sref">for_each_possible_cpu a>(oa href="+code=cpu" class="sref">cpu a>) {4/ 97 a> oa href="+code=cpu_queue" class="sref">cpu_queue a> = oa href="+code=per_cpu_ptr" class="sref">per_cpu_ptr a>(oa href="+code=queue" class="sref">queue a>->oa href="+code=cpu_queue" class="sref">cpu_queue a>,/oa href="+code=cpu" class="sref">cpu a>);4/ 98 a> oa href="+code=crypto_init_queue" class="sref">crypto_init_queue a>(&oa href="+code=cpu_queue" class="sref">cpu_queue a>->oa href="+code=queue" class="sref">queue a>,/oa href="+code=max_cpu_qlen" class="sref">max_cpu_qlen a>);4/ 99 a> oa href="+code=INIT_WORK" class="sref">INIT_WORK a>(&oa href="+code=cpu_queue" class="sref">cpu_queue a>->oa href="+code=work" class="sref">work a>,/oa href="+code=cryptd_queue_worker" class="sref">cryptd_queue_worker a>);4/100 a> }4/101 a> return 0;4/102 a>}4/103o/a>4/104 a>static void/oa href="+code=cryptd_fini_queue" class="sref">cryptd_fini_queue a>(struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> *oa href="+code=queue" class="sref">queue a>)4/105 a>{4/106 a> int/oa href="+code=cpu" class="sref">cpu a>;4/107 a> struct/oa href="+code=cryptd_cpu_queue" class="sref">cryptd_cpu_queue a> *oa href="+code=cpu_queue" class="sref">cpu_queue a>;4/108o/a>4/109 a> oa href="+code=for_each_possible_cpu" class="sref">for_each_possible_cpu a>(oa href="+code=cpu" class="sref">cpu a>) {4/110 a> oa href="+code=cpu_queue" class="sref">cpu_queue a> = oa href="+code=per_cpu_ptr" class="sref">per_cpu_ptr a>(oa href="+code=queue" class="sref">queue a>->oa href="+code=cpu_queue" class="sref">cpu_queue a>,/oa href="+code=cpu" class="sref">cpu a>);4/111 a> oa href="+code=BUG_ON" class="sref">BUG_ON a>(oa href="+code=cpu_queue" class="sref">cpu_queue a>->oa href="+code=queue" class="sref">queue a>.oa href="+code=qlen" class="sref">qlen a>);4/112 a> }4/113 a> oa href="+code=free_percpu" class="sref">free_percpu a>(oa href="+code=queue" class="sref">queue a>->oa href="+code=cpu_queue" class="sref">cpu_queue a>);4/114o/a>}4/115o/a>4/116 a>static int/oa href="+code=cryptd_enqueue_request" class="sref">cryptd_enqueue_request a>(struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> *oa href="+code=queue" class="sref">queue a>,4/117 a> struct/oa href="+code=crypto_async_request" class="sref">crypto_async_request a> *oa href="+code=request" class="sref">request a>)4/118o/a>{4/119 a> int/oa href="+code=cpu" class="sref">cpu a>,/oa href="+code=err" class="sref">err a>;4/120 a> struct/oa href="+code=cryptd_cpu_queue" class="sref">cryptd_cpu_queue a> *oa href="+code=cpu_queue" class="sref">cpu_queue a>;4/121o/a>4/122 a> oa href="+code=cpu" class="sref">cpu a> = oa href="+code=get_cpu" class="sref">get_cpu a>();4/123 a> oa href="+code=cpu_queue" class="sref">cpu_queue a> = oa href="+code=this_cpu_ptr" class="sref">this_cpu_ptr a>(oa href="+code=queue" class="sref">queue a>->oa href="+code=cpu_queue" class="sref">cpu_queue a>);4/124 a> oa href="+code=err" class="sref">err a> = oa href="+code=crypto_enqueue_request" class="sref">crypto_enqueue_request a>(&oa href="+code=cpu_queue" class="sref">cpu_queue a>->oa href="+code=queue" class="sref">queue a>,/oa href="+code=request" class="sref">request a>);4/125 a> oa href="+code=queue_work_on" class="sref">queue_work_on a>(oa href="+code=cpu" class="sref">cpu a>,/oa href="+code=kcrypto_wq" class="sref">kcrypto_wq a>,/&oa href="+code=cpu_queue" class="sref">cpu_queue a>->oa href="+code=work" class="sref">work a>);4/126 a> oa href="+code=put_cpu" class="sref">put_cpu a>();4/127o/a>4/128 a> return oa href="+code=err" class="sref">err a>;4/129 a>}4/130o/a>4/131o/a>ospa3 class="comment">/* Called in workqueue context, do one real crypton> work (viao/spa3.4/132o/a>ospa3 class="comment"> * req->comple e) and reschedule itself if there are more work too/spa3.4/133o/a>ospa3 class="comment"> * do. */o/spa3.4/134 a>static void/oa href="+code=cryptd_queue_worker" class="sref">cryptd_queue_worker a>(struct/oa href="+code=work_struct" class="sref">work_struct a> *oa href="+code=work" class="sref">work a>)4/135 a>{4/136 a> struct/oa href="+code=cryptd_cpu_queue" class="sref">cryptd_cpu_queue a> *oa href="+code=cpu_queue" class="sref">cpu_queue a>;4/137 a> struct/oa href="+code=crypto_async_request" class="sref">crypto_async_request a> *oa href="+code=req" class="sref">req a>,/*oa href="+code=backlog" class="sref">backlog a>;4/138o/a>4/139 a> oa href="+code=cpu_queue" class="sref">cpu_queue a> = oa href="+code=container_of" class="sref">container_of a>(oa href="+code=work" class="sref">work a>,/struct/oa href="+code=cryptd_cpu_queue" class="sref">cryptd_cpu_queue a>,/oa href="+code=work" class="sref">work a>);4/140 a> ospa3 class="comment">/* Only handle one request at a time to avoid/hogging cryptoo/spa3.4/141o/a>ospa3 class="comment"> * workqueue. preempt_disable/enable is used to prevento/spa3.4/142o/a>ospa3 class="comment"> * being preempted by cryptd_enqueue_request() */o/spa3.4/143 a> oa href="+code=preempt_disable" class="sref">preempt_disable a>();4/144 a> oa href="+code=backlog" class="sref">backlog a> = oa href="+code=crypto_get_backlog" class="sref">crypto_get_backlog a>(&oa href="+code=cpu_queue" class="sref">cpu_queue a>->oa href="+code=queue" class="sref">queue a>);4/145 a> oa href="+code=req" class="sref">req a> = oa href="+code=crypto_dequeue_request" class="sref">crypto_dequeue_request a>(&oa href="+code=cpu_queue" class="sref">cpu_queue a>->oa href="+code=queue" class="sref">queue a>);4/146 a> oa href="+code=preempt_enable" class="sref">preempt_enable a>();4/147o/a>4/148 a> if (!oa href="+code=req" class="sref">req a>)4/149 a> return;4/150o/a>4/151 a> if (oa href="+code=backlog" class="sref">backlog a>)4/152 a> oa href="+code=backlog" class="sref">backlog a>->oa href="+code=comple e" class="sref">comple e a>(oa href="+code=backlog" class="sref">backlog a>, -oa href="+code=EINPROGRESS" class="sref">EINPROGRESS a>);4/153 a> oa href="+code=req" class="sref">req a>->oa href="+code=comple e" class="sref">comple e a>(oa href="+code=req" class="sref">req a>,/0);4/154o/a>4/155 a> if (oa href="+code=cpu_queue" class="sref">cpu_queue a>->oa href="+code=queue" class="sref">queue a>.oa href="+code=qlen" class="sref">qlen a>)4/156 a> oa href="+code=queue_work" class="sref">queue_work a>(oa href="+code=kcrypto_wq" class="sref">kcrypto_wq a>,/&oa href="+code=cpu_queue" class="sref">cpu_queue a>->oa href="+code=work" class="sref">work a>);4/157 a>}4/158o/a>4/159o/a>static oa href="+code=inline" class="sref">inline a> struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> *oa href="+code=cryptd_get_queue" class="sref">cryptd_get_queue a>(struct/oa href="+code=crypto_tfm" class="sref">crypto_tfm a> *oa href="+code=tfm" class="sref">tfm a>)4/160 a>{4/161 a> struct/oa href="+code=crypto_instance" class="sref">crypto_instance a> *oa href="+code=inst" class="sref">inst a> = oa href="+code=crypto_tfm_alg_instance" class="sref">crypto_tfm_alg_instance a>(oa href="+code=tfm" class="sref">tfm a>);4/162 a> struct/oa href="+code=cryptd_instance_ctx" class="sref">cryptd_instance_ctx a> *oa href="+code=ictx" class="sref">ictx a> = oa href="+code=crypto_instance_ctx" class="sref">crypto_instance_ctx a>(oa href="+code=inst" class="sref">inst a>);4/163 a> return oa href="+code=ictx" class="sref">ictx a>->oa href="+code=queue" class="sref">queue a>;4/164o/a>}4/165o/a>4/166 a>static int/oa href="+code=cryptd_blkcipher_setkey" class="sref">cryptd_blkcipher_setkey a>(struct/oa href="+code=crypto_ablkcipher" class="sref">crypto_ablkcipher a> *oa href="+code=parent" class="sref">parent a>,4/167 a> const/oa href="+code=u8" class="sref">u8 a> *oa href="+code=key" class="sref">key a>, unsigned int/oa href="+code=keylen" class="sref">keylen a>)4/168o/a>{4/169 a> struct/oa href="+code=cryptd_blkcipher_ctx" class="sref">cryptd_blkcipher_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_ablkcipher_ctx" class="sref">crypto_ablkcipher_ctx a>(oa href="+code=parent" class="sref">parent a>);4/170 a> struct/oa href="+code=crypto_blkcipher" class="sref">crypto_blkcipher a> *oa href="+code=child" class="sref">child a> = oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>;4/171 a> int/oa href="+code=err" class="sref">err a>;4/172o/a>4/173 a> oa href="+code=crypto_blkcipher_clear_flags" class="sref">crypto_blkcipher_clear_flags a>(oa href="+code=child" class="sref">child a>,/oa href="+code=CRYPTO_TFM_REQ_MASK" class="sref">CRYPTO_TFM_REQ_MASK a>);4/174 a> oa href="+code=crypto_blkcipher_set_flags" class="sref">crypto_blkcipher_set_flags a>(oa href="+code=child" class="sref">child a>,/oa href="+code=crypto_ablkcipher_get_flags" class="sref">crypto_ablkcipher_get_flags a>(oa href="+code=parent" class="sref">parent a>)/&4/175 a> oa href="+code=CRYPTO_TFM_REQ_MASK" class="sref">CRYPTO_TFM_REQ_MASK a>);4/176 a> oa href="+code=err" class="sref">err a> = oa href="+code=crypto_blkcipher_setkey" class="sref">crypto_blkcipher_setkey a>(oa href="+code=child" class="sref">child a>,/oa href="+code=key" class="sref">key a>, oa href="+code=keylen" class="sref">keylen a>);4/177 a> oa href="+code=crypto_ablkcipher_set_flags" class="sref">crypto_ablkcipher_set_flags a>(oa href="+code=parent" class="sref">parent a>,/oa href="+code=crypto_blkcipher_get_flags" class="sref">crypto_blkcipher_get_flags a>(oa href="+code=child" class="sref">child a>)/&4/178 a> oa href="+code=CRYPTO_TFM_RES_MASK" class="sref">CRYPTO_TFM_RES_MASK a>);4/179 a> return oa href="+code=err" class="sref">err a>;4/180o/a>}4/181o/a>4/182 a>static void/oa href="+code=cryptd_blkcipher_crypt" class="sref">cryptd_blkcipher_crypt a>(struct/oa href="+code=ablkcipher_request" class="sref">ablkcipher_request a> *oa href="+code=req" class="sref">req a>,4/183 a> struct/oa href="+code=crypto_blkcipher" class="sref">crypto_blkcipher a> *oa href="+code=child" class="sref">child a>,4/184 a> int/oa href="+code=err" class="sref">err a>,4/185 a> int/(*oa href="+code=crypt" class="sref">crypt a>)(struct/oa href="+code=blkcipher_desc" class="sref">blkcipher_desc a> *oa href="+code=desc" class="sref">desc a>,4/186 a> struct/oa href="+code=scatterlist" class="sref">scatterlist a> *oa href="+code=dst" class="sref">dst a>,4/187 a> struct/oa href="+code=scatterlist" class="sref">scatterlist a> *oa href="+code=src" class="sref">src a>,4/188 a> unsigned int/oa href="+code=len" class="sref">len a>))4/189 a>{4/190 a> struct/oa href="+code=cryptd_blkcipher_request_ctx" class="sref">cryptd_blkcipher_request_ctx a> *oa href="+code=rctx" class="sref">rctx a>;4/191 a> struct/oa href="+code=blkcipher_desc" class="sref">blkcipher_desc a> oa href="+code=desc" class="sref">desc a>;4/192o/a>4/193 a> oa href="+code=rctx" class="sref">rctx a> = oa href="+code=ablkcipher_request_ctx" class="sref">ablkcipher_request_ctx a>(oa href="+code=req" class="sref">req a>);4/194o/a>4/195 a> if (oa href="+code=unlikely" class="sref">unlikely a>(oa href="+code=err" class="sref">err a> == -oa href="+code=EINPROGRESS" class="sref">EINPROGRESS a>))4/196 a> goto oa href="+code=out" class="sref">out a>;4/197o/a>4/198 a> oa href="+code=desc" class="sref">desc a>.oa href="+code=tfm" class="sref">tfm a> = oa href="+code=child" class="sref">child a>;4/199 a> oa href="+code=desc" class="sref">desc a>.oa href="+code=info" class="sref">info a> = oa href="+code=req" class="sref">req a>->oa href="+code=info" class="sref">info a>;4/200 a> oa href="+code=desc" class="sref">desc a>.oa href="+code=flags" class="sref">flags a> = oa href="+code=CRYPTO_TFM_REQ_MAY_SLEEP" class="sref">CRYPTO_TFM_REQ_MAY_SLEEP a>;4/201o/a>4/202 a> oa href="+code=err" class="sref">err a> = oa href="+code=crypt" class="sref">crypt a>(&oa href="+code=desc" class="sref">desc a>, oa href="+code=req" class="sref">req a>->oa href="+code=dst" class="sref">dst a>, oa href="+code=req" class="sref">req a>->oa href="+code=src" class="sref">src a>, oa href="+code=req" class="sref">req a>->oa href="+code=nbytes" class="sref">nbytes a>);4/203o/a>4/204 a> oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>.oa href="+code=comple e" class="sref">comple e a> = oa href="+code=rctx" class="sref">rctx a>->oa href="+code=comple e" class="sref">comple e a>;4/205o/a>4/206 a>oa href="+code=out" class="sref">out a>:4/207 a> oa href="+code=local_bh_disable" class="sref">local_bh_disable a>();4/208 a> oa href="+code=rctx" class="sref">rctx a>->oa href="+code=comple e" class="sref">comple e a>(&oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>,/oa href="+code=err" class="sref">err a>);4/209 a> oa href="+code=local_bh_enable" class="sref">local_bh_enable a>();4/210o/a>}4/211o/a>4/212 a>static void/oa href="+code=cryptd_blkcipher_encrypt" class="sref">cryptd_blkcipher_encrypt a>(struct/oa href="+code=crypto_async_request" class="sref">crypto_async_request a> *oa href="+code=req" class="sref">req a>,/int/oa href="+code=err" class="sref">err a>)4/213 a>{4/214 a> struct/oa href="+code=cryptd_blkcipher_ctx" class="sref">cryptd_blkcipher_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx a>(oa href="+code=req" class="sref">req a>->oa href="+code=tfm" class="sref">tfm a>);4/215 a> struct/oa href="+code=crypto_blkcipher" class="sref">crypto_blkcipher a> *oa href="+code=child" class="sref">child a> = oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>;4/216o/a>4/217 a> oa href="+code=cryptd_blkcipher_crypt" class="sref">cryptd_blkcipher_crypt a>(oa href="+code=ablkcipher_request_cast" class="sref">ablkcipher_request_cast a>(oa href="+code=req" class="sref">req a>),/oa href="+code=child" class="sref">child a>,/oa href="+code=err" class="sref">err a>,4/218 a> oa href="+code=crypto_blkcipher_crt" class="sref">crypto_blkcipher_crt a>(oa href="+code=child" class="sref">child a>)->oa href="+code=encrypt" class="sref">encrypt a>);4/219 a>}4/220o/a>4/221 a>static void/oa href="+code=cryptd_blkcipher_decrypt" class="sref">cryptd_blkcipher_decrypt a>(struct/oa href="+code=crypto_async_request" class="sref">crypto_async_request a> *oa href="+code=req" class="sref">req a>,/int/oa href="+code=err" class="sref">err a>)4/222 a>{4/223 a> struct/oa href="+code=cryptd_blkcipher_ctx" class="sref">cryptd_blkcipher_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx a>(oa href="+code=req" class="sref">req a>->oa href="+code=tfm" class="sref">tfm a>);4/224 a> struct/oa href="+code=crypto_blkcipher" class="sref">crypto_blkcipher a> *oa href="+code=child" class="sref">child a> = oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>;4/225o/a>4/226 a> oa href="+code=cryptd_blkcipher_crypt" class="sref">cryptd_blkcipher_crypt a>(oa href="+code=ablkcipher_request_cast" class="sref">ablkcipher_request_cast a>(oa href="+code=req" class="sref">req a>),/oa href="+code=child" class="sref">child a>,/oa href="+code=err" class="sref">err a>,4/227 a> oa href="+code=crypto_blkcipher_crt" class="sref">crypto_blkcipher_crt a>(oa href="+code=child" class="sref">child a>)->oa href="+code=decrypt" class="sref">decrypt a>);4/228 a>}4/229o/a>4/230 a>static int/oa href="+code=cryptd_blkcipher_enqueue" class="sref">cryptd_blkcipher_enqueue a>(struct/oa href="+code=ablkcipher_request" class="sref">ablkcipher_request a> *oa href="+code=req" class="sref">req a>,4/231 a> oa href="+code=crypto_comple v3_t" class="sref">crypto_comple v3_t a> oa href="+code=comple e" class="sref">comple e a>)4/232 a>{4/233 a> struct/oa href="+code=cryptd_blkcipher_request_ctx" class="sref">cryptd_blkcipher_request_ctx a> *oa href="+code=rctx" class="sref">rctx a> = oa href="+code=ablkcipher_request_ctx" class="sref">ablkcipher_request_ctx a>(oa href="+code=req" class="sref">req a>);4/234 a> struct/oa href="+code=crypto_ablkcipher" class="sref">crypto_ablkcipher a> *oa href="+code=tfm" class="sref">tfm a> = oa href="+code=crypto_ablkcipher_reqtfm" class="sref">crypto_ablkcipher_reqtfm a>(oa href="+code=req" class="sref">req a>);4/235 a> struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> *oa href="+code=queue" class="sref">queue a>;4/236o/a>4/237 a> oa href="+code=queue" class="sref">queue a> = oa href="+code=cryptd_get_queue" class="sref">cryptd_get_queue a>(oa href="+code=crypto_ablkcipher_tfm" class="sref">crypto_ablkcipher_tfm a>(oa href="+code=tfm" class="sref">tfm a>));4/238 a> oa href="+code=rctx" class="sref">rctx a>->oa href="+code=comple e" class="sref">comple e a> = oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>.oa href="+code=comple e" class="sref">comple e a>;4/239 a> oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>.oa href="+code=comple e" class="sref">comple e a> = oa href="+code=comple e" class="sref">comple e a>;4/240o/a>4/241 a> return oa href="+code=cryptd_enqueue_request" class="sref">cryptd_enqueue_request a>(oa href="+code=queue" class="sref">queue a>,/&oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>);4/242 a>}4/243o/a>4/244 a>static int/oa href="+code=cryptd_blkcipher_encrypt_enqueue" class="sref">cryptd_blkcipher_encrypt_enqueue a>(struct/oa href="+code=ablkcipher_request" class="sref">ablkcipher_request a> *oa href="+code=req" class="sref">req a>)4/245 a>{4/246 a> return oa href="+code=cryptd_blkcipher_enqueue" class="sref">cryptd_blkcipher_enqueue a>(oa href="+code=req" class="sref">req a>,/oa href="+code=cryptd_blkcipher_encrypt" class="sref">cryptd_blkcipher_encrypt a>);4/247 a>}4/248o/a>4/249 a>static int/oa href="+code=cryptd_blkcipher_decrypt_enqueue" class="sref">cryptd_blkcipher_decrypt_enqueue a>(struct/oa href="+code=ablkcipher_request" class="sref">ablkcipher_request a> *oa href="+code=req" class="sref">req a>)4/250 a>{4/251 a> return oa href="+code=cryptd_blkcipher_enqueue" class="sref">cryptd_blkcipher_enqueue a>(oa href="+code=req" class="sref">req a>,/oa href="+code=cryptd_blkcipher_decrypt" class="sref">cryptd_blkcipher_decrypt a>);4/252 a>}4/253o/a>4/254 a>static int/oa href="+code=cryptd_blkcipher_init_tfm" class="sref">cryptd_blkcipher_init_tfm a>(struct/oa href="+code=crypto_tfm" class="sref">crypto_tfm a> *oa href="+code=tfm" class="sref">tfm a>)4/255 a>{4/256 a> struct/oa href="+code=crypto_instance" class="sref">crypto_instance a> *oa href="+code=inst" class="sref">inst a> = oa href="+code=crypto_tfm_alg_instance" class="sref">crypto_tfm_alg_instance a>(oa href="+code=tfm" class="sref">tfm a>);4/257 a> struct/oa href="+code=cryptd_instance_ctx" class="sref">cryptd_instance_ctx a> *oa href="+code=ictx" class="sref">ictx a> = oa href="+code=crypto_instance_ctx" class="sref">crypto_instance_ctx a>(oa href="+code=inst" class="sref">inst a>);4/258 a> struct/oa href="+code=crypto_spawn" class="sref">crypto_spawn a> *oa href="+code=spawn" class="sref">spawn a> =/&oa href="+code=ictx" class="sref">ictx a>->oa href="+code=spawn" class="sref">spawn a>;4/259 a> struct/oa href="+code=cryptd_blkcipher_ctx" class="sref">cryptd_blkcipher_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx a>(oa href="+code=tfm" class="sref">tfm a>);4/260 a> struct/oa href="+code=crypto_blkcipher" class="sref">crypto_blkcipher a> *oa href="+code=cipher" class="sref">cipher a>;4/261o/a>4/262 a> oa href="+code=cipher" class="sref">cipher a> = oa href="+code=crypto_spawn_blkcipher" class="sref">crypto_spawn_blkcipher a>(oa href="+code=spawn" class="sref">spawn a>);4/263 a> if (oa href="+code=IS_ERR" class="sref">IS_ERR a>(oa href="+code=cipher" class="sref">cipher a>))4/264 a> return oa href="+code=PTR_ERR" class="sref">PTR_ERR a>(oa href="+code=cipher" class="sref">cipher a>);4/265o/a>4/266 a> oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a> = oa href="+code=cipher" class="sref">cipher a>;4/267 a> oa href="+code=tfm" class="sref">tfm a>->oa href="+code=crt_ablkcipher" class="sref">crt_ablkcipher a>.oa href="+code=reqsize" class="sref">reqsize a> =4/268 a> sizeof(struct/oa href="+code=cryptd_blkcipher_request_ctx" class="sref">cryptd_blkcipher_request_ctx a>);4/269 a> return 0;4/270o/a>}4/271o/a>4/272 a>static void/oa href="+code=cryptd_blkcipher_exit_tfm" class="sref">cryptd_blkcipher_exit_tfm a>(struct/oa href="+code=crypto_tfm" class="sref">crypto_tfm a> *oa href="+code=tfm" class="sref">tfm a>)4/273 a>{4/274 a> struct/oa href="+code=cryptd_blkcipher_ctx" class="sref">cryptd_blkcipher_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx a>(oa href="+code=tfm" class="sref">tfm a>);4/275o/a>4/276 a> oa href="+code=crypto_free_blkcipher" class="sref">crypto_free_blkcipher a>(oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>);4/277 a>}4/278o/a>4/279 a>static void/*oa href="+code=cryptd_alloc_instance" class="sref">cryptd_alloc_instance a>(struct/oa href="+code=crypto_alg" class="sref">crypto_alg a> *oa href="+code=alg" class="sref">alg a>, unsigned int/oa href="+code=head" class="sref">head a>,4/280 a> unsigned int/oa href="+code=tail" class="sref">tail a>)4/281o/a>{4/282 a> char *oa href="+code=p" class="sref">p a>;4/283 a> struct/oa href="+code=crypto_instance" class="sref">crypto_instance a> *oa href="+code=inst" class="sref">inst a>;4/284 a> int/oa href="+code=err" class="sref">err a>;4/285o/a>4/286 a> oa href="+code=p" class="sref">p a> = oa href="+code=kzalloc" class="sref">kzalloc a>(oa href="+code=head" class="sref">head a> + sizeof(*oa href="+code=inst" class="sref">inst a>) + oa href="+code=tail" class="sref">tail a>,/oa href="+code=GFP_KERNEL" class="sref">GFP_KERNEL a>);4/287 a> if (!oa href="+code=p" class="sref">p a>)4/288 a> return oa href="+code=ERR_PTR" class="sref">ERR_PTR a>(-oa href="+code=ENOMEM" class="sref">ENOMEM a>);4/289o/a>4/290 a> oa href="+code=inst" class="sref">inst a> = (void/*)(oa href="+code=p" class="sref">p a> + oa href="+code=head" class="sref">head a>);4/291o/a>4/292 a> oa href="+code=err" class="sref">err a> = -oa href="+code=ENAMETOOLONG" class="sref">ENAMETOOLONG a>;4/293 a> if (oa href="+code=snprintf" class="sref">snprintf a>(oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_driver_nam " class="sref">cra_driver_nam a>,/oa href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME a>,4/294 a> ospa3 class="string">"cryptd(%s)"o/spa3.,/oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_driver_nam " class="sref">cra_driver_nam a>) >= oa href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME a>)4/295 a> goto oa href="+code=out_free_inst" class="sref">out_free_inst a>;4/296o/a>4/297 a> oa href="+code=memcpy" class="sref">memcpy a>(oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_nam " class="sref">cra_nam a>,/oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_nam " class="sref">cra_nam a>,/oa href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME a>);4/298o/a>4/299 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_priority" class="sref">cra_priority a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_priority" class="sref">cra_priority a> + 50;4/300 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_blocksize" class="sref">cra_blocksize a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_blocksize" class="sref">cra_blocksize a>;4/301 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_alignmask" class="sref">cra_alignmask a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_alignmask" class="sref">cra_alignmask a>;4/302o/a>4/303o/a>oa href="+code=out" class="sref">outo/a>:4/304 a> return oa href="+code=p" class="sref">p a>;4/305o/a>4/306 a>oa href="+code=out_free_inst" class="sref">out_free_inst a>:4/307 a> oa href="+code=kfree" class="sref">kfree a>(oa href="+code=p" class="sref">p a>);4/308 a> oa href="+code=p" class="sref">p a> = oa href="+code=ERR_PTR" class="sref">ERR_PTR a>(oa href="+code=err" class="sref">err a>);4/309 a> goto oa href="+code=out" class="sref">out a>;4/310o/a>}4/311o/a>4/312 a>static int/oa href="+code=cryptd_create_blkcipher" class="sref">cryptd_create_blkcipher a>(struct/oa href="+code=crypto_templa e" class="sref">crypto_templa e a> *oa href="+code=tmpl" class="sref">tmpl a>,4/313 a> struct/oa href="+code=rtattr" class="sref">rtattr a> **oa href="+code=tb" class="sref">tb a>,4/314 a> struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> *oa href="+code=queue" class="sref">queue a>)4/315 a>{4/316 a> struct/oa href="+code=cryptd_instance_ctx" class="sref">cryptd_instance_ctx a> *oa href="+code=ctx" class="sref">ctx a>;4/317 a> struct/oa href="+code=crypto_instance" class="sref">crypto_instance a> *oa href="+code=inst" class="sref">inst a>;4/318 a> struct/oa href="+code=crypto_alg" class="sref">crypto_alg a> *oa href="+code=alg" class="sref">alg a>;4/319 a> int/oa href="+code=err" class="sref">err a>;4/320o/a>4/321 a> oa href="+code=alg" class="sref">alg a> = oa href="+code=crypto_get_attr_alg" class="sref">crypto_get_attr_alg a>(oa href="+code=tb" class="sref">tb a>,/oa href="+code=CRYPTO_ALG_TYPE_BLKCIPHER" class="sref">CRYPTO_ALG_TYPE_BLKCIPHER a>,4/322 a> oa href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK a>);4/323 a> if (oa href="+code=IS_ERR" class="sref">IS_ERR a>(oa href="+code=alg" class="sref">alg a>))4/324 a> return oa href="+code=PTR_ERR" class="sref">PTR_ERR a>(oa href="+code=alg" class="sref">alg a>);4/325o/a>4/326 a> oa href="+code=inst" class="sref">inst a> = oa href="+code=cryptd_alloc_instance" class="sref">cryptd_alloc_instance a>(oa href="+code=alg" class="sref">alg a>, 0, sizeof(*oa href="+code=ctx" class="sref">ctx a>));4/327 a> oa href="+code=err" class="sref">err a> = oa href="+code=PTR_ERR" class="sref">PTR_ERR a>(oa href="+code=inst" class="sref">inst a>);4/328 a> if (oa href="+code=IS_ERR" class="sref">IS_ERR a>(oa href="+code=inst" class="sref">inst a>))4/329 a> goto oa href="+code=out_put_alg" class="sref">out_put_alg a>;4/330o/a>4/331 a> oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_instance_ctx" class="sref">crypto_instance_ctx a>(oa href="+code=inst" class="sref">inst a>);4/332 a> oa href="+code=ctx" class="sref">ctx a>->oa href="+code=queue" class="sref">queue a> = oa href="+code=queue" class="sref">queue a>;4/333o/a>4/334 a> oa href="+code=err" class="sref">err a> = oa href="+code=crypto_init_spawn" class="sref">crypto_init_spawn a>(&oa href="+code=ctx" class="sref">ctx a>->oa href="+code=spawn" class="sref">spawn a>,/oa href="+code=alg" class="sref">alg a>,/oa href="+code=inst" class="sref">inst a>,4/335 a> oa href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK a> | oa href="+code=CRYPTO_ALG_ASYNC" class="sref">CRYPTO_ALG_ASYNC a>);4/336 a> if (oa href="+code=err" class="sref">err a>)4/337 a> goto oa href="+code=out_free_inst" class="sref">out_free_inst a>;4/338o/a>4/339 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_flags" class="sref">cra_flags a> = oa href="+code=CRYPTO_ALG_TYPE_ABLKCIPHER" class="sref">CRYPTO_ALG_TYPE_ABLKCIPHER a> | oa href="+code=CRYPTO_ALG_ASYNC" class="sref">CRYPTO_ALG_ASYNC a>;4/340 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_type" class="sref">cra_type a> = &oa href="+code=crypto_ablkcipher_type" class="sref">crypto_ablkcipher_type a>;4/341o/a>4/342 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_ablkcipher" class="sref">cra_ablkcipher a>.oa href="+code=ivsize" class="sref">ivsize a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_blkcipher" class="sref">cra_blkcipher a>.oa href="+code=ivsize" class="sref">ivsize a>;4/343 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_ablkcipher" class="sref">cra_ablkcipher a>.oa href="+code=min_keysize" class="sref">min_keysize a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_blkcipher" class="sref">cra_blkcipher a>.oa href="+code=min_keysize" class="sref">min_keysize a>;4/344 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_ablkcipher" class="sref">cra_ablkcipher a>.oa href="+code=max_keysize" class="sref">max_keysize a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_blkcipher" class="sref">cra_blkcipher a>.oa href="+code=max_keysize" class="sref">max_keysize a>;4/345o/a>4/346 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_ablkcipher" class="sref">cra_ablkcipher a>.oa href="+code=geniv" class="sref">geniv a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_blkcipher" class="sref">cra_blkcipher a>.oa href="+code=geniv" class="sref">geniv a>;4/347o/a>4/348 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_ctxsize" class="sref">cra_ctxsize a> = sizeof(struct/oa href="+code=cryptd_blkcipher_ctx" class="sref">cryptd_blkcipher_ctx a>);4/349o/a>4/350 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_init" class="sref">cra_init a> = oa href="+code=cryptd_blkcipher_init_tfm" class="sref">cryptd_blkcipher_init_tfm a>;4/351 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_exit" class="sref">cra_exit a> = oa href="+code=cryptd_blkcipher_exit_tfm" class="sref">cryptd_blkcipher_exit_tfm a>;4/352o/a>4/353 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_ablkcipher" class="sref">cra_ablkcipher a>.oa href="+code=setkey" class="sref">setkey a> = oa href="+code=cryptd_blkcipher_setkey" class="sref">cryptd_blkcipher_setkey a>;4/354 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_ablkcipher" class="sref">cra_ablkcipher a>.oa href="+code=encrypt" class="sref">encrypt a> = oa href="+code=cryptd_blkcipher_encrypt_enqueue" class="sref">cryptd_blkcipher_encrypt_enqueue a>;4/355 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_ablkcipher" class="sref">cra_ablkcipher a>.oa href="+code=decrypt" class="sref">decrypt a> = oa href="+code=cryptd_blkcipher_decrypt_enqueue" class="sref">cryptd_blkcipher_decrypt_enqueue a>;4/356o/a>4/357 a> oa href="+code=err" class="sref">err a> = oa href="+code=crypto_register_instance" class="sref">crypto_register_instance a>(oa href="+code=tmpl" class="sref">tmpl a>, oa href="+code=inst" class="sref">inst a>);4/358 a> if (oa href="+code=err" class="sref">err a>) {4/359 a> oa href="+code=crypto_drop_spawn" class="sref">crypto_drop_spawn a>(&oa href="+code=ctx" class="sref">ctx a>->oa href="+code=spawn" class="sref">spawn a>);4/360 a>oa href="+code=out_free_inst" class="sref">out_free_inst a>:4/361 a> oa href="+code=kfree" class="sref">kfree a>(oa href="+code=inst" class="sref">inst a>);4/362 a> }4/363o/a>4/364 a>oa href="+code=out_put_alg" class="sref">out_put_alg a>:4/365 a> oa href="+code=crypto_mod_put" class="sref">crypto_mod_put a>(oa href="+code=alg" class="sref">alg a>);4/366 a> return oa href="+code=err" class="sref">err a>;4/367 a>}4/368o/a>4/369 a>static int/oa href="+code=cryptd_hash_init_tfm" class="sref">cryptd_hash_init_tfm a>(struct/oa href="+code=crypto_tfm" class="sref">crypto_tfm a> *oa href="+code=tfm" class="sref">tfm a>)4/370 a>{4/371 a> struct/oa href="+code=crypto_instance" class="sref">crypto_instance a> *oa href="+code=inst" class="sref">inst a> = oa href="+code=crypto_tfm_alg_instance" class="sref">crypto_tfm_alg_instance a>(oa href="+code=tfm" class="sref">tfm a>);4/372 a> struct/oa href="+code=hashd_instance_ctx" class="sref">hashd_instance_ctx a> *oa href="+code=ictx" class="sref">ictx a> = oa href="+code=crypto_instance_ctx" class="sref">crypto_instance_ctx a>(oa href="+code=inst" class="sref">inst a>);4/373 a> struct/oa href="+code=crypto_shash_spawn" class="sref">crypto_shash_spawn a> *oa href="+code=spawn" class="sref">spawn a> =/&oa href="+code=ictx" class="sref">ictx a>->oa href="+code=spawn" class="sref">spawn a>;4/374 a> struct/oa href="+code=cryptd_hash_ctx" class="sref">cryptd_hash_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx a>(oa href="+code=tfm" class="sref">tfm a>);4/375 a> struct/oa href="+code=crypto_shash" class="sref">crypto_shash a> *oa href="+code=hash" class="sref">hash a>;4/376o/a>4/377 a> oa href="+code=hash" class="sref">hash a> = oa href="+code=crypto_spawn_shash" class="sref">crypto_spawn_shash a>(oa href="+code=spawn" class="sref">spawn a>);4/378 a> if (oa href="+code=IS_ERR" class="sref">IS_ERR a>(oa href="+code=hash" class="sref">hash a>))4/379 a> return oa href="+code=PTR_ERR" class="sref">PTR_ERR a>(oa href="+code=hash" class="sref">hash a>);4/380o/a>4/381 a> oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a> = oa href="+code=hash" class="sref">hash a>;4/382 a> oa href="+code=crypto_ahash_set_reqsize" class="sref">crypto_ahash_set_reqsize a>(oa href="+code=__crypto_ahash_cast" class="sref">__crypto_ahash_cast a>(oa href="+code=tfm" class="sref">tfm a>),4/383 a> sizeof(struct/oa href="+code=cryptd_hash_request_ctx" class="sref">cryptd_hash_request_ctx a>) +4/384 a> oa href="+code=crypto_shash_descsize" class="sref">crypto_shash_descsize a>(oa href="+code=hash" class="sref">hash a>));4/385 a> return 0;4/386 a>}4/387o/a>4/388 a>static void/oa href="+code=cryptd_hash_exit_tfm" class="sref">cryptd_hash_exit_tfm a>(struct/oa href="+code=crypto_tfm" class="sref">crypto_tfm a> *oa href="+code=tfm" class="sref">tfm a>)4/389o/a>{4/390 a> struct/oa href="+code=cryptd_hash_ctx" class="sref">cryptd_hash_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx a>(oa href="+code=tfm" class="sref">tfm a>);4/391o/a>4/392 a> oa href="+code=crypto_free_shash" class="sref">crypto_free_shash a>(oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>);4/393 a>}4/394 a>4/395 a>static int/oa href="+code=cryptd_hash_setkey" class="sref">cryptd_hash_setkey a>(struct/oa href="+code=crypto_ahash" class="sref">crypto_ahash a> *oa href="+code=parent" class="sref">parent a>,4/396 a> const/oa href="+code=u8" class="sref">u8 a> *oa href="+code=key" class="sref">key a>, unsigned int/oa href="+code=keylen" class="sref">keylen a>)4/397 a>{4/398 a> struct/oa href="+code=cryptd_hash_ctx" class="sref">cryptd_hash_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_ahash_ctx" class="sref">crypto_ahash_ctx a>(oa href="+code=parent" class="sref">parent a>);4/399 a> struct/oa href="+code=crypto_shash" class="sref">crypto_shash a> *oa href="+code=child" class="sref">child a> = oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>;4/400 a> int/oa href="+code=err" class="sref">err a>;4/401o/a>4/402 a> oa href="+code=crypto_shash_clear_flags" class="sref">crypto_shash_clear_flags a>(oa href="+code=child" class="sref">child a>,/oa href="+code=CRYPTO_TFM_REQ_MASK" class="sref">CRYPTO_TFM_REQ_MASK a>);4/403 a> oa href="+code=crypto_shash_set_flags" class="sref">crypto_shash_set_flags a>(oa href="+code=child" class="sref">child a>,/oa href="+code=crypto_ahash_get_flags" class="sref">crypto_ahash_get_flags a>(oa href="+code=parent" class="sref">parent a>)/&4/404 a> oa href="+code=CRYPTO_TFM_REQ_MASK" class="sref">CRYPTO_TFM_REQ_MASK a>);4/405 a> oa href="+code=err" class="sref">err a> = oa href="+code=crypto_shash_setkey" class="sref">crypto_shash_setkey a>(oa href="+code=child" class="sref">child a>,/oa href="+code=key" class="sref">key a>, oa href="+code=keylen" class="sref">keylen a>);4/406 a> oa href="+code=crypto_ahash_set_flags" class="sref">crypto_ahash_set_flags a>(oa href="+code=parent" class="sref">parent a>, oa href="+code=crypto_shash_get_flags" class="sref">crypto_shash_get_flags a>(oa href="+code=child" class="sref">child a>)/&4/407 a> oa href="+code=CRYPTO_TFM_RES_MASK" class="sref">CRYPTO_TFM_RES_MASK a>);4/408 a> return oa href="+code=err" class="sref">err a>;4/409 a>}4/410o/a>4/411o/a>static int/oa href="+code=cryptd_hash_enqueue" class="sref">cryptd_hash_enqueue a>(struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a>,4/412 a> oa href="+code=crypto_completion_t" class="sref">crypto_completion_t a> oa href="+code=complete" class="sref">complete a>)4/413 a>{4/414 a> struct/oa href="+code=cryptd_hash_request_ctx" class="sref">cryptd_hash_request_ctx a> *oa href="+code=rctx" class="sref">rctx a> = oa href="+code=ahash_request_ctx" class="sref">ahash_request_ctx a>(oa href="+code=req" class="sref">req a>);4/415 a> struct/oa href="+code=crypto_ahash" class="sref">crypto_ahash a> *oa href="+code=tfm" class="sref">tfm a> = oa href="+code=crypto_ahash_reqtfm" class="sref">crypto_ahash_reqtfm a>(oa href="+code=req" class="sref">req a>);4/416 a> struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> *oa href="+code=queue" class="sref">queue a> =4/417 a> oa href="+code=cryptd_get_queue" class="sref">cryptd_get_queue a>(oa href="+code=crypto_ahash_tfm" class="sref">crypto_ahash_tfm a>(oa href="+code=tfm" class="sref">tfm a>));4/418o/a>4/419 a> oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a> = oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>.oa href="+code=complete" class="sref">complete a>;4/420 a> oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>.oa href="+code=complete" class="sref">complete a> = oa href="+code=complete" class="sref">complete a>;4/421o/a>4/422 a> return oa href="+code=cryptd_enqueue_request" class="sref">cryptd_enqueue_request a>(oa href="+code=queue" class="sref">queue a>,/&oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>);4/423 a>}4/424 a>4/425 a>static void/oa href="+code=cryptd_hash_init" class="sref">cryptd_hash_init a>(struct/oa href="+code=crypto_async_request" class="sref">crypto_async_request a> *oa href="+code=req_async" class="sref">req_async a>,/int/oa href="+code=err" class="sref">err a>)4/426 a>{4/427 a> struct/oa href="+code=cryptd_hash_ctx" class="sref">cryptd_hash_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx a>(oa href="+code=req_async" class="sref">req_async a>->oa href="+code=tfm" class="sref">tfm a>);4/428 a> struct/oa href="+code=crypto_shash" class="sref">crypto_shash a> *oa href="+code=child" class="sref">child a> = oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>;4/429 a> struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a> = oa href="+code=ahash_request_cast" class="sref">ahash_request_cast a>(oa href="+code=req_async" class="sref">req_async a>);4/430 a> struct/oa href="+code=cryptd_hash_request_ctx" class="sref">cryptd_hash_request_ctx a> *oa href="+code=rctx" class="sref">rctx a> = oa href="+code=ahash_request_ctx" class="sref">ahash_request_ctx a>(oa href="+code=req" class="sref">req a>);4/431 a> struct/oa href="+code=shash_desc" class="sref">shash_desc a> *oa href="+code=desc" class="sref">desc a> =/&oa href="+code=rctx" class="sref">rctx a>->oa href="+code=desc" class="sref">desc a>;4/432o/a>4/433 a> if (oa href="+code=unlikely" class="sref">unlikely a>(oa href="+code=err" class="sref">err a> == -oa href="+code=EINPROGRESS" class="sref">EINPROGRESS a>))4/434 a> goto oa href="+code=out" class="sref">out a>;4/435o/a>4/436 a> oa href="+code=desc" class="sref">desc a>->oa href="+code=tfm" class="sref">tfm a> = oa href="+code=child" class="sref">child a>;4/437 a> oa href="+code=desc" class="sref">desc a>->oa href="+code=flags" class="sref">flags a> = oa href="+code=CRYPTO_TFM_REQ_MAY_SLEEP" class="sref">CRYPTO_TFM_REQ_MAY_SLEEP a>;4/438o/a>4/439 a> oa href="+code=err" class="sref">err a> = oa href="+code=crypto_shash_init" class="sref">crypto_shash_init a>(oa href="+code=desc" class="sref">desc a>);4/440o/a>4/441 a> oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>.oa href="+code=complete" class="sref">complete a> = oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a>;4/442o/a>4/443o/a>oa href="+code=out" class="sref">outo/a>:4/444 a> oa href="+code=local_bh_disable" class="sref">local_bh_disable a>();4/445 a> oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a>(&oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>, oa href="+code=err" class="sref">err a>);4/446 a> oa href="+code=local_bh_enable" class="sref">local_bh_enable a>();4/447 a>}4/448o/a>4/449 a>static int/oa href="+code=cryptd_hash_init_enqueue" class="sref">cryptd_hash_init_enqueue a>(struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a>)4/450 a>{4/451 a> return oa href="+code=cryptd_hash_enqueue" class="sref">cryptd_hash_enqueue a>(oa href="+code=req" class="sref">req a>,/oa href="+code=cryptd_hash_init" class="sref">cryptd_hash_init a>);4/452o/a>}4/453o/a>4/454 a>static void/oa href="+code=cryptd_hash_upda e" class="sref">cryptd_hash_upda e a>(struct/oa href="+code=crypto_async_request" class="sref">crypto_async_request a> *oa href="+code=req_async" class="sref">req_async a>,/int/oa href="+code=err" class="sref">err a>)4/455 a>{4/456 a> struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a> = oa href="+code=ahash_request_cast" class="sref">ahash_request_cast a>(oa href="+code=req_async" class="sref">req_async a>);4/457 a> struct/oa href="+code=cryptd_hash_request_ctx" class="sref">cryptd_hash_request_ctx a> *oa href="+code=rctx" class="sref">rctx a>;4/458o/a>4/459 a> oa href="+code=rctx" class="sref">rctx a> = oa href="+code=ahash_request_ctx" class="sref">ahash_request_ctx a>(oa href="+code=req" class="sref">req a>);4/460o/a>4/461 a> if (oa href="+code=unlikely" class="sref">unlikely a>(oa href="+code=err" class="sref">err a> == -oa href="+code=EINPROGRESS" class="sref">EINPROGRESS a>))4/462 a> goto oa href="+code=out" class="sref">out a>;4/463o/a>4/464 a> oa href="+code=err" class="sref">err a> = oa href="+code=shash_ahash_upda e" class="sref">shash_ahash_upda e a>(oa href="+code=req" class="sref">req a>,/&oa href="+code=rctx" class="sref">rctx a>->oa href="+code=desc" class="sref">desc a>);4/465o/a>4/466 a> oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>.oa href="+code=complete" class="sref">complete a> = oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a>;4/467o/a>4/468o/a>oa href="+code=out" class="sref">outo/a>:4/469 a> oa href="+code=local_bh_disable" class="sref">local_bh_disable a>();4/470 a> oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a>(&oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>, oa href="+code=err" class="sref">err a>);4/471 a> oa href="+code=local_bh_enable" class="sref">local_bh_enable a>();4/472o/a>}4/473o/a>4/474 a>static int/oa href="+code=cryptd_hash_upda e_enqueue" class="sref">cryptd_hash_upda e_enqueue a>(struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a>)4/475 a>{4/476 a> return oa href="+code=cryptd_hash_enqueue" class="sref">cryptd_hash_enqueue a>(oa href="+code=req" class="sref">req a>,/oa href="+code=cryptd_hash_upda e" class="sref">cryptd_hash_upda e a>);4/477 a>}4/478o/a>4/479 a>static void/oa href="+code=cryptd_hash_final" class="sref">cryptd_hash_final a>(struct/oa href="+code=crypto_async_request" class="sref">crypto_async_request a> *oa href="+code=req_async" class="sref">req_async a>,/int/oa href="+code=err" class="sref">err a>)4/480 a>{4/481 a> struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a> = oa href="+code=ahash_request_cast" class="sref">ahash_request_cast a>(oa href="+code=req_async" class="sref">req_async a>);4/482 a> struct/oa href="+code=cryptd_hash_request_ctx" class="sref">cryptd_hash_request_ctx a> *oa href="+code=rctx" class="sref">rctx a> = oa href="+code=ahash_request_ctx" class="sref">ahash_request_ctx a>(oa href="+code=req" class="sref">req a>);4/483o/a>4/484 a> if (oa href="+code=unlikely" class="sref">unlikely a>(oa href="+code=err" class="sref">err a> == -oa href="+code=EINPROGRESS" class="sref">EINPROGRESS a>))4/485 a> goto oa href="+code=out" class="sref">out a>;4/486o/a>4/487 a> oa href="+code=err" class="sref">err a> = oa href="+code=crypto_shash_final" class="sref">crypto_shash_final a>(&oa href="+code=rctx" class="sref">rctx a>->oa href="+code=desc" class="sref">desc a>,/oa href="+code=req" class="sref">req a>->oa href="+code=result" class="sref">result a>);4/488o/a>4/489 a> oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>.oa href="+code=complete" class="sref">complete a> = oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a>;4/490o/a>4/491o/a>oa href="+code=out" class="sref">outo/a>:4/492 a> oa href="+code=local_bh_disable" class="sref">local_bh_disable a>();4/493 a> oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a>(&oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>, oa href="+code=err" class="sref">err a>);4/494 a> oa href="+code=local_bh_enable" class="sref">local_bh_enable a>();4/495 a>}4/496o/a>4/497 a>static int/oa href="+code=cryptd_hash_final_enqueue" class="sref">cryptd_hash_final_enqueue a>(struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a>)4/498 a>{4/499 a> return oa href="+code=cryptd_hash_enqueue" class="sref">cryptd_hash_enqueue a>(oa href="+code=req" class="sref">req a>,/oa href="+code=cryptd_hash_final" class="sref">cryptd_hash_final a>);4/500 a>}4/501o/a>4/502 a>static void/oa href="+code=cryptd_hash_finup" class="sref">cryptd_hash_finup a>(struct/oa href="+code=crypto_async_request" class="sref">crypto_async_request a> *oa href="+code=req_async" class="sref">req_async a>,/int/oa href="+code=err" class="sref">err a>)4/503 a>{4/504 a> struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a> = oa href="+code=ahash_request_cast" class="sref">ahash_request_cast a>(oa href="+code=req_async" class="sref">req_async a>);4/505 a> struct/oa href="+code=cryptd_hash_request_ctx" class="sref">cryptd_hash_request_ctx a> *oa href="+code=rctx" class="sref">rctx a> = oa href="+code=ahash_request_ctx" class="sref">ahash_request_ctx a>(oa href="+code=req" class="sref">req a>);4/506o/a>4/507 a> if (oa href="+code=unlikely" class="sref">unlikely a>(oa href="+code=err" class="sref">err a> == -oa href="+code=EINPROGRESS" class="sref">EINPROGRESS a>))4/508 a> goto oa href="+code=out" class="sref">out a>;4/509o/a>4/510 a> oa href="+code=err" class="sref">err a> = oa href="+code=shash_ahash_finup" class="sref">shash_ahash_finup a>(oa href="+code=req" class="sref">req a>,/&oa href="+code=rctx" class="sref">rctx a>->oa href="+code=desc" class="sref">desc a>);4/511o/a>4/512 a> oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>.oa href="+code=complete" class="sref">complete a> = oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a>;4/513o/a>4/514 a>oa href="+code=out" class="sref">outo/a>:4/515 a> oa href="+code=local_bh_disable" class="sref">local_bh_disable a>();4/516 a> oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a>(&oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>, oa href="+code=err" class="sref">err a>);4/517 a> oa href="+code=local_bh_enable" class="sref">local_bh_enable a>();4/518o/a>}4/519o/a>4/520 a>static int/oa href="+code=cryptd_hash_finup_enqueue" class="sref">cryptd_hash_finup_enqueue a>(struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a>)4/521o/a>{4/522 a> return oa href="+code=cryptd_hash_enqueue" class="sref">cryptd_hash_enqueue a>(oa href="+code=req" class="sref">req a>,/oa href="+code=cryptd_hash_finup" class="sref">cryptd_hash_finup a>);4/523 a>}4/524 a>4/525 a>static void/oa href="+code=cryptd_hash_digest" class="sref">cryptd_hash_digest a>(struct/oa href="+code=crypto_async_request" class="sref">crypto_async_request a> *oa href="+code=req_async" class="sref">req_async a>,/int/oa href="+code=err" class="sref">err a>)4/526 a>{4/527 a> struct/oa href="+code=cryptd_hash_ctx" class="sref">cryptd_hash_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx a>(oa href="+code=req_async" class="sref">req_async a>->oa href="+code=tfm" class="sref">tfm a>);4/528 a> struct/oa href="+code=crypto_shash" class="sref">crypto_shash a> *oa href="+code=child" class="sref">child a> = oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>;4/529 a> struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a> = oa href="+code=ahash_request_cast" class="sref">ahash_request_cast a>(oa href="+code=req_async" class="sref">req_async a>);4/530 a> struct/oa href="+code=cryptd_hash_request_ctx" class="sref">cryptd_hash_request_ctx a> *oa href="+code=rctx" class="sref">rctx a> = oa href="+code=ahash_request_ctx" class="sref">ahash_request_ctx a>(oa href="+code=req" class="sref">req a>);4/531 a> struct/oa href="+code=shash_desc" class="sref">shash_desc a> *oa href="+code=desc" class="sref">desc a> =/&oa href="+code=rctx" class="sref">rctx a>->oa href="+code=desc" class="sref">desc a>;4/532o/a>4/533 a> if (oa href="+code=unlikely" class="sref">unlikely a>(oa href="+code=err" class="sref">err a> == -oa href="+code=EINPROGRESS" class="sref">EINPROGRESS a>))4/534 a> goto oa href="+code=out" class="sref">out a>;4/535o/a>4/536 a> oa href="+code=desc" class="sref">desc a>->oa href="+code=tfm" class="sref">tfm a> = oa href="+code=child" class="sref">child a>;4/537 a> oa href="+code=desc" class="sref">desc a>->oa href="+code=flags" class="sref">flags a> = oa href="+code=CRYPTO_TFM_REQ_MAY_SLEEP" class="sref">CRYPTO_TFM_REQ_MAY_SLEEP a>;4/538o/a>4/539 a> oa href="+code=err" class="sref">err a> = oa href="+code=shash_ahash_digest" class="sref">shash_ahash_digest a>(oa href="+code=req" class="sref">req a>,/oa href="+code=desc" class="sref">desc a>);4/540o/a>4/541 a> oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>.oa href="+code=complete" class="sref">complete a> = oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a>;4/542o/a>4/543o/a>oa href="+code=out" class="sref">outo/a>:4/544 a> oa href="+code=local_bh_disable" class="sref">local_bh_disable a>();4/545 a> oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a>(&oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>, oa href="+code=err" class="sref">err a>);4/546 a> oa href="+code=local_bh_enable" class="sref">local_bh_enable a>();4/547 a>}4/548o/a>4/549 a>static int/oa href="+code=cryptd_hash_digest_enqueue" class="sref">cryptd_hash_digest_enqueue a>(struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a>)4/550 a>{4/551 a> return oa href="+code=cryptd_hash_enqueue" class="sref">cryptd_hash_enqueue a>(oa href="+code=req" class="sref">req a>,/oa href="+code=cryptd_hash_digest" class="sref">cryptd_hash_digest a>);4/552o/a>}4/553o/a>4/554 a>static int/oa href="+code=cryptd_hash_export" class="sref">cryptd_hash_export a>(struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a>, void/*oa href="+code=out" class="sref">outo/a>)4/555 a>{4/556 a> struct/oa href="+code=cryptd_hash_request_ctx" class="sref">cryptd_hash_request_ctx a> *oa href="+code=rctx" class="sref">rctx a> = oa href="+code=ahash_request_ctx" class="sref">ahash_request_ctx a>(oa href="+code=req" class="sref">req a>);4/557o/a>4/558 a> return oa href="+code=crypto_shash_export" class="sref">crypto_shash_export a>(&oa href="+code=rctx" class="sref">rctx a>->oa href="+code=desc" class="sref">desc a>,/oa href="+code=out" class="sref">outo/a>);4/559 a>}4/560o/a>4/561o/a>static int/oa href="+code=cryptd_hash_import" class="sref">cryptd_hash_import a>(struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a>, const/void/*oa href="+code=in" class="sref">in a>)4/562 a>{4/563 a> struct/oa href="+code=cryptd_hash_request_ctx" class="sref">cryptd_hash_request_ctx a> *oa href="+code=rctx" class="sref">rctx a> = oa href="+code=ahash_request_ctx" class="sref">ahash_request_ctx a>(oa href="+code=req" class="sref">req a>);4/564 a>4/565 a> return oa href="+code=crypto_shash_import" class="sref">crypto_shash_import a>(&oa href="+code=rctx" class="sref">rctx a>->oa href="+code=desc" class="sref">desc a>,/oa href="+code=in" class="sref">in a>);4/566 a>}4/567o/a>4/568o/a>static int/oa href="+code=cryptd_crea e_hash" class="sref">cryptd_crea e_hash a>(struct/oa href="+code=crypto_templa e" class="sref">crypto_templa e a> *oa href="+code=tmpl" class="sref">tmpl a>,/struct/oa href="+code=rtattr" class="sref">rtattr a> **oa href="+code=tb" class="sref">tb a>,4/569 a> struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> *oa href="+code=queue" class="sref">queue a>)4/570 a>{4/571 a> struct/oa href="+code=hashd_instance_ctx" class="sref">hashd_instance_ctx a> *oa href="+code=ctx" class="sref">ctx a>;4/572 a> struct/oa href="+code=ahash_instance" class="sref">ahash_instance a> *oa href="+code=inst" class="sref">inst a>;4/573 a> struct/oa href="+code=shash_alg" class="sref">shash_alg a> *oa href="+code=salg" class="sref">salg a>;4/574 a> struct/oa href="+code=crypto_alg" class="sref">crypto_alg a> *oa href="+code=alg" class="sref">alg a>;4/575 a> int/oa href="+code=err" class="sref">err a>;4/576o/a>4/577 a> oa href="+code=salg" class="sref">salg a> = oa href="+code=shash_attr_alg" class="sref">shash_attr_alg a>(oa href="+code=tb" class="sref">tb a>[1], 0, 0);4/578 a> if (oa href="+code=IS_ERR" class="sref">IS_ERR a>(oa href="+code=salg" class="sref">salg a>))4/579 a> return oa href="+code=PTR_ERR" class="sref">PTR_ERR a>(oa href="+code=salg" class="sref">salg a>);4/580o/a>4/581 a> oa href="+code=alg" class="sref">alg a> =/&oa href="+code=salg" class="sref">salg a>->oa href="+code=base" class="sref">base a>;4/582 a> oa href="+code=inst" class="sref">inst a> = oa href="+code=cryptd_alloc_instance" class="sref">cryptd_alloc_instance a>(oa href="+code=alg" class="sref">alg a>,/oa href="+code=ahash_instance_headroom" class="sref">ahash_instance_headroom a>(),4/583 a> sizeof(*oa href="+code=ctx" class="sref">ctx a>));4/584 a> oa href="+code=err" class="sref">err a> = oa href="+code=PTR_ERR" class="sref">PTR_ERR a>(oa href="+code=inst" class="sref">inst a>);4/585 a> if (oa href="+code=IS_ERR" class="sref">IS_ERR a>(oa href="+code=inst" class="sref">inst a>))4/586 a> goto oa href="+code=out_put_alg" class="sref">out_put_alg a>;4/587o/a>4/588 a> oa href="+code=ctx" class="sref">ctx a> = oa href="+code=ahash_instance_ctx" class="sref">ahash_instance_ctx a>(oa href="+code=inst" class="sref">inst a>);4/589 a> oa href="+code=ctx" class="sref">ctx a>->oa href="+code=queue" class="sref">queue a> = oa href="+code=queue" class="sref">queue a>;4/590o/a>4/591 a> oa href="+code=err" class="sref">err a> = oa href="+code=crypto_init_shash_spawn" class="sref">crypto_init_shash_spawn a>(&oa href="+code=ctx" class="sref">ctx a>->oa href="+code=spawn" class="sref">spawn a>,/oa href="+code=salg" class="sref">salg a>,4/592 a> oa href="+code=ahash_crypto_instance" class="sref">ahash_crypto_instance a>(oa href="+code=inst" class="sref">inst a>));4/593 a> if (oa href="+code=err" class="sref">err a>)4/594 a> goto oa href="+code=out_free_inst" class="sref">out_free_inst a>;4/595o/a>4/596 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=halg" class="sref">halg a>.oa href="+code=base" class="sref">base a>.oa href="+code=cra_flags" class="sref">cra_flags a> = oa href="+code=CRYPTO_ALG_ASYNC" class="sref">CRYPTO_ALG_ASYNC a>;4/597o/a>4/598 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=halg" class="sref">halg a>.oa href="+code=digestsize" class="sref">digestsize a> = oa href="+code=salg" class="sref">salg a>->oa href="+code=digestsize" class="sref">digestsize a>;4/599 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=halg" class="sref">halg a>.oa href="+code=base" class="sref">base a>.oa href="+code=cra_ctxsize" class="sref">cra_ctxsize a> = sizeof(struct/oa href="+code=cryptd_hash_ctx" class="sref">cryptd_hash_ctx a>);4/600o/a>4/601 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=halg" class="sref">halg a>.oa href="+code=base" class="sref">base a>.oa href="+code=cra_init" class="sref">cra_init a> = oa href="+code=cryptd_hash_init_tfm" class="sref">cryptd_hash_init_tfm a>;4/602 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=halg" class="sref">halg a>.oa href="+code=base" class="sref">base a>.oa href="+code=cra_exit" class="sref">cra_exit a> = oa href="+code=cryptd_hash_exit_tfm" class="sref">cryptd_hash_exit_tfm a>;4/603o/a>4/604 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=init" class="sref">init a> = oa href="+code=cryptd_hash_init_enqueue" class="sref">cryptd_hash_init_enqueue a>;4/605 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=upda e" class="sref">upda e a> = oa href="+code=cryptd_hash_upda e_enqueue" class="sref">cryptd_hash_upda e_enqueue a>;4/606 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=final" class="sref">final a> = oa href="+code=cryptd_hash_final_enqueue" class="sref">cryptd_hash_final_enqueue a>;4/607 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=finup" class="sref">finup a> = oa href="+code=cryptd_hash_finup_enqueue" class="sref">cryptd_hash_finup_enqueue a>;4/608 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=export" class="sref">export a> = oa href="+code=cryptd_hash_export" class="sref">cryptd_hash_export a>;4/609 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=import" class="sref">import a> = oa href="+code=cryptd_hash_import" class="sref">cryptd_hash_import a>;4/610 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=setkey" class="sref">setkey a> = oa href="+code=cryptd_hash_setkey" class="sref">cryptd_hash_setkey a>;4/611 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=digest" class="sref">digest a> = oa href="+code=cryptd_hash_digest_enqueue" class="sref">cryptd_hash_digest_enqueue a>;4/612o/a>4/613 a> oa href="+code=err" class="sref">err a> = oa href="+code=ahash_register_instance" class="sref">ahash_register_instance a>(oa href="+code=tmpl" class="sref">tmpl a>,/oa href="+code=inst" class="sref">inst a>);4/614 a> if (oa href="+code=err" class="sref">err a>) {4/615 a> oa href="+code=crypto_drop_shash" class="sref">crypto_drop_shash a>(&oa href="+code=ctx" class="sref">ctx a>->oa href="+code=spawn" class="sref">spawn a>);4/616 a>oa href="+code=out_free_inst" class="sref">out_free_inst a>:4/617 a> oa href="+code=kfree" class="sref">kfree a>(oa href="+code=inst" class="sref">inst a>);4/618 a> }4/619o/a>4/620 a>oa href="+code=out_put_alg" class="sref">out_put_alg a>:4/621 a> oa href="+code=crypto_mod_put" class="sref">crypto_mod_put a>(oa href="+code=alg" class="sref">alg a>);4/622 a> return oa href="+code=err" class="sref">err a>;4/623 a>}4/624 a>4/625 a>static void/oa href="+code=cryptd_aead_crypt" class="sref">cryptd_aead_crypt a>(struct/oa href="+code=aead_request" class="sref">aead_request a> *oa href="+code=req" class="sref">req a>,4/626 a> struct/oa href="+code=crypto_aead" class="sref">crypto_aead a> *oa href="+code=child" class="sref">child a>,4/627 a> int/oa href="+code=err" class="sref">err a>,4/628 a> int/(*oa href="+code=crypt" class="sref">crypt a>)(struct/oa href="+code=aead_request" class="sref">aead_request a> *oa href="+code=req" class="sref">req a>))4/629 a>{4/630 a> struct/oa href="+code=cryptd_aead_request_ctx" class="sref">cryptd_aead_request_ctx a> *oa href="+code=rctx" class="sref">rctx a>;4/631 a> oa href="+code=rctx" class="sref">rctx a> = oa href="+code=aead_request_ctx" class="sref">aead_request_ctx a>(oa href="+code=req" class="sref">req a>);4/632o/a>4/633 a> if (oa href="+code=unlikely" class="sref">unlikely a>(oa href="+code=err" class="sref">err a> == -oa href="+code=EINPROGRESS" class="sref">EINPROGRESS a>))4/634 a> goto oa href="+code=out" class="sref">out a>;4/635 a> oa href="+code=aead_request_set_tfm" class="sref">aead_request_set_tfm a>(oa href="+code=req" class="sref">req a>,/oa href="+code=child" class="sref">child a>);4/636 a> oa href="+code=err" class="sref">err a> = oa href="+code=crypt" class="sref">crypt a>( oa href="+code=req" class="sref">req a> );4/637 a> oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>.oa href="+code=complete" class="sref">complete a> = oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a>;4/638o/a>oa href="+code=out" class="sref">outo/a>:4/639 a> oa href="+code=local_bh_disable" class="sref">local_bh_disable a>();4/640 a> oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a>(&oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>, oa href="+code=err" class="sref">err a>);4/641 a> oa href="+code=local_bh_enable" class="sref">local_bh_enable a>();4/642o/a>}4/643o/a>4/644 a>static void/oa href="+code=cryptd_aead_encrypt" class="sref">cryptd_aead_encrypt a>(struct/oa href="+code=crypto_async_request" class="sref">crypto_async_request a> *oa href="+code=areq" class="sref">areq a>,/int/oa href="+code=err" class="sref">err a>)4/645 a>{4/646 a> struct/oa href="+code=cryptd_aead_ctx" class="sref">cryptd_aead_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx a>(oa href="+code=areq" class="sref">areq a>->oa href="+code=tfm" class="sref">tfm a>);4/647 a> struct/oa href="+code=crypto_aead" class="sref">crypto_aead a> *oa href="+code=child" class="sref">child a> = oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>;4/648 a> struct/oa href="+code=aead_request" class="sref">aead_request a> *oa href="+code=req" class="sref">req a>;4/649o/a>4/650 a> oa href="+code=req" class="sref">req a> = oa href="+code=container_of" class="sref">container_of a>(oa href="+code=areq" class="sref">areq a>,/struct/oa href="+code=aead_request" class="sref">aead_request a>, oa href="+code=base" class="sref">base a>);4/651 a> oa href="+code=cryptd_aead_crypt" class="sref">cryptd_aead_crypt a>(oa href="+code=req" class="sref">req a>,/oa href="+code=child" class="sref">child a>, oa href="+code=err" class="sref">err a>,/oa href="+code=crypto_aead_crt" class="sref">crypto_aead_crt a>(oa href="+code=child" class="sref">child a>)->oa href="+code=encrypt" class="sref">encrypt a>);4/652o/a>}4/653o/a>4/654 a>static void/oa href="+code=cryptd_aead_decrypt" class="sref">cryptd_aead_decrypt a>(struct/oa href="+code=crypto_async_request" class="sref">crypto_async_request a> *oa href="+code=areq" class="sref">areq a>,/int/oa href="+code=err" class="sref">err a>)4/655 a>{4/656 a> struct/oa href="+code=cryptd_aead_ctx" class="sref">cryptd_aead_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx a>(oa href="+code=areq" class="sref">areq a>->oa href="+code=tfm" class="sref">tfm a>);4/657 a> struct/oa href="+code=crypto_aead" class="sref">crypto_aead a> *oa href="+code=child" class="sref">child a> = oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>;4/658 a> struct/oa href="+code=aead_request" class="sref">aead_request a> *oa href="+code=req" class="sref">req a>;4/659o/a>4/660 a> oa href="+code=req" class="sref">req a> = oa href="+code=container_of" class="sref">container_of a>(oa href="+code=areq" class="sref">areq a>,/struct/oa href="+code=aead_request" class="sref">aead_request a>, oa href="+code=base" class="sref">base a>);4/661 a> oa href="+code=cryptd_aead_crypt" class="sref">cryptd_aead_crypt a>(oa href="+code=req" class="sref">req a>,/oa href="+code=child" class="sref">child a>, oa href="+code=err" class="sref">err a>,/oa href="+code=crypto_aead_crt" class="sref">crypto_aead_crt a>(oa href="+code=child" class="sref">child a>)->oa href="+code=decrypt" class="sref">decrypt a>);4/662o/a>}4/663o/a>4/664 a>static int/oa href="+code=cryptd_aead_enqueue" class="sref">cryptd_aead_enqueue a>(struct/oa href="+code=aead_request" class="sref">aead_request a> *oa href="+code=req" class="sref">req a>,4/665 a> oa href="+code=crypto_completion_t" class="sref">crypto_completion_t a> oa href="+code=complete" class="sref">complete a>)4/666 a>{4/667 a> struct/oa href="+code=cryptd_aead_request_ctx" class="sref">cryptd_aead_request_ctx a> *oa href="+code=rctx" class="sref">rctx a> = oa href="+code=aead_request_ctx" class="sref">aead_request_ctx a>(oa href="+code=req" class="sref">req a>);4/668 a> struct/oa href="+code=crypto_aead" class="sref">crypto_aead a> *oa href="+code=tfm" class="sref">tfm a> = oa href="+code=crypto_aead_reqtfm" class="sref">crypto_aead_reqtfm a>(oa href="+code=req" class="sref">req a>);4/669 a> struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> *oa href="+code=queue" class="sref">queue a> = oa href="+code=cryptd_get_queue" class="sref">cryptd_get_queue a>(oa href="+code=crypto_aead_tfm" class="sref">crypto_aead_tfm a>(oa href="+code=tfm" class="sref">tfm a>));4/670o/a>4/671 a> oa href="+code=rctx" class="sref">rctx a>->oa href="+code=complete" class="sref">complete a> = oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>.oa href="+code=complete" class="sref">complete a>;4/672 a> oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>.oa href="+code=complete" class="sref">complete a> = oa href="+code=complete" class="sref">complete a>;4/673 a> return oa href="+code=cryptd_enqueue_request" class="sref">cryptd_enqueue_request a>(oa href="+code=queue" class="sref">queue a>,/&oa href="+code=req" class="sref">req a>->oa href="+code=base" class="sref">base a>);4/674 a>}4/675o/a>4/676o/a>static int/oa href="+code=cryptd_aead_encrypt_enqueue" class="sref">cryptd_aead_encrypt_enqueue a>(struct/oa href="+code=aead_request" class="sref">aead_request a> *oa href="+code=req" class="sref">req a>)4/677 a>{4/678 a> return oa href="+code=cryptd_aead_enqueue" class="sref">cryptd_aead_enqueue a>(oa href="+code=req" class="sref">req a>,/oa href="+code=cryptd_aead_encrypt" class="sref">cryptd_aead_encrypt a> );4/679 a>}4/680o/a>4/681o/a>static int/oa href="+code=cryptd_aead_decrypt_enqueue" class="sref">cryptd_aead_decrypt_enqueue a>(struct/oa href="+code=aead_request" class="sref">aead_request a> *oa href="+code=req" class="sref">req a>)4/682 a>{4/683 a> return oa href="+code=cryptd_aead_enqueue" class="sref">cryptd_aead_enqueue a>(oa href="+code=req" class="sref">req a>,/oa href="+code=cryptd_aead_decrypt" class="sref">cryptd_aead_decrypt a> );4/684 a>}4/685o/a>4/686o/a>static int/oa href="+code=cryptd_aead_init_tfm" class="sref">cryptd_aead_init_tfm a>(struct/oa href="+code=crypto_tfm" class="sref">crypto_tfm a> *oa href="+code=tfm" class="sref">tfm a>)4/687 a>{4/688 a> struct/oa href="+code=crypto_instance" class="sref">crypto_instance a> *oa href="+code=inst" class="sref">inst a> = oa href="+code=crypto_tfm_alg_instance" class="sref">crypto_tfm_alg_instance a>(oa href="+code=tfm" class="sref">tfm a>);4/689 a> struct/oa href="+code=aead_instance_ctx" class="sref">aead_instance_ctx a> *oa href="+code=ictx" class="sref">ictx a> = oa href="+code=crypto_instance_ctx" class="sref">crypto_instance_ctx a>(oa href="+code=inst" class="sref">inst a>);4/690 a> struct/oa href="+code=crypto_aead_spawn" class="sref">crypto_aead_spawn a> *oa href="+code=spawn" class="sref">spawn a> =/&oa href="+code=ictx" class="sref">ictx a>->oa href="+code=aead_spawn" class="sref">aead_spawn a>;4/691 a> struct/oa href="+code=cryptd_aead_ctx" class="sref">cryptd_aead_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx a>(oa href="+code=tfm" class="sref">tfm a>);4/692 a> struct/oa href="+code=crypto_aead" class="sref">crypto_aead a> *oa href="+code=cipher" class="sref">cipher a>;4/693o/a>4/694 a> oa href="+code=cipher" class="sref">cipher a> = oa href="+code=crypto_spawn_aead" class="sref">crypto_spawn_aead a>(oa href="+code=spawn" class="sref">spawn a>);4/695 a> if (oa href="+code=IS_ERR" class="sref">IS_ERR a>(oa href="+code=cipher" class="sref">cipher a>))4/696 a> return oa href="+code=PTR_ERR" class="sref">PTR_ERR a>(oa href="+code=cipher" class="sref">cipher a>);4/697o/a>4/698 a> oa href="+code=crypto_aead_set_flags" class="sref">crypto_aead_set_flags a>(oa href="+code=cipher" class="sref">cipher a>,/oa href="+code=CRYPTO_TFM_REQ_MAY_SLEEP" class="sref">CRYPTO_TFM_REQ_MAY_SLEEP a>);4/699 a> oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a> = oa href="+code=cipher" class="sref">cipher a>;4/700 a> oa href="+code=tfm" class="sref">tfm a>->oa href="+code=crt_aead" class="sref">crt_aead a>.oa href="+code=reqsize" class="sref">reqsize a> = sizeof(struct/oa href="+code=cryptd_aead_request_ctx" class="sref">cryptd_aead_request_ctx a>);4/701 a> return 0;4/702o/a>}4/703o/a>4/704 a>static void/oa href="+code=cryptd_aead_exit_tfm" class="sref">cryptd_aead_exit_tfm a>(struct/oa href="+code=crypto_tfm" class="sref">crypto_tfm a> *oa href="+code=tfm" class="sref">tfm a>)4/705 a>{4/706 a> struct/oa href="+code=cryptd_aead_ctx" class="sref">cryptd_aead_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx a>(oa href="+code=tfm" class="sref">tfm a>);4/707 a> oa href="+code=crypto_free_aead" class="sref">crypto_free_aead a>(oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>);4/708 a>}4/709o/a>4/710 a>static int/oa href="+code=cryptd_crea e_aead" class="sref">cryptd_crea e_aead a>(struct/oa href="+code=crypto_templa e" class="sref">crypto_templa e a> *oa href="+code=tmpl" class="sref">tmpl a>,4/711 a> struct/oa href="+code=rtattr" class="sref">rtattr a> **oa href="+code=tb" class="sref">tb a>,4/712 a> struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> *oa href="+code=queue" class="sref">queue a>)4/713 a>{4/714 a> struct/oa href="+code=aead_instance_ctx" class="sref">aead_instance_ctx a> *oa href="+code=ctx" class="sref">ctx a>;4/715 a> struct/oa href="+code=crypto_instance" class="sref">crypto_instance a> *oa href="+code=inst" class="sref">inst a>;4/716 a> struct/oa href="+code=crypto_alg" class="sref">crypto_alg a> *oa href="+code=alg" class="sref">alg a>;4/717 a> int/oa href="+code=err" class="sref">err a>;4/718 a>4/719 a> oa href="+code=alg" class="sref">alg a> =/oa href="+code=crypto_get_attr_alg" class="sref">crypto_get_attr_alg a>(oa href="+code=tb" class="sref">tb a>,/oa href="+code=CRYPTO_ALG_TYPE_AEAD" class="sref">CRYPTO_ALG_TYPE_AEAD a>,4/720 a> oa href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK a>);4/721 a> if (oa href="+code=IS_ERR" class="sref">IS_ERR a>(oa href="+code=alg" class="sref">alg a>))4/722 a> return oa href="+code=PTR_ERR" class="sref">PTR_ERR a>(oa href="+code=alg" class="sref">alg a>);4/723o/a>4/724 a> oa href="+code=inst" class="sref">inst a> = oa href="+code=cryptd_alloc_instance" class="sref">cryptd_alloc_instance a>(oa href="+code=alg" class="sref">alg a>,/0, sizeof(*oa href="+code=ctx" class="sref">ctx a>));4/725 a> oa href="+code=err" class="sref">err a> = oa href="+code=PTR_ERR" class="sref">PTR_ERR a>(oa href="+code=inst" class="sref">inst a>);4/726 a> if (oa href="+code=IS_ERR" class="sref">IS_ERR a>(oa href="+code=inst" class="sref">inst a>))4/727 a> goto oa href="+code=out_put_alg" class="sref">out_put_alg a>;4/728 a>4/729 a> oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_instance_ctx" class="sref">crypto_instance_ctx a>(oa href="+code=inst" class="sref">inst a>);4/730 a> oa href="+code=ctx" class="sref">ctx a>->oa href="+code=queue" class="sref">queue a> = oa href="+code=queue" class="sref">queue a>;4/731 a>4/732 a> oa href="+code=err" class="sref">err a> = oa href="+code=crypto_init_spawn" class="sref">crypto_init_spawn a>(&oa href="+code=ctx" class="sref">ctx a>->oa href="+code=aead_spawn" class="sref">aead_spawn a>.oa href="+code=base" class="sref">base a>,/oa href="+code=alg" class="sref">alg a>,/oa href="+code=inst" class="sref">inst a>,4/733 a> oa href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK a> | oa href="+code=CRYPTO_ALG_ASYNC" class="sref">CRYPTO_ALG_ASYNC a>);4/734 a> if (oa href="+code=err" class="sref">err a>)4/735 a> goto oa href="+code=out_free_inst" class="sref">out_free_inst a>;4/736o/a>4/737 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_flags" class="sref">cra_flags a> = oa href="+code=CRYPTO_ALG_TYPE_AEAD" class="sref">CRYPTO_ALG_TYPE_AEAD a> | oa href="+code=CRYPTO_ALG_ASYNC" class="sref">CRYPTO_ALG_ASYNC a>;4/738 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_type" class="sref">cra_type a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_type" class="sref">cra_type a>;4/739 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_ctxsize" class="sref">cra_ctxsize a> = sizeof(struct/oa href="+code=cryptd_aead_ctx" class="sref">cryptd_aead_ctx a>);4/740 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_init" class="sref">cra_init a> = oa href="+code=cryptd_aead_init_tfm" class="sref">cryptd_aead_init_tfm a>;4/741 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_exit" class="sref">cra_exit a> = oa href="+code=cryptd_aead_exit_tfm" class="sref">cryptd_aead_exit_tfm a>;4/742 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=setkey" class="sref">setkey a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=setkey" class="sref">setkey a>;4/743 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=setauthsize" class="sref">setauthsize a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=setauthsize" class="sref">setauthsize a>;4/744 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=geniv" class="sref">geniv a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=geniv" class="sref">geniv a>;4/745 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=ivsize" class="sref">ivsize a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=ivsize" class="sref">ivsize a>;4/746 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=maxauthsize" class="sref">maxauthsize a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=maxauthsize" class="sref">maxauthsize a>;4/747 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=encrypt" class="sref">encrypt a> = oa href="+code=cryptd_aead_encrypt_enqueue" class="sref">cryptd_aead_encrypt_enqueue a>;4/748 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=decrypt" class="sref">decrypt a> = oa href="+code=cryptd_aead_decrypt_enqueue" class="sref">cryptd_aead_decrypt_enqueue a>;4/749 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=givencrypt" class="sref">givencrypt a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=givencrypt" class="sref">givencrypt a>;4/750 a> oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=givdecrypt" class="sref">givdecrypt a> = oa href="+code=alg" class="sref">alg a>->oa href="+code=cra_aead" class="sref">cra_aead a>.oa href="+code=givdecrypt" class="sref">givdecrypt a>;4/751 a>4/752 a> oa href="+code=err" class="sref">err a> = oa href="+code=crypto_register_instance" class="sref">crypto_register_instance a>(oa href="+code=tmpl" class="sref">tmpl a>,/oa href="+code=inst" class="sref">inst a>);4/753 a> if (oa href="+code=err" class="sref">err a>) {4/754 a> oa href="+code=crypto_drop_spawn" class="sref">crypto_drop_spawn a>(&oa href="+code=ctx" class="sref">ctx a>->oa href="+code=aead_spawn" class="sref">aead_spawn a>.oa href="+code=base" class="sref">base a>);4/755 a>oa href="+code=out_free_inst" class="sref">out_free_inst a>:4/756 a> oa href="+code=kfree" class="sref">kfree a>(oa href="+code=inst" class="sref">inst a>);4/757 a> }4/758o/a>oa href="+code=out_put_alg" class="sref">out_put_alg a>:4/759 a> oa href="+code=crypto_mod_put" class="sref">crypto_mod_put a>(oa href="+code=alg" class="sref">alg a>);4/760 a> return oa href="+code=err" class="sref">err a>;4/761 a>}4/762o/a>4/763o/a>static struct/oa href="+code=cryptd_queue" class="sref">cryptd_queue a> oa href="+code=queue" class="sref">queue a>;4/764 a>4/765 a>static int/oa href="+code=cryptd_crea e" class="sref">cryptd_crea e a>(struct/oa href="+code=crypto_templa e" class="sref">crypto_templa e a> *oa href="+code=tmpl" class="sref">tmpl a>, struct/oa href="+code=rtattr" class="sref">rtattr a> **oa href="+code=tb" class="sref">tb a>)4/766 a>{4/767 a> struct/oa href="+code=crypto_attr_type" class="sref">crypto_attr_type a> *oa href="+code=algt" class="sref">algt a>;4/768 a>4/769 a> oa href="+code=algt" class="sref">algt a> =/oa href="+code=crypto_get_attr_type" class="sref">crypto_get_attr_type a>(oa href="+code=tb" class="sref">tb a>);4/770 a> if (oa href="+code=IS_ERR" class="sref">IS_ERR a>(oa href="+code=algt" class="sref">algt a>))4/771 a> return oa href="+code=PTR_ERR" class="sref">PTR_ERR a>(oa href="+code=algt" class="sref">algt a>);4/772o/a>4/773 a> switch (oa href="+code=algt" class="sref">algt a>->oa href="+code=type" class="sref">type a> & oa href="+code=algt" class="sref">algt a>->oa href="+code=mask" class="sref">mask a> & oa href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK a>) {4/774 a> case oa href="+code=CRYPTO_ALG_TYPE_BLKCIPHER" class="sref">CRYPTO_ALG_TYPE_BLKCIPHER a>:4/775 a> return oa href="+code=cryptd_crea e_blkcipher" class="sref">cryptd_crea e_blkcipher a>(oa href="+code=tmpl" class="sref">tmpl a>,/oa href="+code=tb" class="sref">tb a>,/&oa href="+code=queue" class="sref">queue a>);4/776 a> case oa href="+code=CRYPTO_ALG_TYPE_DIGEST" class="sref">CRYPTO_ALG_TYPE_DIGEST a>:4/777 a> return oa href="+code=cryptd_crea e_hash" class="sref">cryptd_crea e_hash a>(oa href="+code=tmpl" class="sref">tmpl a>,/oa href="+code=tb" class="sref">tb a>,/&oa href="+code=queue" class="sref">queue a>);4/778 a> case oa href="+code=CRYPTO_ALG_TYPE_AEAD" class="sref">CRYPTO_ALG_TYPE_AEAD a>:4/779 a> return oa href="+code=cryptd_crea e_aead" class="sref">cryptd_crea e_aead a>(oa href="+code=tmpl" class="sref">tmpl a>,/oa href="+code=tb" class="sref">tb a>,/&oa href="+code=queue" class="sref">queue a>);4/780 a> }4/781 a>4/782 a> return -oa href="+code=EINVAL" class="sref">EINVAL a>;4/783 a>}4/784 a>4/785 a>static void/oa href="+code=cryptd_free" class="sref">cryptd_free a>(struct/oa href="+code=crypto_instance" class="sref">crypto_instance a> *oa href="+code=inst" class="sref">inst a>)4/786 a>{4/787 a> struct/oa href="+code=cryptd_instance_ctx" class="sref">cryptd_instance_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_instance_ctx" class="sref">crypto_instance_ctx a>(oa href="+code=inst" class="sref">inst a>);4/788 a> struct/oa href="+code=hashd_instance_ctx" class="sref">hashd_instance_ctx a> *oa href="+code=hctx" class="sref">hctx a> = oa href="+code=crypto_instance_ctx" class="sref">crypto_instance_ctx a>(oa href="+code=inst" class="sref">inst a>);4/789 a> struct/oa href="+code=aead_instance_ctx" class="sref">aead_instance_ctx a> *oa href="+code=aead_ctx" class="sref">aead_ctx a> = oa href="+code=crypto_instance_ctx" class="sref">crypto_instance_ctx a>(oa href="+code=inst" class="sref">inst a>);4/790o/a>4/791 a> switch (oa href="+code=inst" class="sref">inst a>->oa href="+code=alg" class="sref">alg a>.oa href="+code=cra_flags" class="sref">cra_flags a> & oa href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK a>) {4/792 a> case oa href="+code=CRYPTO_ALG_TYPE_AHASH" class="sref">CRYPTO_ALG_TYPE_AHASH a>:4/793 a> oa href="+code=crypto_drop_shash" class="sref">crypto_drop_shash a>(&oa href="+code=hctx" class="sref">hctx a>->oa href="+code=spawn" class="sref">spawn a>);4/794 a> oa href="+code=kfree" class="sref">kfree a>(oa href="+code=ahash_instance" class="sref">ahash_instance a>(oa href="+code=inst" class="sref">inst a>));4/795 a> return;4/796 a> case oa href="+code=CRYPTO_ALG_TYPE_AEAD" class="sref">CRYPTO_ALG_TYPE_AEAD a>:4/797 a> oa href="+code=crypto_drop_spawn" class="sref">crypto_drop_spawn a>(&oa href="+code=aead_ctx" class="sref">aead_ctx a>->oa href="+code=aead_spawn" class="sref">aead_spawn a>.oa href="+code=base" class="sref">base a>);4/798 a> oa href="+code=kfree" class="sref">kfree a>(oa href="+code=inst" class="sref">inst a>);4/799 a> return;4/800 a> default:4/801 a> oa href="+code=crypto_drop_spawn" class="sref">crypto_drop_spawn a>(&oa href="+code=ctx" class="sref">ctx a>->oa href="+code=spawn" class="sref">spawn a>);4/802 a> oa href="+code=kfree" class="sref">kfree a>(oa href="+code=inst" class="sref">inst a>);4/803 a> }4/804 a>}4/805o/a>4/806o/a>static struct/oa href="+code=crypto_templa e" class="sref">crypto_templa e a> oa href="+code=cryptd_tmpl" class="sref">cryptd_tmpl a> = {4/807 a> .oa href="+code=nam " class="sref">nam a> = ospan class="string">"cryptd",4/808 a> .oa href="+code=crea e" class="sref">crea e a> = oa href="+code=cryptd_crea e" class="sref">cryptd_crea e a>,4/809 a> .oa href="+code=free" class="sref">free a> = oa href="+code=cryptd_free" class="sref">cryptd_free a>,4/810 a> .oa href="+code=module" class="sref">module a> = oa href="+code=THIS_MODULE" class="sref">THIS_MODULE a>,4/811 a>};4/812o/a>4/813o/a>struct/oa href="+code=cryptd_ablkcipher" class="sref">cryptd_ablkcipher a> *oa href="+code=cryptd_alloc_ablkcipher" class="sref">cryptd_alloc_ablkcipher a>(const char *oa href="+code=alg_nam " class="sref">alg_nam a>,4/814 a> oa href="+code=u32" class="sref">u32 a> oa href="+code=type" class="sref">type a>,/oa href="+code=u32" class="sref">u32 a> oa href="+code=mask" class="sref">mask a>)4/815 a>{4/816 a> char oa href="+code=cryptd_alg_nam " class="sref">cryptd_alg_nam a>[oa href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME a>];4/817 a> struct/oa href="+code=crypto_tfm" class="sref">crypto_tfm a> *oa href="+code=tfm" class="sref">tfm a>;4/818 a>4/819 a> if (oa href="+code=snprintf" class="sref">snprintf a>(oa href="+code=cryptd_alg_nam " class="sref">cryptd_alg_nam a>,/oa href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME a>,4/820 a> ospan class="string">"cryptd(%s)", oa href="+code=alg_nam " class="sref">alg_nam a>) >= oa href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME a>)4/821 a> return oa href="+code=ERR_PTR" class="sref">ERR_PTR a>(-oa href="+code=EINVAL" class="sref">EINVAL a>);4/822 a> oa href="+code=type" class="sref">type a> &= ~(oa href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK a> | oa href="+code=CRYPTO_ALG_GENIV" class="sref">CRYPTO_ALG_GENIV a>);4/823 a> oa href="+code=type" class="sref">type a> |= oa href="+code=CRYPTO_ALG_TYPE_BLKCIPHER" class="sref">CRYPTO_ALG_TYPE_BLKCIPHER a>;4/824 a> oa href="+code=mask" class="sref">mask a> &= ~oa href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK a>;4/825 a> oa href="+code=mask" class="sref">mask a> |= (oa href="+code=CRYPTO_ALG_GENIV" class="sref">CRYPTO_ALG_GENIV a> | oa href="+code=CRYPTO_ALG_TYPE_BLKCIPHER_MASK" class="sref">CRYPTO_ALG_TYPE_BLKCIPHER_MASK a>);4/826 a> oa href="+code=tfm" class="sref">tfm a> = oa href="+code=crypto_alloc_base" class="sref">crypto_alloc_base a>(oa href="+code=cryptd_alg_nam " class="sref">cryptd_alg_nam a>,/oa href="+code=type" class="sref">type a>,/oa href="+code=mask" class="sref">mask a>);4/827 a> if (oa href="+code=IS_ERR" class="sref">IS_ERR a>(oa href="+code=tfm" class="sref">tfm a>))4/828 a> return oa href="+code=ERR_CAST" class="sref">ERR_CAST a>(oa href="+code=tfm" class="sref">tfm a>);4/829 a> if (oa href="+code=tfm" class="sref">tfm a>->oa href="+code=__crt_alg" class="sref">__crt_alg a>->oa href="+code=cra_module" class="sref">cra_module a> != oa href="+code=THIS_MODULE" class="sref">THIS_MODULE a>) {4/830 a> oa href="+code=crypto_free_tfm" class="sref">crypto_free_tfm a>(oa href="+code=tfm" class="sref">tfm a>);4/831 a> return oa href="+code=ERR_PTR" class="sref">ERR_PTR a>(-oa href="+code=EINVAL" class="sref">EINVAL a>);4/832 a> }4/833o/a>4/834 a> return oa href="+code=__cryptd_ablkcipher_cast" class="sref">__cryptd_ablkcipher_cast a>(oa href="+code=__crypto_ablkcipher_cast" class="sref">__crypto_ablkcipher_cast a>(oa href="+code=tfm" class="sref">tfm a>));4/835 a>}4/836o/a>oa href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL a>(oa href="+code=cryptd_alloc_ablkcipher" class="sref">cryptd_alloc_ablkcipher a>);4/837o/a>4/838 a>struct/oa href="+code=crypto_blkcipher" class="sref">crypto_blkcipher a> *oa href="+code=cryptd_ablkcipher_child" class="sref">cryptd_ablkcipher_child a>(struct/oa href="+code=cryptd_ablkcipher" class="sref">cryptd_ablkcipher a> *oa href="+code=tfm" class="sref">tfm a>)4/839 a>{4/840 a> struct/oa href="+code=cryptd_blkcipher_ctx" class="sref">cryptd_blkcipher_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_ablkcipher_ctx" class="sref">crypto_ablkcipher_ctx a>(&oa href="+code=tfm" class="sref">tfm a>->oa href="+code=base" class="sref">base a>);4/841 a> return oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>;4/842o/a>}4/843 a>oa href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL a>(oa href="+code=cryptd_ablkcipher_child" class="sref">cryptd_ablkcipher_child a>);4/844 a>4/845 a>void/oa href="+code=cryptd_free_ablkcipher" class="sref">cryptd_free_ablkcipher a>(struct/oa href="+code=cryptd_ablkcipher" class="sref">cryptd_ablkcipher a> *oa href="+code=tfm" class="sref">tfm a>)4/846 a>{4/847 a> oa href="+code=crypto_free_ablkcipher" class="sref">crypto_free_ablkcipher a>(&oa href="+code=tfm" class="sref">tfm a>->oa href="+code=base" class="sref">base a>);4/848 a>}4/849 a>oa href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL a>(oa href="+code=cryptd_free_ablkcipher" class="sref">cryptd_free_ablkcipher a>);4/850o/a>4/851 a>struct/oa href="+code=cryptd_ahash" class="sref">cryptd_ahash a> *oa href="+code=cryptd_alloc_ahash" class="sref">cryptd_alloc_ahash a>(const char *oa href="+code=alg_nam " class="sref">alg_nam a>,4/852 a> oa href="+code=u32" class="sref">u32 a> oa href="+code=type" class="sref">type a>,/oa href="+code=u32" class="sref">u32 a> oa href="+code=mask" class="sref">mask a>)4/853 a>{4/854 a> char oa href="+code=cryptd_alg_nam " class="sref">cryptd_alg_nam a>[oa href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME a>];4/855 a> struct/oa href="+code=crypto_ahash" class="sref">crypto_ahash a> *oa href="+code=tfm" class="sref">tfm a>;4/856o/a>4/857 a> if (oa href="+code=snprintf" class="sref">snprintf a>(oa href="+code=cryptd_alg_nam " class="sref">cryptd_alg_nam a>,/oa href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME a>,4/858 a> ospan class="string">"cryptd(%s)", oa href="+code=alg_nam " class="sref">alg_nam a>) >= oa href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME a>)4/859 a> return oa href="+code=ERR_PTR" class="sref">ERR_PTR a>(-oa href="+code=EINVAL" class="sref">EINVAL a>);4/860 a> oa href="+code=tfm" class="sref">tfm a> = oa href="+code=crypto_alloc_ahash" class="sref">crypto_alloc_ahash a>(oa href="+code=cryptd_alg_nam " class="sref">cryptd_alg_nam a>,/oa href="+code=type" class="sref">type a>,/oa href="+code=mask" class="sref">mask a>);4/861 a> if (oa href="+code=IS_ERR" class="sref">IS_ERR a>(oa href="+code=tfm" class="sref">tfm a>))4/862 a> return oa href="+code=ERR_CAST" class="sref">ERR_CAST a>(oa href="+code=tfm" class="sref">tfm a>);4/863 a> if (oa href="+code=tfm" class="sref">tfm a>->oa href="+code=base" class="sref">base a>.oa href="+code=__crt_alg" class="sref">__crt_alg a>->oa href="+code=cra_module" class="sref">cra_module a> != oa href="+code=THIS_MODULE" class="sref">THIS_MODULE a>) {4/864 a> oa href="+code=crypto_free_ahash" class="sref">crypto_free_ahash a>(oa href="+code=tfm" class="sref">tfm a>);4/865 a> return oa href="+code=ERR_PTR" class="sref">ERR_PTR a>(-oa href="+code=EINVAL" class="sref">EINVAL a>);4/866 a> }4/867o/a>4/868 a> return oa href="+code=__cryptd_ahash_cast" class="sref">__cryptd_ahash_cast a>(oa href="+code=tfm" class="sref">tfm a>);4/869 a>}4/870 a>oa href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL a>(oa href="+code=cryptd_alloc_ahash" class="sref">cryptd_alloc_ahash a>);4/871 a>4/872o/a>struct/oa href="+code=crypto_shash" class="sref">crypto_shash a> *oa href="+code=cryptd_ahash_child" class="sref">cryptd_ahash_child a>(struct/oa href="+code=cryptd_ahash" class="sref">cryptd_ahash a> *oa href="+code=tfm" class="sref">tfm a>)4/873 a>{4/874 a> struct/oa href="+code=cryptd_hash_ctx" class="sref">cryptd_hash_ctx a> *oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_ahash_ctx" class="sref">crypto_ahash_ctx a>(&oa href="+code=tfm" class="sref">tfm a>->oa href="+code=base" class="sref">base a>);4/875o/a>4/876 a> return oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>;4/877 a>}4/878o/a>oa href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL a>(oa href="+code=cryptd_ahash_child" class="sref">cryptd_ahash_child a>);4/879 a>4/880 a>struct/oa href="+code=shash_desc" class="sref">shash_desc a> *oa href="+code=cryptd_shash_desc" class="sref">cryptd_shash_desc a>(struct/oa href="+code=ahash_request" class="sref">ahash_request a> *oa href="+code=req" class="sref">req a>)4/881 a>{4/882 a> struct/oa href="+code=cryptd_hash_request_ctx" class="sref">cryptd_hash_request_ctx a> *oa href="+code=rctx" class="sref">rctx a> = oa href="+code=ahash_request_ctx" class="sref">ahash_request_ctx a>(oa href="+code=req" class="sref">req a>);4/883 a> return &oa href="+code=rctx" class="sref">rctx a>->oa href="+code=desc" class="sref">desc a>;4/884 a>}4/885 a>oa href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL a>(oa href="+code=cryptd_shash_desc" class="sref">cryptd_shash_desc a>);4/886o/a>4/887 a>void/oa href="+code=cryptd_free_ahash" class="sref">cryptd_free_ahash a>(struct/oa href="+code=cryptd_ahash" class="sref">cryptd_ahash a> *oa href="+code=tfm" class="sref">tfm a>)4/888 a>{4/889 a> oa href="+code=crypto_free_ahash" class="sref">crypto_free_ahash a>(&oa href="+code=tfm" class="sref">tfm a>->oa href="+code=base" class="sref">base a>);4/890o/a>}4/891 a>oa href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL a>(oa href="+code=cryptd_free_ahash" class="sref">cryptd_free_ahash a>);4/892o/a>4/893o/a>struct/oa href="+code=cryptd_aead" class="sref">cryptd_aead a> *oa href="+code=cryptd_alloc_aead" class="sref">cryptd_alloc_aead a>(const char *oa href="+code=alg_nam " class="sref">alg_nam a>,4/894 a> oa href="+code=u32" class="sref">u32 a> oa href="+code=type" class="sref">type a>,/oa href="+code=u32" class="sref">u32 a> oa href="+code=mask" class="sref">mask a>)4/895 a>{4/896 a> char oa href="+code=cryptd_alg_nam " class="sref">cryptd_alg_nam a>[oa href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME a>];4/897 a> struct/oa href="+code=crypto_aead" class="sref">crypto_aead a> *oa href="+code=tfm" class="sref">tfm a>;4/898 a>4/899 a> if (oa href="+code=snprintf" class="sref">snprintf a>(oa href="+code=cryptd_alg_nam " class="sref">cryptd_alg_nam a>,/oa href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME a>,4/900 a> ospan class="string">"cryptd(%s)", oa href="+code=alg_nam " class="sref">alg_nam a>) >= oa href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME a>)4/901 a> return oa href="+code=ERR_PTR" class="sref">ERR_PTR a>(-oa href="+code=EINVAL" class="sref">EINVAL a>);4/902 a> oa href="+code=tfm" class="sref">tfm a> = oa href="+code=crypto_alloc_aead" class="sref">crypto_alloc_aead a>(oa href="+code=cryptd_alg_nam " class="sref">cryptd_alg_nam a>,/oa href="+code=type" class="sref">type a>,/oa href="+code=mask" class="sref">mask a>);4/903 a> if (oa href="+code=IS_ERR" class="sref">IS_ERR a>(oa href="+code=tfm" class="sref">tfm a>))4/904 a> return oa href="+code=ERR_CAST" class="sref">ERR_CAST a>(oa href="+code=tfm" class="sref">tfm a>);4/905 a> if (oa href="+code=tfm" class="sref">tfm a>->oa href="+code=base" class="sref">base a>.oa href="+code=__crt_alg" class="sref">__crt_alg a>->oa href="+code=cra_module" class="sref">cra_module a> != oa href="+code=THIS_MODULE" class="sref">THIS_MODULE a>) {4/906 a> oa href="+code=crypto_free_aead" class="sref">crypto_free_aead a>(oa href="+code=tfm" class="sref">tfm a>);4/907 a> return oa href="+code=ERR_PTR" class="sref">ERR_PTR a>(-oa href="+code=EINVAL" class="sref">EINVAL a>);4/908 a> }4/909 a> return oa href="+code=__cryptd_aead_cast" class="sref">__cryptd_aead_cast a>(oa href="+code=tfm" class="sref">tfm a>);4/910o/a>}4/911 a>oa href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL a>(oa href="+code=cryptd_alloc_aead" class="sref">cryptd_alloc_aead a>);4/912o/a>4/913o/a>struct/oa href="+code=crypto_aead" class="sref">crypto_aead a> *oa href="+code=cryptd_aead_child" class="sref">cryptd_aead_child a>(struct/oa href="+code=cryptd_aead" class="sref">cryptd_aead a> *oa href="+code=tfm" class="sref">tfm a>)4/914 a>{4/915 a> struct/oa href="+code=cryptd_aead_ctx" class="sref">cryptd_aead_ctx a> *oa href="+code=ctx" class="sref">ctx a>;4/916 a> oa href="+code=ctx" class="sref">ctx a> = oa href="+code=crypto_aead_ctx" class="sref">crypto_aead_ctx a>(&oa href="+code=tfm" class="sref">tfm a>->oa href="+code=base" class="sref">base a>);4/917 a> return oa href="+code=ctx" class="sref">ctx a>->oa href="+code=child" class="sref">child a>;4/918 a>}4/919 a>oa href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL a>(oa href="+code=cryptd_aead_child" class="sref">cryptd_aead_child a>);4/920o/a>4/921 a>void/oa href="+code=cryptd_free_aead" class="sref">cryptd_free_aead a>(struct/oa href="+code=cryptd_aead" class="sref">cryptd_aead a> *oa href="+code=tfm" class="sref">tfm a>)4/922 a>{4/923 a> oa href="+code=crypto_free_aead" class="sref">crypto_free_aead a>(&oa href="+code=tfm" class="sref">tfm a>->oa href="+code=base" class="sref">base a>);4/924 a>}4/925 a>oa href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL a>(oa href="+code=cryptd_free_aead" class="sref">cryptd_free_aead a>);4/926o/a>4/927 a>static int/oa href="+code=__init" class="sref">__init a> oa href="+code=cryptd_init" class="sref">cryptd_init a>(void)4/928 a>{4/929 a> int/oa href="+code=err" class="sref">err a>;4/930o/a>4/931 a> oa href="+code=err" class="sref">err a> = oa href="+code=cryptd_init_queue" class="sref">cryptd_init_queue a>(&oa href="+code=queue" class="sref">queue a>,/oa href="+code=CRYPTD_MAX_CPU_QLEN" class="sref">CRYPTD_MAX_CPU_QLEN a>);4/932 a> if (oa href="+code=err" class="sref">err a>)4/933 a> return oa href="+code=err" class="sref">err a>;4/934 a>4/935 a> oa href="+code=err" class="sref">err a> = oa href="+code=crypto_register_templa e" class="sref">crypto_register_templa e a>(&oa href="+code=cryptd_tmpl" class="sref">cryptd_tmpl a>);4/936 a> if (oa href="+code=err" class="sref">err a>)4/937 a> oa href="+code=cryptd_fini_queue" class="sref">cryptd_fini_queue a>(&oa href="+code=queue" class="sref">queue a>);4/938 a>4/939 a> return oa href="+code=err" class="sref">err a>;4/940o/a>}4/941 a>4/942 a>static void/oa href="+code=__exit" class="sref">__exit a> oa href="+code=cryptd_exit" class="sref">cryptd_exit a>(void)4/943 a>{4/944 a> oa href="+code=cryptd_fini_queue" class="sref">cryptd_fini_queue a>(&oa href="+code=queue" class="sref">queue a>);4/945 a> oa href="+code=crypto_unregister_templa e" class="sref">crypto_unregister_templa e a>(&oa href="+code=cryptd_tmpl" class="sref">cryptd_tmpl a>);4/946 a>}4/947o/a>4/948o/a>oa href="+code=subsys_initcall" class="sref">subsys_initcall a>(oa href="+code=cryptd_init" class="sref">cryptd_init a>);4/949 a>oa href="+code=module_exit" class="sref">module_exit a>(oa href="+code=cryptd_exit" class="sref">cryptd_exit a>);4/950o/a>4/951 a>oa href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE a>(ospan class="string">"GPL");4/952 a>oa href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION a>(ospan class="string">"Software async crypto daemon");4/953 a>
lxr.linux.no kindly hosted by oa href="http://www.redpill-linpro.no">Redpill Linpro AS a>,/provider of Linux consulting and operations services since 1995.