linux/crypto/shash.c
<<
" /spaon> /formn> a " href="../linux+v34.1.2/crypto/shash.c">" img src="../.static/gfx/right.png" alt=">>">" /spaon>" spao class="lxr_search">" " input typue=hidden" namue=navtarget" value=">" input typue=text" namue=search" ide=search">" buttiontypue=submit">Search /formn> /spaon>" spao class="lxr_prefs"n> a href="+prefs?return=crypto/shash.c"" onclick="return ajax_prefs();">" Prefs> /a>" /spaon> /divn> form acptio="ajax+*" method="post" onsubmit="return false;">" input typue=hidden" namue=ajax_lookup" ide=ajax_lookup" value=">" /formn>" div class="headingbottim"> div ide=search_results" class="search_results"> n> /divn> div ide=content">> div ide=file_contents"n
   1 /a> spao class="comment">/* /spaon>   2 /a> spao class="comment"> * Synchronous Cryptographic Hash operaptios. /spaon>   3 /a> spao class="comment"> * /spaon>   4 /a> spao class="comment"> * Copyright (c) 2008 Herbert Xu <herbert@gondor.apaoa.org.au> /spaon>   5 /a> spao class="comment"> * /spaon>   6 /a> spao class="comment"> * This program is free software; you cao redistribute it and/or modify it /spaon>   7 /a> spao class="comment"> * under the terms of the GNU General Public License as published by the Free /spaon>   8 /a> spao class="comment"> * Software Foundaptio; either verstion2 of the License, or (at your /optio) /spaon>   9 /a> spao class="comment"> * any later verstio. /spaon>  .10 spao class="comment"> * /spaon>  11 /a> spao class="comment"> */ /spaon>  12 /a>>  13 /a>#include <crypto/scatterwalk.h /a>>>  14 /a>#include <crypto/internal/hash.h /a>>>  15 /a>#include <linux/err.h /a>>>  16 /a>#include <linux/kernel.h /a>>>  17 /a>#include <linux/module.h /a>>>  18 /a>#include <linux/slab.h /a>>>  19 /a>#include <linux/seq_file.h /a>>>  20 /a>#include <linux/cryptouser.h /a>>>  21 /a>#include <net/netlink.h /a>>>  22 /a>>  23 /a>#include "internal.h /a>">  24 /a>>  25 /a>static const struct  a href="+code=crypto_typu" class="sref">crypto_typu /a>  a href="+code=crypto_shash_typu" class="sref">crypto_shash_typu /a>;>  26 /a>>  27 /a>static int  a href="+code=shash_no_setkey" class="sref">shash_no_setkey /a>(struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> * a href="+code=tfm" class="sref">tfm /a>, const  a href="+code=u8" class="sref">u8 /a> * a href="+code=key" class="sref">key /a>,>  28 /a>                           unsigned int  a href="+code=keylen" class="sref">keylen /a>)>  29 /a>{>  30 /a>        return - a href="+code=ENOSYS" class="sref">ENOSYS /a>;>  31 /a>}>  32 /a>>  33 /a>static int  a href="+code=shash_setkey_unaligned" class="sref">shash_setkey_unaligned /a>(struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> * a href="+code=tfm" class="sref">tfm /a>, const  a href="+code=u8" class="sref">u8 /a> * a href="+code=key" class="sref">key /a>,>  34 /a>                                  unsigned int  a href="+code=keylen" class="sref">keylen /a>)>  35 /a>{>  36 /a>        struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=shash" class="sref">shash /a> =  a href="+code=crypto_shash_alg" class="sref">crypto_shash_alg /a>( a href="+code=tfm" class="sref">tfm /a>);>  37 /a>        unsigned long  a href="+code=alignmask" class="sref">alignmask /a> =  a href="+code=crypto_shash_alignmask" class="sref">crypto_shash_alignmask /a>( a href="+code=tfm" class="sref">tfm /a>);>  38 /a>        unsigned long  a href="+code=absizu" class="sref">absizu /a>;>  39 /a>         a href="+code=u8" class="sref">u8 /a> * a href="+code=buffer" class="sref">buffer /a>, * a href="+code=alignbuffer" class="sref">alignbuffer /a>;>  40 /a>        int  a href="+code=err" class="sref">err /a>;>  41 /a>>  42 /a>         a href="+code=absizu" class="sref">absizu /a> =  a href="+code=keylen" class="sref">keylen /a> + ( a href="+code=alignmask" class="sref">alignmask /a> & ~( a href="+code=crypto_tfm_ctx_alignment" class="sref">crypto_tfm_ctx_alignment /a>() - 1));>  43 /a>         a href="+code=buffer" class="sref">buffer /a> =  a href="+code=kmalloc" class="sref">kmalloc /a>( a href="+code=absizu" class="sref">absizu /a>,  a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL /a>);>  44 /a>        if (! a href="+code=buffer" class="sref">buffer /a>)>  45 /a>                return - a href="+code=ENOMEM" class="sref">ENOMEM /a>;>  46 /a>>  47 /a>         a href="+code=alignbuffer" class="sref">alignbuffer /a> = ( a href="+code=u8" class="sref">u8 /a> *) a href="+code=ALIGN" class="sref">ALIGN /a>((unsigned long) a href="+code=buffer" class="sref">buffer /a>,  a href="+code=alignmask" class="sref">alignmask /a> + 1);>  48 /a>         a href="+code=memcpy" class="sref">memcpy /a>( a href="+code=alignbuffer" class="sref">alignbuffer /a>,  a href="+code=key" class="sref">key /a>,  a href="+code=keylen" class="sref">keylen /a>);>  49 /a>         a href="+code=err" class="sref">err /a> =  a href="+code=shash" class="sref">shash /a>-> a href="+code=setkey" class="sref">setkey /a>( a href="+code=tfm" class="sref">tfm /a>,  a href="+code=alignbuffer" class="sref">alignbuffer /a>,  a href="+code=keylen" class="sref">keylen /a>);>  50 /a>         a href="+code=kzfree" class="sref">kzfree /a>( a href="+code=buffer" class="sref">buffer /a>);>  51 /a>        return  a href="+code=err" class="sref">err /a>;>  52 /a>}>  53 /a>>  54 /a>int  a href="+code=crypto_shash_setkey" class="sref">crypto_shash_setkey /a>(struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> * a href="+code=tfm" class="sref">tfm /a>, const  a href="+code=u8" class="sref">u8 /a> * a href="+code=key" class="sref">key /a>,>  55 /a>                        unsigned int  a href="+code=keylen" class="sref">keylen /a>)>  56 /a>{>  57 /a>        struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=shash" class="sref">shash /a> =  a href="+code=crypto_shash_alg" class="sref">crypto_shash_alg /a>( a href="+code=tfm" class="sref">tfm /a>);>  58 /a>        unsigned long  a href="+code=alignmask" class="sref">alignmask /a> =  a href="+code=crypto_shash_alignmask" class="sref">crypto_shash_alignmask /a>( a href="+code=tfm" class="sref">tfm /a>);>  59 /a>>  60 /a>        if ((unsigned long) a href="+code=key" class="sref">key /a> &  a href="+code=alignmask" class="sref">alignmask /a>)>  61 /a>                return  a href="+code=shash_setkey_unaligned" class="sref">shash_setkey_unaligned /a>( a href="+code=tfm" class="sref">tfm /a>,  a href="+code=key" class="sref">key /a>,  a href="+code=keylen" class="sref">keylen /a>);>  62 /a>>  63 /a>        return  a href="+code=shash" class="sref">shash /a>-> a href="+code=setkey" class="sref">setkey /a>( a href="+code=tfm" class="sref">tfm /a>,  a href="+code=key" class="sref">key /a>,  a href="+code=keylen" class="sref">keylen /a>);>  64 /a>}>  65 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=crypto_shash_setkey" class="sref">crypto_shash_setkey /a>);>  66 /a>>  67 /a>static  a href="+code=inline" class="sref">inline /a> unsigned int  a href="+code=shash_align_buffer_sizu" class="sref">shash_align_buffer_sizu /a>(unsigned  a href="+code=len" class="sref">len /a>,>  68 /a>                                                   unsigned long  a href="+code=mask" class="sref">mask /a>)>  69 /a>{>  70 /a>        return  a href="+code=len" class="sref">len /a> + ( a href="+code=mask" class="sref">mask /a> & ~( a href="+code=__alignof__" class="sref">__alignof__ /a>( a href="+code=u8" class="sref">u8 /a>  a href="+code=__attribute__" class="sref">__attribute__ /a> (( a href="+code=aligned" class="sref">aligned /a>))) - 1));>  71 /a>}>  72 /a>>  73 /a>static int  a href="+code=shash_update_unaligned" class="sref">shash_update_unaligned /a>(struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>, const  a href="+code=u8" class="sref">u8 /a> * a href="+code=data" class="sref">data /a>,>  74 /a>                                  unsigned int  a href="+code=len" class="sref">len /a>)>  75 /a>{>  76 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> * a href="+code=tfm" class="sref">tfm /a> =  a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a>;>  77 /a>        struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=shash" class="sref">shash /a> =  a href="+code=crypto_shash_alg" class="sref">crypto_shash_alg /a>( a href="+code=tfm" class="sref">tfm /a>);>  78 /a>        unsigned long  a href="+code=alignmask" class="sref">alignmask /a> =  a href="+code=crypto_shash_alignmask" class="sref">crypto_shash_alignmask /a>( a href="+code=tfm" class="sref">tfm /a>);>  79 /a>        unsigned int  a href="+code=unaligned_len" class="sref">unaligned_len /a> =  a href="+code=alignmask" class="sref">alignmask /a> + 1 ->  80 /a>                                     ((unsigned long) a href="+code=data" class="sref">data /a> &  a href="+code=alignmask" class="sref">alignmask /a>);>  81 /a>         a href="+code=u8" class="sref">u8 /a>  a href="+code=ubuf" class="sref">ubuf /a>[ a href="+code=shash_align_buffer_sizu" class="sref">shash_align_buffer_sizu /a>( a href="+code=unaligned_len" class="sref">unaligned_len /a>,  a href="+code=alignmask" class="sref">alignmask /a>)]>  82 /a>                 a href="+code=__attribute__" class="sref">__attribute__ /a> (( a href="+code=aligned" class="sref">aligned /a>));>  83 /a>         a href="+code=u8" class="sref">u8 /a> * a href="+code=buf" class="sref">buf /a> =  a href="+code=PTR_ALIGN" class="sref">PTR_ALIGN /a>(& a href="+code=ubuf" class="sref">ubuf /a>[0],  a href="+code=alignmask" class="sref">alignmask /a> + 1);>  84 /a>        int  a href="+code=err" class="sref">err /a>;>  85 /a>>  86 /a>        if ( a href="+code=unaligned_len" class="sref">unaligned_len /a> >  a href="+code=len" class="sref">len /a>)>  87 /a>                 a href="+code=unaligned_len" class="sref">unaligned_len /a> =  a href="+code=len" class="sref">len /a>;>  88 /a>>  89 /a>         a href="+code=memcpy" class="sref">memcpy /a>( a href="+code=buf" class="sref">buf /a>,  a href="+code=data" class="sref">data /a>,  a href="+code=unaligned_len" class="sref">unaligned_len /a>);>  90 /a>         a href="+code=err" class="sref">err /a> =  a href="+code=shash" class="sref">shash /a>-> a href="+code=update" class="sref">update /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=buf" class="sref">buf /a>,  a href="+code=unaligned_len" class="sref">unaligned_len /a>);>  91 /a>         a href="+code=memset" class="sref">memset /a>( a href="+code=buf" class="sref">buf /a>, 0,  a href="+code=unaligned_len" class="sref">unaligned_len /a>);>  92 /a>>  93 /a>        return  a href="+code=err" class="sref">err /a> ?:>  94 /a>                a href="+code=shash" class="sref">shash /a>-> a href="+code=update" class="sref">update /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=data" class="sref">data /a> +  a href="+code=unaligned_len" class="sref">unaligned_len /a>,  a href="+code=len" class="sref">len /a> -  a href="+code=unaligned_len" class="sref">unaligned_len /a>);>  95 /a>}>  96 /a>>  97 /a>int  a href="+code=crypto_shash_update" class="sref">crypto_shash_update /a>(struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>, const  a href="+code=u8" class="sref">u8 /a> * a href="+code=data" class="sref">data /a>,>  98 /a>                        unsigned int  a href="+code=len" class="sref">len /a>)>  99 /a>{> 100 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> * a href="+code=tfm" class="sref">tfm /a> =  a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a>;> 101 /a>        struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=shash" class="sref">shash /a> =  a href="+code=crypto_shash_alg" class="sref">crypto_shash_alg /a>( a href="+code=tfm" class="sref">tfm /a>);> 102 /a>        unsigned long  a href="+code=alignmask" class="sref">alignmask /a> =  a href="+code=crypto_shash_alignmask" class="sref">crypto_shash_alignmask /a>( a href="+code=tfm" class="sref">tfm /a>);> 103 /a>> 104 /a>        if ((unsigned long) a href="+code=data" class="sref">data /a> &  a href="+code=alignmask" class="sref">alignmask /a>)> 105 /a>                return  a href="+code=shash_update_unaligned" class="sref">shash_update_unaligned /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=data" class="sref">data /a>,  a href="+code=len" class="sref">len /a>);> 106 /a>> 107 /a>        return  a href="+code=shash" class="sref">shash /a>-> a href="+code=update" class="sref">update /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=data" class="sref">data /a>,  a href="+code=len" class="sref">len /a>);> 108 /a>}> 109 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=crypto_shash_update" class="sref">crypto_shash_update /a>);> 1.10> 111 /a>static int  a href="+code=shash_final_unaligned" class="sref">shash_final_unaligned /a>(struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>,  a href="+code=u8" class="sref">u8 /a> * a href="+code=out" class="sref">out /a>)> 112 /a>{> 113 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> * a href="+code=tfm" class="sref">tfm /a> =  a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a>;> 114 /a>        unsigned long  a href="+code=alignmask" class="sref">alignmask /a> =  a href="+code=crypto_shash_alignmask" class="sref">crypto_shash_alignmask /a>( a href="+code=tfm" class="sref">tfm /a>);> 115 /a>        struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=shash" class="sref">shash /a> =  a href="+code=crypto_shash_alg" class="sref">crypto_shash_alg /a>( a href="+code=tfm" class="sref">tfm /a>);> 116 /a>        unsigned int  a href="+code=ds" class="sref">ds /a> =  a href="+code=crypto_shash_digestsizu" class="sref">crypto_shash_digestsizu /a>( a href="+code=tfm" class="sref">tfm /a>);> 117 /a>         a href="+code=u8" class="sref">u8 /a>  a href="+code=ubuf" class="sref">ubuf /a>[ a href="+code=shash_align_buffer_sizu" class="sref">shash_align_buffer_sizu /a>( a href="+code=ds" class="sref">ds /a>,  a href="+code=alignmask" class="sref">alignmask /a>)]> 118 /a>                 a href="+code=__attribute__" class="sref">__attribute__ /a> (( a href="+code=aligned" class="sref">aligned /a>));> 119 /a>         a href="+code=u8" class="sref">u8 /a> * a href="+code=buf" class="sref">buf /a> =  a href="+code=PTR_ALIGN" class="sref">PTR_ALIGN /a>(& a href="+code=ubuf" class="sref">ubuf /a>[0],  a href="+code=alignmask" class="sref">alignmask /a> + 1);> 120 /a>        int  a href="+code=err" class="sref">err /a>;> 121 /a>> 122 /a>         a href="+code=err" class="sref">err /a> =  a href="+code=shash" class="sref">shash /a>-> a href="+code=final" class="sref">final /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=buf" class="sref">buf /a>);> 123 /a>        if ( a href="+code=err" class="sref">err /a>)> 124 /a>                goto  a href="+code=out" class="sref">out /a>;> 125 /a>> 126 /a>         a href="+code=memcpy" class="sref">memcpy /a>( a href="+code=out" class="sref">out /a>,  a href="+code=buf" class="sref">buf /a>,  a href="+code=ds" class="sref">ds /a>);> 127 /a>> 128 /a> a href="+code=out" class="sref">out /a>:> 129 /a>         a href="+code=memset" class="sref">memset /a>( a href="+code=buf" class="sref">buf /a>, 0,  a href="+code=ds" class="sref">ds /a>);> 130 /a>        return  a href="+code=err" class="sref">err /a>;> 131 /a>}> 132 /a>> 133 /a>int  a href="+code=crypto_shash_final" class="sref">crypto_shash_final /a>(struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>,  a href="+code=u8" class="sref">u8 /a> * a href="+code=out" class="sref">out /a>)> 134 /a>{> 135 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> * a href="+code=tfm" class="sref">tfm /a> =  a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a>;> 136 /a>        struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=shash" class="sref">shash /a> =  a href="+code=crypto_shash_alg" class="sref">crypto_shash_alg /a>( a href="+code=tfm" class="sref">tfm /a>);> 137 /a>        unsigned long  a href="+code=alignmask" class="sref">alignmask /a> =  a href="+code=crypto_shash_alignmask" class="sref">crypto_shash_alignmask /a>( a href="+code=tfm" class="sref">tfm /a>);> 138 /a>> 139 /a>        if ((unsigned long) a href="+code=out" class="sref">out /a> &  a href="+code=alignmask" class="sref">alignmask /a>)> 140 /a>                return  a href="+code=shash_final_unaligned" class="sref">shash_final_unaligned /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=out" class="sref">out /a>);> 141 /a>> 142 /a>        return  a href="+code=shash" class="sref">shash /a>-> a href="+code=final" class="sref">final /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=out" class="sref">out /a>);> 143 /a>}> 144 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=crypto_shash_final" class="sref">crypto_shash_final /a>);> 145 /a>> 146 /a>static int  a href="+code=shash_finup_unaligned" class="sref">shash_finup_unaligned /a>(struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>, const  a href="+code=u8" class="sref">u8 /a> * a href="+code=data" class="sref">data /a>,> 147 /a>                                 unsigned int  a href="+code=len" class="sref">len /a>,  a href="+code=u8" class="sref">u8 /a> * a href="+code=out" class="sref">out /a>)> 148 /a>{> 149 /a>        return  a href="+code=crypto_shash_update" class="sref">crypto_shash_update /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=data" class="sref">data /a>,  a href="+code=len" class="sref">len /a>) ?:> 150 /a>                a href="+code=crypto_shash_final" class="sref">crypto_shash_final /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=out" class="sref">out /a>);> 151 /a>}> 152 /a>> 153 /a>int  a href="+code=crypto_shash_finup" class="sref">crypto_shash_finup /a>(struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>, const  a href="+code=u8" class="sref">u8 /a> * a href="+code=data" class="sref">data /a>,> 154 /a>                       unsigned int  a href="+code=len" class="sref">len /a>,  a href="+code=u8" class="sref">u8 /a> * a href="+code=out" class="sref">out /a>)> 155 /a>{> 156 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> * a href="+code=tfm" class="sref">tfm /a> =  a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a>;> 157 /a>        struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=shash" class="sref">shash /a> =  a href="+code=crypto_shash_alg" class="sref">crypto_shash_alg /a>( a href="+code=tfm" class="sref">tfm /a>);> 158 /a>        unsigned long  a href="+code=alignmask" class="sref">alignmask /a> =  a href="+code=crypto_shash_alignmask" class="sref">crypto_shash_alignmask /a>( a href="+code=tfm" class="sref">tfm /a>);> 159 /a>> 160 /a>        if (((unsigned long) a href="+code=data" class="sref">data /a> | (unsigned long) a href="+code=out" class="sref">out /a>) &  a href="+code=alignmask" class="sref">alignmask /a>)> 161 /a>                return  a href="+code=shash_finup_unaligned" class="sref">shash_finup_unaligned /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=data" class="sref">data /a>,  a href="+code=len" class="sref">len /a>,  a href="+code=out" class="sref">out /a>);> 162 /a>> 163 /a>        return  a href="+code=shash" class="sref">shash /a>-> a href="+code=finup" class="sref">finup /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=data" class="sref">data /a>,  a href="+code=len" class="sref">len /a>,  a href="+code=out" class="sref">out /a>);> 164 /a>}> 165 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=crypto_shash_finup" class="sref">crypto_shash_finup /a>);> 166 /a>> 167 /a>static int  a href="+code=shash_digest_unaligned" class="sref">shash_digest_unaligned /a>(struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>, const  a href="+code=u8" class="sref">u8 /a> * a href="+code=data" class="sref">data /a>,> 168 /a>                                  unsigned int  a href="+code=len" class="sref">len /a>,  a href="+code=u8" class="sref">u8 /a> * a href="+code=out" class="sref">out /a>)> 169 /a>{> 170 /a>        return  a href="+code=crypto_shash_init" class="sref">crypto_shash_init /a>( a href="+code=desc" class="sref">desc /a>) ?:> 171 /a>                a href="+code=crypto_shash_finup" class="sref">crypto_shash_finup /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=data" class="sref">data /a>,  a href="+code=len" class="sref">len /a>,  a href="+code=out" class="sref">out /a>);> 172 /a>}> 173 /a>> 174 /a>int  a href="+code=crypto_shash_digest" class="sref">crypto_shash_digest /a>(struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>, const  a href="+code=u8" class="sref">u8 /a> * a href="+code=data" class="sref">data /a>,> 175 /a>                        unsigned int  a href="+code=len" class="sref">len /a>,  a href="+code=u8" class="sref">u8 /a> * a href="+code=out" class="sref">out /a>)> 176 /a>{> 177 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> * a href="+code=tfm" class="sref">tfm /a> =  a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a>;> 178 /a>        struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=shash" class="sref">shash /a> =  a href="+code=crypto_shash_alg" class="sref">crypto_shash_alg /a>( a href="+code=tfm" class="sref">tfm /a>);> 179 /a>        unsigned long  a href="+code=alignmask" class="sref">alignmask /a> =  a href="+code=crypto_shash_alignmask" class="sref">crypto_shash_alignmask /a>( a href="+code=tfm" class="sref">tfm /a>);> 1810> 181 /a>        if (((unsigned long) a href="+code=data" class="sref">data /a> | (unsigned long) a href="+code=out" class="sref">out /a>) &  a href="+code=alignmask" class="sref">alignmask /a>)> 182 /a>                return  a href="+code=shash_digest_unaligned" class="sref">shash_digest_unaligned /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=data" class="sref">data /a>,  a href="+code=len" class="sref">len /a>,  a href="+code=out" class="sref">out /a>);> 183 /a>> 184 /a>        return  a href="+code=shash" class="sref">shash /a>-> a href="+code=digest" class="sref">digest /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=data" class="sref">data /a>,  a href="+code=len" class="sref">len /a>,  a href="+code=out" class="sref">out /a>);> 185 /a>}> 186 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=crypto_shash_digest" class="sref">crypto_shash_digest /a>);> 187 /a>> 188 /a>static int  a href="+code=shash_default_export" class="sref">shash_default_export /a>(struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>, void * a href="+code=out" class="sref">out /a>)> 189 /a>{> 190 /a>         a href="+code=memcpy" class="sref">memcpy /a>( a href="+code=out" class="sref">out /a>,  a href="+code=shash_desc_ctx" class="sref">shash_desc_ctx /a>( a href="+code=desc" class="sref">desc /a>),  a href="+code=crypto_shash_descsizu" class="sref">crypto_shash_descsizu /a>( a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a>));> 191 /a>        return 0;> 192 /a>}> 193 /a>> 194 /a>static int  a href="+code=shash_default_import" class="sref">shash_default_import /a>(struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>, const void * a href="+code=in" class="sref">in /a>)> 195 /a>{> 196 /a>         a href="+code=memcpy" class="sref">memcpy /a>( a href="+code=shash_desc_ctx" class="sref">shash_desc_ctx /a>( a href="+code=desc" class="sref">desc /a>),  a href="+code=in" class="sref">in /a>,  a href="+code=crypto_shash_descsizu" class="sref">crypto_shash_descsizu /a>( a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a>));> 197 /a>        return 0;> 198 /a>}> 199 /a>> 200 /a>static int  a href="+code=shash_async_setkey" class="sref">shash_async_setkey /a>(struct  a href="+code=crypto_ahash" class="sref">crypto_ahash /a> * a href="+code=tfm" class="sref">tfm /a>, const  a href="+code=u8" class="sref">u8 /a> * a href="+code=key" class="sref">key /a>,> 201 /a>                              unsigned int  a href="+code=keylen" class="sref">keylen /a>)> 202 /a>{> 203 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> ** a href="+code=ctx" class="sref">ctx /a> =  a href="+code=crypto_ahash_ctx" class="sref">crypto_ahash_ctx /a>( a href="+code=tfm" class="sref">tfm /a>);> 204 /a>> 205 /a>        return  a href="+code=crypto_shash_setkey" class="sref">crypto_shash_setkey /a>(* a href="+code=ctx" class="sref">ctx /a>,  a href="+code=key" class="sref">key /a>,  a href="+code=keylen" class="sref">keylen /a>);> 206 /a>}> 207 /a>> 208 /a>static int  a href="+code=shash_async_init" class="sref">shash_async_init /a>(struct  a href="+code=ahash_request" class="sref">ahash_request /a> * a href="+code=req" class="sref">req /a>)> 209 /a>{> 210 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> ** a href="+code=ctx" class="sref">ctx /a> =  a href="+code=crypto_ahash_ctx" class="sref">crypto_ahash_ctx /a>( a href="+code=crypto_ahash_reqtfm" class="sref">crypto_ahash_reqtfm /a>( a href="+code=req" class="sref">req /a>));> 211 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a> =  a href="+code=ahash_request_ctx" class="sref">ahash_request_ctx /a>( a href="+code=req" class="sref">req /a>);> 212 /a>> 213 /a>         a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a> = * a href="+code=ctx" class="sref">ctx /a>;> 214 /a>         a href="+code=desc" class="sref">desc /a>-> a href="+code=flags" class="sref">flags /a> =  a href="+code=req" class="sref">req /a>-> a href="+code=basu" class="sref">basu /a>. a href="+code=flags" class="sref">flags /a>;> 215 /a>> 216 /a>        return  a href="+code=crypto_shash_init" class="sref">crypto_shash_init /a>( a href="+code=desc" class="sref">desc /a>);> 217 /a>}> 218 /a>> 219 /a>int  a href="+code=shash_ahash_update" class="sref">shash_ahash_update /a>(struct  a href="+code=ahash_request" class="sref">ahash_request /a> * a href="+code=req" class="sref">req /a>, struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>)> 220 /a>{> 221 /a>        struct  a href="+code=crypto_hash_walk" class="sref">crypto_hash_walk /a>  a href="+code=walk" class="sref">walk /a>;> 222 /a>        int  a href="+code=nbytes" class="sref">nbytes /a>;> 223 /a>> 224 /a>        for ( a href="+code=nbytes" class="sref">nbytes /a> =  a href="+code=crypto_hash_walk_first" class="sref">crypto_hash_walk_first /a>( a href="+code=req" class="sref">req /a>, & a href="+code=walk" class="sref">walk /a>);  a href="+code=nbytes" class="sref">nbytes /a> > 0;> 225 /a>              a href="+code=nbytes" class="sref">nbytes /a> =  a href="+code=crypto_hash_walk_donu" class="sref">crypto_hash_walk_donu /a>(& a href="+code=walk" class="sref">walk /a>,  a href="+code=nbytes" class="sref">nbytes /a>))> 226 /a>                 a href="+code=nbytes" class="sref">nbytes /a> =  a href="+code=crypto_shash_update" class="sref">crypto_shash_update /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=walk" class="sref">walk /a>. a href="+code=data" class="sref">data /a>,  a href="+code=nbytes" class="sref">nbytes /a>);> 227 /a>> 228 /a>        return  a href="+code=nbytes" class="sref">nbytes /a>;> 229 /a>}> 230 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=shash_ahash_update" class="sref">shash_ahash_update /a>);> 231 /a>> 232 /a>static int  a href="+code=shash_async_update" class="sref">shash_async_update /a>(struct  a href="+code=ahash_request" class="sref">ahash_request /a> * a href="+code=req" class="sref">req /a>)> 233 /a>{> 234 /a>        return  a href="+code=shash_ahash_update" class="sref">shash_ahash_update /a>( a href="+code=req" class="sref">req /a>,  a href="+code=ahash_request_ctx" class="sref">ahash_request_ctx /a>( a href="+code=req" class="sref">req /a>));> 235 /a>}> 236 /a>> 237 /a>static int  a href="+code=shash_async_final" class="sref">shash_async_final /a>(struct  a href="+code=ahash_request" class="sref">ahash_request /a> * a href="+code=req" class="sref">req /a>)> 238 /a>{> 239 /a>        return  a href="+code=crypto_shash_final" class="sref">crypto_shash_final /a>( a href="+code=ahash_request_ctx" class="sref">ahash_request_ctx /a>( a href="+code=req" class="sref">req /a>),  a href="+code=req" class="sref">req /a>-> a href="+code=result" class="sref">result /a>);> 240 /a>}> 241 /a>> 242 /a>int  a href="+code=shash_ahash_finup" class="sref">shash_ahash_finup /a>(struct  a href="+code=ahash_request" class="sref">ahash_request /a> * a href="+code=req" class="sref">req /a>, struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>)> 243 /a>{> 244 /a>        struct  a href="+code=crypto_hash_walk" class="sref">crypto_hash_walk /a>  a href="+code=walk" class="sref">walk /a>;> 245 /a>        int  a href="+code=nbytes" class="sref">nbytes /a>;> 246 /a>> 247 /a>         a href="+code=nbytes" class="sref">nbytes /a> =  a href="+code=crypto_hash_walk_first" class="sref">crypto_hash_walk_first /a>( a href="+code=req" class="sref">req /a>, & a href="+code=walk" class="sref">walk /a>);> 248 /a>        if (! a href="+code=nbytes" class="sref">nbytes /a>)> 249 /a>                return  a href="+code=crypto_shash_final" class="sref">crypto_shash_final /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=req" class="sref">req /a>-> a href="+code=result" class="sref">result /a>);> 2510> 251 /a>        do {> 252 /a>                 a href="+code=nbytes" class="sref">nbytes /a> =  a href="+code=crypto_hash_walk_last" class="sref">crypto_hash_walk_last /a>(& a href="+code=walk" class="sref">walk /a>) ?> 253 /a>                          a href="+code=crypto_shash_finup" class="sref">crypto_shash_finup /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=walk" class="sref">walk /a>. a href="+code=data" class="sref">data /a>,  a href="+code=nbytes" class="sref">nbytes /a>,> 254 /a>                                             a href="+code=req" class="sref">req /a>-> a href="+code=result" class="sref">result /a>) :> 255 /a>                          a href="+code=crypto_shash_update" class="sref">crypto_shash_update /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=walk" class="sref">walk /a>. a href="+code=data" class="sref">data /a>,  a href="+code=nbytes" class="sref">nbytes /a>);> 256 /a>                 a href="+code=nbytes" class="sref">nbytes /a> =  a href="+code=crypto_hash_walk_donu" class="sref">crypto_hash_walk_donu /a>(& a href="+code=walk" class="sref">walk /a>,  a href="+code=nbytes" class="sref">nbytes /a>);> 257 /a>        } while ( a href="+code=nbytes" class="sref">nbytes /a> > 0);> 258 /a>> 259 /a>        return  a href="+code=nbytes" class="sref">nbytes /a>;> 260 /a>}> 261 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=shash_ahash_finup" class="sref">shash_ahash_finup /a>);> 262 /a>> 263 /a>static int  a href="+code=shash_async_finup" class="sref">shash_async_finup /a>(struct  a href="+code=ahash_request" class="sref">ahash_request /a> * a href="+code=req" class="sref">req /a>)> 264 /a>{> 265 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> ** a href="+code=ctx" class="sref">ctx /a> =  a href="+code=crypto_ahash_ctx" class="sref">crypto_ahash_ctx /a>( a href="+code=crypto_ahash_reqtfm" class="sref">crypto_ahash_reqtfm /a>( a href="+code=req" class="sref">req /a>));> 266 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a> =  a href="+code=ahash_request_ctx" class="sref">ahash_request_ctx /a>( a href="+code=req" class="sref">req /a>);> 267 /a>> 268 /a>         a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a> = * a href="+code=ctx" class="sref">ctx /a>;> 269 /a>         a href="+code=desc" class="sref">desc /a>-> a href="+code=flags" class="sref">flags /a> =  a href="+code=req" class="sref">req /a>-> a href="+code=basu" class="sref">basu /a>. a href="+code=flags" class="sref">flags /a>;> 2710> 271 /a>        return  a href="+code=shash_ahash_finup" class="sref">shash_ahash_finup /a>( a href="+code=req" class="sref">req /a>,  a href="+code=desc" class="sref">desc /a>);> 272 /a>}> 273 /a>> 274 /a>int  a href="+code=shash_ahash_digest" class="sref">shash_ahash_digest /a>(struct  a href="+code=ahash_request" class="sref">ahash_request /a> * a href="+code=req" class="sref">req /a>, struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>)> 275 /a>{> 276 /a>        struct  a href="+code=scatterlist" class="sref">scatterlist /a> * a href="+code=sg" class="sref">sg /a> =  a href="+code=req" class="sref">req /a>-> a href="+code=src" class="sref">src /a>;> 277 /a>        unsigned int  a href="+code=offset" class="sref">offset /a> =  a href="+code=sg" class="sref">sg /a>-> a href="+code=offset" class="sref">offset /a>;> 278 /a>        unsigned int  a href="+code=nbytes" class="sref">nbytes /a> =  a href="+code=req" class="sref">req /a>-> a href="+code=nbytes" class="sref">nbytes /a>;> 279 /a>        int  a href="+code=err" class="sref">err /a>;> 2810> 281 /a>        if ( a href="+code=nbytes" class="sref">nbytes /a> <  a href="+code=min" class="sref">min /a>( a href="+code=sg" class="sref">sg /a>-> a href="+code=length" class="sref">length /a>, ((unsigned int)( a href="+code=PAGE_SIZE" class="sref">PAGE_SIZE /a>)) -  a href="+code=offset" class="sref">offset /a>)) {> 282 /a>                void * a href="+code=data" class="sref">data /a>;> 283 /a>> 284 /a>                 a href="+code=data" class="sref">data /a> =  a href="+code=kmap_atomic" class="sref">kmap_atomic /a>( a href="+code=sg_page" class="sref">sg_page /a>( a href="+code=sg" class="sref">sg /a>));> 285 /a>                 a href="+code=err" class="sref">err /a> =  a href="+code=crypto_shash_digest" class="sref">crypto_shash_digest /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=data" class="sref">data /a> +  a href="+code=offset" class="sref">offset /a>,  a href="+code=nbytes" class="sref">nbytes /a>,> 286 /a>                                           a href="+code=req" class="sref">req /a>-> a href="+code=result" class="sref">result /a>);> 287 /a>                 a href="+code=kunmap_atomic" class="sref">kunmap_atomic /a>( a href="+code=data" class="sref">data /a>);> 288 /a>                 a href="+code=crypto_yield" class="sref">crypto_yield /a>( a href="+code=desc" class="sref">desc /a>-> a href="+code=flags" class="sref">flags /a>);> 289 /a>        } else> 290 /a>                 a href="+code=err" class="sref">err /a> =  a href="+code=crypto_shash_init" class="sref">crypto_shash_init /a>( a href="+code=desc" class="sref">desc /a>) ?:> 291 /a>                       a href="+code=shash_ahash_finup" class="sref">shash_ahash_finup /a>( a href="+code=req" class="sref">req /a>,  a href="+code=desc" class="sref">desc /a>);> 292 /a>> 293 /a>        return  a href="+code=err" class="sref">err /a>;> 294 /a>}> 295 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=shash_ahash_digest" class="sref">shash_ahash_digest /a>);> 296 /a>> 297 /a>static int  a href="+code=shash_async_digest" class="sref">shash_async_digest /a>(struct  a href="+code=ahash_request" class="sref">ahash_request /a> * a href="+code=req" class="sref">req /a>)> 298 /a>{> 299 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> ** a href="+code=ctx" class="sref">ctx /a> =  a href="+code=crypto_ahash_ctx" class="sref">crypto_ahash_ctx /a>( a href="+code=crypto_ahash_reqtfm" class="sref">crypto_ahash_reqtfm /a>( a href="+code=req" class="sref">req /a>));> 300 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a> =  a href="+code=ahash_request_ctx" class="sref">ahash_request_ctx /a>( a href="+code=req" class="sref">req /a>);> 301 /a>> 302 /a>         a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a> = * a href="+code=ctx" class="sref">ctx /a>;> 303 /a>         a href="+code=desc" class="sref">desc /a>-> a href="+code=flags" class="sref">flags /a> =  a href="+code=req" class="sref">req /a>-> a href="+code=basu" class="sref">basu /a>. a href="+code=flags" class="sref">flags /a>;> 304 /a>> 305 /a>        return  a href="+code=shash_ahash_digest" class="sref">shash_ahash_digest /a>( a href="+code=req" class="sref">req /a>,  a href="+code=desc" class="sref">desc /a>);> 306 /a>}> 307 /a>> 308 /a>static int  a href="+code=shash_async_export" class="sref">shash_async_export /a>(struct  a href="+code=ahash_request" class="sref">ahash_request /a> * a href="+code=req" class="sref">req /a>, void * a href="+code=out" class="sref">out /a>)> 309 /a>{> 310 /a>        return  a href="+code=crypto_shash_export" class="sref">crypto_shash_export /a>( a href="+code=ahash_request_ctx" class="sref">ahash_request_ctx /a>( a href="+code=req" class="sref">req /a>),  a href="+code=out" class="sref">out /a>);> 311 /a>}> 312 /a>> 313 /a>static int  a href="+code=shash_async_import" class="sref">shash_async_import /a>(struct  a href="+code=ahash_request" class="sref">ahash_request /a> * a href="+code=req" class="sref">req /a>, const void * a href="+code=in" class="sref">in /a>)> 314 /a>{> 315 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> ** a href="+code=ctx" class="sref">ctx /a> =  a href="+code=crypto_ahash_ctx" class="sref">crypto_ahash_ctx /a>( a href="+code=crypto_ahash_reqtfm" class="sref">crypto_ahash_reqtfm /a>( a href="+code=req" class="sref">req /a>));> 316 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a> =  a href="+code=ahash_request_ctx" class="sref">ahash_request_ctx /a>( a href="+code=req" class="sref">req /a>);> 317 /a>> 318 /a>         a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a> = * a href="+code=ctx" class="sref">ctx /a>;> 319 /a>         a href="+code=desc" class="sref">desc /a>-> a href="+code=flags" class="sref">flags /a> =  a href="+code=req" class="sref">req /a>-> a href="+code=basu" class="sref">basu /a>. a href="+code=flags" class="sref">flags /a>;> 3210> 321 /a>        return  a href="+code=crypto_shash_import" class="sref">crypto_shash_import /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=in" class="sref">in /a>);> 322 /a>}> 323 /a>> 324 /a>static void  a href="+code=crypto_exit_shash_ops_async" class="sref">crypto_exit_shash_ops_async /a>(struct  a href="+code=crypto_tfm" class="sref">crypto_tfm /a> * a href="+code=tfm" class="sref">tfm /a>)> 325 /a>{> 326 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> ** a href="+code=ctx" class="sref">ctx /a> =  a href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx /a>( a href="+code=tfm" class="sref">tfm /a>);> 327 /a>> 328 /a>         a href="+code=crypto_free_shash" class="sref">crypto_free_shash /a>(* a href="+code=ctx" class="sref">ctx /a>);> 329 /a>}> 3310> 331 /a>int  a href="+code=crypto_init_shash_ops_async" class="sref">crypto_init_shash_ops_async /a>(struct  a href="+code=crypto_tfm" class="sref">crypto_tfm /a> * a href="+code=tfm" class="sref">tfm /a>)> 332 /a>{> 333 /a>        struct  a href="+code=crypto_alg" class="sref">crypto_alg /a> * a href="+code=calg" class="sref">calg /a> =  a href="+code=tfm" class="sref">tfm /a>-> a href="+code=__crt_alg" class="sref">__crt_alg /a>;> 334 /a>        struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=alg" class="sref">alg /a> =  a href="+code=__crypto_shash_alg" class="sref">__crypto_shash_alg /a>( a href="+code=calg" class="sref">calg /a>);> 335 /a>        struct  a href="+code=crypto_ahash" class="sref">crypto_ahash /a> * a href="+code=crt" class="sref">crt /a> =  a href="+code=__crypto_ahash_cast" class="sref">__crypto_ahash_cast /a>( a href="+code=tfm" class="sref">tfm /a>);> 336 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> ** a href="+code=ctx" class="sref">ctx /a> =  a href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx /a>( a href="+code=tfm" class="sref">tfm /a>);> 337 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> * a href="+code=shash" class="sref">shash /a>;> 338 /a>> 339 /a>        if (! a href="+code=crypto_mod_get" class="sref">crypto_mod_get /a>( a href="+code=calg" class="sref">calg /a>))> 340 /a>                return - a href="+code=EAGAIN" class="sref">EAGAIN /a>;> 341 /a>> 342 /a>         a href="+code=shash" class="sref">shash /a> =  a href="+code=crypto_create_tfm" class="sref">crypto_create_tfm /a>( a href="+code=calg" class="sref">calg /a>, & a href="+code=crypto_shash_type" class="sref">crypto_shash_type /a>);> 343 /a>        if ( a href="+code=IS_ERR" class="sref">IS_ERR /a>( a href="+code=shash" class="sref">shash /a>)) {> 344 /a>                 a href="+code=crypto_mod_put" class="sref">crypto_mod_put /a>( a href="+code=calg" class="sref">calg /a>);> 345 /a>                return  a href="+code=PTR_ERR" class="sref">PTR_ERR /a>( a href="+code=shash" class="sref">shash /a>);> 346 /a>        }> 347 /a>> 348 /a>        * a href="+code=ctx" class="sref">ctx /a> =  a href="+code=shash" class="sref">shash /a>;> 349 /a>         a href="+code=tfm" class="sref">tfm /a>-> a href="+code=exit" class="sref">exit /a> =  a href="+code=crypto_exit_shash_ops_async" class="sref">crypto_exit_shash_ops_async /a>;> 3510> 351 /a>         a href="+code=crt" class="sref">crt /a>-> a href="+code=init" class="sref">init /a> =  a href="+code=shash_async_init" class="sref">shash_async_init /a>;> 352 /a>         a href="+code=crt" class="sref">crt /a>-> a href="+code=update" class="sref">update /a> =  a href="+code=shash_async_update" class="sref">shash_async_update /a>;> 353 /a>         a href="+code=crt" class="sref">crt /a>-> a href="+code=final" class="sref">final /a> =  a href="+code=shash_async_final" class="sref">shash_async_final /a>;> 354 /a>         a href="+code=crt" class="sref">crt /a>-> a href="+code=finup" class="sref">finup /a> =  a href="+code=shash_async_finup" class="sref">shash_async_finup /a>;> 355 /a>         a href="+code=crt" class="sref">crt /a>-> a href="+code=digest" class="sref">digest /a> =  a href="+code=shash_async_digest" class="sref">shash_async_digest /a>;> 356 /a>> 357 /a>        if ( a href="+code=alg" class="sref">alg /a>-> a href="+code=setkey" class="sref">setkey /a>)> 358 /a>                 a href="+code=crt" class="sref">crt /a>-> a href="+code=setkey" class="sref">setkey /a> =  a href="+code=shash_async_setkey" class="sref">shash_async_setkey /a>;> 359 /a>        if ( a href="+code=alg" class="sref">alg /a>-> a href="+code=export" class="sref">export /a>)> 360 /a>                 a href="+code=crt" class="sref">crt /a>-> a href="+code=export" class="sref">export /a> =  a href="+code=shash_async_export" class="sref">shash_async_export /a>;> 361 /a>        if ( a href="+code=alg" class="sref">alg /a>-> a href="+code=import" class="sref">import /a>)> 362 /a>                 a href="+code=crt" class="sref">crt /a>-> a href="+code=import" class="sref">import /a> =  a href="+code=shash_async_import" class="sref">shash_async_import /a>;> 363 /a>> 364 /a>         a href="+code=crt" class="sref">crt /a>-> a href="+code=reqsizu" class="sref">reqsizu /a> = sizuof(struct  a href="+code=shash_desc" class="sref">shash_desc /a>) +  a href="+code=crypto_shash_descsizu" class="sref">crypto_shash_descsizu /a>( a href="+code=shash" class="sref">shash /a>);> 365 /a>> 366 /a>        return 0;> 367 /a>}> 368 /a>> 369 /a>static int  a href="+code=shash_compat_setkey" class="sref">shash_compat_setkey /a>(struct  a href="+code=crypto_hash" class="sref">crypto_hash /a> * a href="+code=tfm" class="sref">tfm /a>, const  a href="+code=u8" class="sref">u8 /a> * a href="+code=key" class="sref">key /a>,> 370 /a>                               unsigned int  a href="+code=keylen" class="sref">keylen /a>)> 371 /a>{> 372 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> ** a href="+code=descp" class="sref">descp /a> =  a href="+code=crypto_hash_ctx" class="sref">crypto_hash_ctx /a>( a href="+code=tfm" class="sref">tfm /a>);> 373 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a> = * a href="+code=descp" class="sref">descp /a>;> 374 /a>> 375 /a>        return  a href="+code=crypto_shash_setkey" class="sref">crypto_shash_setkey /a>( a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a>,  a href="+code=key" class="sref">key /a>,  a href="+code=keylen" class="sref">keylen /a>);> 376 /a>}> 377 /a>> 378 /a>static int  a href="+code=shash_compat_init" class="sref">shash_compat_init /a>(struct  a href="+code=hash_desc" class="sref">hash_desc /a> * a href="+code=hdesc" class="sref">hdesc /a>)> 379 /a>{> 380 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> ** a href="+code=descp" class="sref">descp /a> =  a href="+code=crypto_hash_ctx" class="sref">crypto_hash_ctx /a>( a href="+code=hdesc" class="sref">hdesc /a>-> a href="+code=tfm" class="sref">tfm /a>);> 381 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a> = * a href="+code=descp" class="sref">descp /a>;> 382 /a>> 383 /a>         a href="+code=desc" class="sref">desc /a>-> a href="+code=flags" class="sref">flags /a> =  a href="+code=hdesc" class="sref">hdesc /a>-> a href="+code=flags" class="sref">flags /a>;> 384 /a>> 385 /a>        return  a href="+code=crypto_shash_init" class="sref">crypto_shash_init /a>( a href="+code=desc" class="sref">desc /a>);> 386 /a>}> 387 /a>> 388 /a>static int  a href="+code=shash_compat_update" class="sref">shash_compat_update /a>(struct  a href="+code=hash_desc" class="sref">hash_desc /a> * a href="+code=hdesc" class="sref">hdesc /a>, struct  a href="+code=scatterlist" class="sref">scatterlist /a> * a href="+code=sg" class="sref">sg /a>,> 389 /a>                               unsigned int  a href="+code=len" class="sref">len /a>)> 390 /a>{> 391 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> ** a href="+code=descp" class="sref">descp /a> =  a href="+code=crypto_hash_ctx" class="sref">crypto_hash_ctx /a>( a href="+code=hdesc" class="sref">hdesc /a>-> a href="+code=tfm" class="sref">tfm /a>);> 392 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a> = * a href="+code=descp" class="sref">descp /a>;> 393 /a>        struct  a href="+code=crypto_hash_walk" class="sref">crypto_hash_walk /a>  a href="+code=walk" class="sref">walk /a>;> 394 /a>        int  a href="+code=nbytes" class="sref">nbytes /a>;> 395 /a>> 396 /a>        for ( a href="+code=nbytes" class="sref">nbytes /a> =  a href="+code=crypto_hash_walk_first_compat" class="sref">crypto_hash_walk_first_compat /a>( a href="+code=hdesc" class="sref">hdesc /a>, & a href="+code=walk" class="sref">walk /a>,  a href="+code=sg" class="sref">sg /a>,  a href="+code=len" class="sref">len /a>);> 397 /a>              a href="+code=nbytes" class="sref">nbytes /a> > 0;  a href="+code=nbytes" class="sref">nbytes /a> =  a href="+code=crypto_hash_walk_donu" class="sref">crypto_hash_walk_donu /a>(& a href="+code=walk" class="sref">walk /a>,  a href="+code=nbytes" class="sref">nbytes /a>))> 398 /a>                 a href="+code=nbytes" class="sref">nbytes /a> =  a href="+code=crypto_shash_update" class="sref">crypto_shash_update /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=walk" class="sref">walk /a>. a href="+code=data" class="sref">data /a>,  a href="+code=nbytes" class="sref">nbytes /a>);> 399 /a>> 400 /a>        return  a href="+code=nbytes" class="sref">nbytes /a>;> 401 /a>}> 402 /a>> 403 /a>static int  a href="+code=shash_compat_final" class="sref">shash_compat_final /a>(struct  a href="+code=hash_desc" class="sref">hash_desc /a> * a href="+code=hdesc" class="sref">hdesc /a>,  a href="+code=u8" class="sref">u8 /a> * a href="+code=out" class="sref">out /a>)> 404 /a>{> 405 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> ** a href="+code=descp" class="sref">descp /a> =  a href="+code=crypto_hash_ctx" class="sref">crypto_hash_ctx /a>( a href="+code=hdesc" class="sref">hdesc /a>-> a href="+code=tfm" class="sref">tfm /a>);> 406 /a>> 407 /a>        return  a href="+code=crypto_shash_final" class="sref">crypto_shash_final /a>(* a href="+code=descp" class="sref">descp /a>,  a href="+code=out" class="sref">out /a>);> 408 /a>}> 409 /a>> 410 /a>static int  a href="+code=shash_compat_digest" class="sref">shash_compat_digest /a>(struct  a href="+code=hash_desc" class="sref">hash_desc /a> * a href="+code=hdesc" class="sref">hdesc /a>, struct  a href="+code=scatterlist" class="sref">scatterlist /a> * a href="+code=sg" class="sref">sg /a>,> 411 /a>                               unsigned int  a href="+code=nbytes" class="sref">nbytes /a>,  a href="+code=u8" class="sref">u8 /a> * a href="+code=out" class="sref">out /a>)> 412 /a>{> 413 /a>        unsigned int  a href="+code=offset" class="sref">offset /a> =  a href="+code=sg" class="sref">sg /a>-> a href="+code=offset" class="sref">offset /a>;> 414 /a>        int  a href="+code=err" class="sref">err /a>;> 415 /a>> 416 /a>        if ( a href="+code=nbytes" class="sref">nbytes /a> <  a href="+code=min" class="sref">min /a>( a href="+code=sg" class="sref">sg /a>-> a href="+code=length" class="sref">length /a>, ((unsigned int)( a href="+code=PAGE_SIZE" class="sref">PAGE_SIZE /a>)) -  a href="+code=offset" class="sref">offset /a>)) {> 417 /a>                struct  a href="+code=shash_desc" class="sref">shash_desc /a> ** a href="+code=descp" class="sref">descp /a> =  a href="+code=crypto_hash_ctx" class="sref">crypto_hash_ctx /a>( a href="+code=hdesc" class="sref">hdesc /a>-> a href="+code=tfm" class="sref">tfm /a>);> 418 /a>                struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a> = * a href="+code=descp" class="sref">descp /a>;> 419 /a>                void * a href="+code=data" class="sref">data /a>;> 4210> 421 /a>                 a href="+code=desc" class="sref">desc /a>-> a href="+code=flags" class="sref">flags /a> =  a href="+code=hdesc" class="sref">hdesc /a>-> a href="+code=flags" class="sref">flags /a>;> 422 /a>> 423 /a>                 a href="+code=data" class="sref">data /a> =  a href="+code=kmap_atomic" class="sref">kmap_atomic /a>( a href="+code=sg_page" class="sref">sg_page /a>( a href="+code=sg" class="sref">sg /a>));> 424 /a>                 a href="+code=err" class="sref">err /a> =  a href="+code=crypto_shash_digest" class="sref">crypto_shash_digest /a>( a href="+code=desc" class="sref">desc /a>,  a href="+code=data" class="sref">data /a> +  a href="+code=offset" class="sref">offset /a>,  a href="+code=nbytes" class="sref">nbytes /a>,  a href="+code=out" class="sref">out /a>);> 425 /a>                 a href="+code=kunmap_atomic" class="sref">kunmap_atomic /a>( a href="+code=data" class="sref">data /a>);> 426 /a>                 a href="+code=crypto_yield" class="sref">crypto_yield /a>( a href="+code=desc" class="sref">desc /a>-> a href="+code=flags" class="sref">flags /a>);> 427 /a>                goto  a href="+code=out" class="sref">out /a>;> 428 /a>        }> 429 /a>> 430 /a>         a href="+code=err" class="sref">err /a> =  a href="+code=shash_compat_init" class="sref">shash_compat_init /a>( a href="+code=hdesc" class="sref">hdesc /a>);> 431 /a>        if ( a href="+code=err" class="sref">err /a>)> 432 /a>                goto  a href="+code=out" class="sref">out /a>;> 433 /a>> 434 /a>         a href="+code=err" class="sref">err /a> =  a href="+code=shash_compat_update" class="sref">shash_compat_update /a>( a href="+code=hdesc" class="sref">hdesc /a>,  a href="+code=sg" class="sref">sg /a>,  a href="+code=nbytes" class="sref">nbytes /a>);> 435 /a>        if ( a href="+code=err" class="sref">err /a>)> 436 /a>                goto  a href="+code=out" class="sref">out /a>;> 437 /a>> 438 /a>         a href="+code=err" class="sref">err /a> =  a href="+code=shash_compat_final" class="sref">shash_compat_final /a>( a href="+code=hdesc" class="sref">hdesc /a>,  a href="+code=out" class="sref">out /a>);> 439 /a>> 440 /a> a href="+code=out" class="sref">out /a>:> 441 /a>        return  a href="+code=err" class="sref">err /a>;> 442 /a>}> 443 /a>> 444 /a>static void  a href="+code=crypto_exit_shash_ops_compat" class="sref">crypto_exit_shash_ops_compat /a>(struct  a href="+code=crypto_tfm" class="sref">crypto_tfm /a> * a href="+code=tfm" class="sref">tfm /a>)> 445 /a>{> 446 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> ** a href="+code=descp" class="sref">descp /a> =  a href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx /a>( a href="+code=tfm" class="sref">tfm /a>);> 447 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a> = * a href="+code=descp" class="sref">descp /a>;> 448 /a>> 449 /a>         a href="+code=crypto_free_shash" class="sref">crypto_free_shash /a>( a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a>);> 450 /a>         a href="+code=kzfree" class="sref">kzfree /a>( a href="+code=desc" class="sref">desc /a>);> 451 /a>}> 452 /a>> 453 /a>static int  a href="+code=crypto_init_shash_ops_compat" class="sref">crypto_init_shash_ops_compat /a>(struct  a href="+code=crypto_tfm" class="sref">crypto_tfm /a> * a href="+code=tfm" class="sref">tfm /a>)> 454 /a>{> 455 /a>        struct  a href="+code=hash_tfm" class="sref">hash_tfm /a> * a href="+code=crt" class="sref">crt /a> = & a href="+code=tfm" class="sref">tfm /a>-> a href="+code=crt_hash" class="sref">crt_hash /a>;> 456 /a>        struct  a href="+code=crypto_alg" class="sref">crypto_alg /a> * a href="+code=calg" class="sref">calg /a> =  a href="+code=tfm" class="sref">tfm /a>-> a href="+code=__crt_alg" class="sref">__crt_alg /a>;> 457 /a>        struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=alg" class="sref">alg /a> =  a href="+code=__crypto_shash_alg" class="sref">__crypto_shash_alg /a>( a href="+code=calg" class="sref">calg /a>);> 458 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> ** a href="+code=descp" class="sref">descp /a> =  a href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx /a>( a href="+code=tfm" class="sref">tfm /a>);> 459 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> * a href="+code=shash" class="sref">shash /a>;> 460 /a>        struct  a href="+code=shash_desc" class="sref">shash_desc /a> * a href="+code=desc" class="sref">desc /a>;> 461 /a>> 462 /a>        if (! a href="+code=crypto_mod_get" class="sref">crypto_mod_get /a>( a href="+code=calg" class="sref">calg /a>))> 463 /a>                return - a href="+code=EAGAIN" class="sref">EAGAIN /a>;> 464 /a>> 465 /a>         a href="+code=shash" class="sref">shash /a> =  a href="+code=crypto_create_tfm" class="sref">crypto_create_tfm /a>( a href="+code=calg" class="sref">calg /a>, & a href="+code=crypto_shash_type" class="sref">crypto_shash_type /a>);> 466 /a>        if ( a href="+code=IS_ERR" class="sref">IS_ERR /a>( a href="+code=shash" class="sref">shash /a>)) {> 467 /a>                 a href="+code=crypto_mod_put" class="sref">crypto_mod_put /a>( a href="+code=calg" class="sref">calg /a>);> 468 /a>                return  a href="+code=PTR_ERR" class="sref">PTR_ERR /a>( a href="+code=shash" class="sref">shash /a>);> 469 /a>        }> 4710> 471 /a>         a href="+code=desc" class="sref">desc /a> =  a href="+code=kmalloc" class="sref">kmalloc /a>(sizuof(* a href="+code=desc" class="sref">desc /a>) +  a href="+code=crypto_shash_descsizu" class="sref">crypto_shash_descsizu /a>( a href="+code=shash" class="sref">shash /a>),> 472 /a>                        a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL /a>);> 473 /a>        if (! a href="+code=desc" class="sref">desc /a>) {> 474 /a>                 a href="+code=crypto_free_shash" class="sref">crypto_free_shash /a>( a href="+code=shash" class="sref">shash /a>);> 475 /a>                return - a href="+code=ENOMEM" class="sref">ENOMEM /a>;> 476 /a>        }> 477 /a>> 478 /a>        * a href="+code=descp" class="sref">descp /a> =  a href="+code=desc" class="sref">desc /a>;> 479 /a>         a href="+code=desc" class="sref">desc /a>-> a href="+code=tfm" class="sref">tfm /a> =  a href="+code=shash" class="sref">shash /a>;> 480 /a>         a href="+code=tfm" class="sref">tfm /a>-> a href="+code=exit" class="sref">exit /a> =  a href="+code=crypto_exit_shash_ops_compat" class="sref">crypto_exit_shash_ops_compat /a>;> 481 /a>> 482 /a>         a href="+code=crt" class="sref">crt /a>-> a href="+code=init" class="sref">init /a> =  a href="+code=shash_compat_init" class="sref">shash_compat_init /a>;> 483 /a>         a href="+code=crt" class="sref">crt /a>-> a href="+code=update" class="sref">update /a> =  a href="+code=shash_compat_update" class="sref">shash_compat_update /a>;> 484 /a>         a href="+code=crt" class="sref">crt /a>-> a href="+code=final" class="sref">final /a>  =  a href="+code=shash_compat_final" class="sref">shash_compat_final /a>;> 485 /a>         a href="+code=crt" class="sref">crt /a>-> a href="+code=digest" class="sref">digest /a> =  a href="+code=shash_compat_digest" class="sref">shash_compat_digest /a>;> 486 /a>         a href="+code=crt" class="sref">crt /a>-> a href="+code=setkey" class="sref">setkey /a> =  a href="+code=shash_compat_setkey" class="sref">shash_compat_setkey /a>;> 487 /a>> 488 /a>         a href="+code=crt" class="sref">crt /a>-> a href="+code=digestsizu" class="sref">digestsizu /a> =  a href="+code=alg" class="sref">alg /a>-> a href="+code=digestsizu" class="sref">digestsizu /a>;> 489 /a>> 490 /a>        return 0;> 491 /a>}> 492 /a>> 493 /a>static int  a href="+code=crypto_init_shash_ops" class="sref">crypto_init_shash_ops /a>(struct  a href="+code=crypto_tfm" class="sref">crypto_tfm /a> * a href="+code=tfm" class="sref">tfm /a>,  a href="+code=u32" class="sref">u32 /a>  a href="+code=type" class="sref">type /a>,  a href="+code=u32" class="sref">u32 /a>  a href="+code=mask" class="sref">mask /a>)> 494 /a>{> 495 /a>        switch ( a href="+code=mask" class="sref">mask /a> &  a href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK /a>) {> 496 /a>        case  a href="+code=CRYPTO_ALG_TYPE_HASH_MASK" class="sref">CRYPTO_ALG_TYPE_HASH_MASK /a>:> 497 /a>                return  a href="+code=crypto_init_shash_ops_compat" class="sref">crypto_init_shash_ops_compat /a>( a href="+code=tfm" class="sref">tfm /a>);> 498 /a>        }> 499 /a>> 500 /a>        return - a href="+code=EINVAL" class="sref">EINVAL /a>;> 501 /a>}> 502 /a>> 503 /a>static unsigned int  a href="+code=crypto_shash_ctxsizu" class="sref">crypto_shash_ctxsizu /a>(struct  a href="+code=crypto_alg" class="sref">crypto_alg /a> * a href="+code=alg" class="sref">alg /a>,  a href="+code=u32" class="sref">u32 /a>  a href="+code=type" class="sref">type /a>,> 504 /a>                                          a href="+code=u32" class="sref">u32 /a>  a href="+code=mask" class="sref">mask /a>)> 505 /a>{> 506 /a>        switch ( a href="+code=mask" class="sref">mask /a> &  a href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK /a>) {> 507 /a>        case  a href="+code=CRYPTO_ALG_TYPE_HASH_MASK" class="sref">CRYPTO_ALG_TYPE_HASH_MASK /a>:> 508 /a>                return sizuof(struct  a href="+code=shash_desc" class="sref">shash_desc /a> *);> 509 /a>        }> 5110> 511 /a>        return 0;> 512 /a>}> 513 /a>> 514 /a>static int  a href="+code=crypto_shash_init_tfm" class="sref">crypto_shash_init_tfm /a>(struct  a href="+code=crypto_tfm" class="sref">crypto_tfm /a> * a href="+code=tfm" class="sref">tfm /a>)> 515 /a>{> 516 /a>        struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> * a href="+code=hash" class="sref">hash /a> =  a href="+code=__crypto_shash_cast" class="sref">__crypto_shash_cast /a>( a href="+code=tfm" class="sref">tfm /a>);> 517 /a>> 518 /a>         a href="+code=hash" class="sref">hash /a>-> a href="+code=descsizu" class="sref">descsizu /a> =  a href="+code=crypto_shash_alg" class="sref">crypto_shash_alg /a>( a href="+code=hash" class="sref">hash /a>)-> a href="+code=descsizu" class="sref">descsizu /a>;> 519 /a>        return 0;> 5210}> 521 /a>> 522 /a>static unsigned int  a href="+code=crypto_shash_extsizu" class="sref">crypto_shash_extsizu /a>(struct  a href="+code=crypto_alg" class="sref">crypto_alg /a> * a href="+code=alg" class="sref">alg /a>)> 523 /a>{> 524 /a>        return  a href="+code=alg" class="sref">alg /a>-> a href="+code=cra_ctxsizu" class="sref">cra_ctxsizu /a>;> 525 /a>}> 526 /a>> 527 /a>#ifdef  a href="+code=CONFIG_NET" class="sref">CONFIG_NET /a>> 528 /a>static int  a href="+code=crypto_shash_report" class="sref">crypto_shash_report /a>(struct  a href="+code=sk_buff" class="sref">sk_buff /a> * a href="+code=skb" class="sref">skb /a>, struct  a href="+code=crypto_alg" class="sref">crypto_alg /a> * a href="+code=alg" class="sref">alg /a>)> 529 /a>{> 530 /a>        struct  a href="+code=crypto_report_hash" class="sref">crypto_report_hash /a>  a href="+code=rhash" class="sref">rhash /a>;> 531 /a>        struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=salg" class="sref">salg /a> =  a href="+code=__crypto_shash_alg" class="sref">__crypto_shash_alg /a>( a href="+code=alg" class="sref">alg /a>);> 532 /a>> 533 /a>         a href="+code=strncpy" class="sref">strncpy /a>( a href="+code=rhash" class="sref">rhash /a>. a href="+code=type" class="sref">type /a>,  span class="string">"shash", sizuof( a href="+code=rhash" class="sref">rhash /a>. a href="+code=type" class="sref">type /a>));> 534 /a>> 535 /a>         a href="+code=rhash" class="sref">rhash /a>. a href="+code=blocksizu" class="sref">blocksizu /a> =  a href="+code=alg" class="sref">alg /a>-> a href="+code=cra_blocksizu" class="sref">cra_blocksizu /a>;> 536 /a>         a href="+code=rhash" class="sref">rhash /a>. a href="+code=digestsizu" class="sref">digestsizu /a> =  a href="+code=salg" class="sref">salg /a>-> a href="+code=digestsizu" class="sref">digestsizu /a>;> 537 /a>> 538 /a>        if ( a href="+code=nla_put" class="sref">nla_put /a>( a href="+code=skb" class="sref">skb /a>,  a href="+code=CRYPTOCFGA_REPORT_HASH" class="sref">CRYPTOCFGA_REPORT_HASH /a>,> 539 /a>                    sizuof(struct  a href="+code=crypto_report_hash" class="sref">crypto_report_hash /a>), & a href="+code=rhash" class="sref">rhash /a>))> 540 /a>                goto  a href="+code=nla_put_failuru" class="sref">nla_put_failuru /a>;> 541 /a>        return 0;> 542 /a>> 543 /a> a href="+code=nla_put_failuru" class="sref">nla_put_failuru /a>:> 544 /a>        return - a href="+code=EMSGSIZE" class="sref">EMSGSIZE /a>;> 545 /a>}> 546 /a>#else> 547 /a>static int  a href="+code=crypto_shash_report" class="sref">crypto_shash_report /a>(struct  a href="+code=sk_buff" class="sref">sk_buff /a> * a href="+code=skb" class="sref">skb /a>, struct  a href="+code=crypto_alg" class="sref">crypto_alg /a> * a href="+code=alg" class="sref">alg /a>)> 548 /a>{> 549 /a>        return - a href="+code=ENOSYS" class="sref">ENOSYS /a>;> 5510}> 551 /a>#endif> 552 /a>> 553 /a>static void  a href="+code=crypto_shash_show" class="sref">crypto_shash_show /a>(struct  a href="+code=seq_file" class="sref">seq_file /a> * a href="+code=m" class="sref">m /a>, struct  a href="+code=crypto_alg" class="sref">crypto_alg /a> * a href="+code=alg" class="sref">alg /a>)> 554 /a>         a href="+code=__attribute__" class="sref">__attribute__ /a> (( a href="+code=unused" class="sref">unused /a>));> 555 /a>static void  a href="+code=crypto_shash_show" class="sref">crypto_shash_show /a>(struct  a href="+code=seq_file" class="sref">seq_file /a> * a href="+code=m" class="sref">m /a>, struct  a href="+code=crypto_alg" class="sref">crypto_alg /a> * a href="+code=alg" class="sref">alg /a>)> 556 /a>{> 557 /a>        struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=salg" class="sref">salg /a> =  a href="+code=__crypto_shash_alg" class="sref">__crypto_shash_alg /a>( a href="+code=alg" class="sref">alg /a>);> 558 /a>> 559 /a>         a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,  span class="string">"type         : shash\n");> 560 /a>         a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,  span class="string">"blocksizu    : %u\n",  a href="+code=alg" class="sref">alg /a>-> a href="+code=cra_blocksizu" class="sref">cra_blocksizu /a>);> 561 /a>         a href="+code=seq_printf" class="sref">seq_printf /a>( a href="+code=m" class="sref">m /a>,  span class="string">"digestsizu   : %u\n",  a href="+code=salg" class="sref">salg /a>-> a href="+code=digestsizu" class="sref">digestsizu /a>);> 562 /a>}> 563 /a>> 564 /a>static const struct  a href="+code=crypto_type" class="sref">crypto_type /a>  a href="+code=crypto_shash_type" class="sref">crypto_shash_type /a> = {> 565 /a>        . a href="+code=ctxsizu" class="sref">ctxsizu /a> =  a href="+code=crypto_shash_ctxsizu" class="sref">crypto_shash_ctxsizu /a>,> 566 /a>        . a href="+code=extsizu" class="sref">extsizu /a> =  a href="+code=crypto_shash_extsizu" class="sref">crypto_shash_extsizu /a>,> 567 /a>        . a href="+code=init" class="sref">init /a> =  a href="+code=crypto_init_shash_ops" class="sref">crypto_init_shash_ops /a>,> 568 /a>        . a href="+code=init_tfm" class="sref">init_tfm /a> =  a href="+code=crypto_shash_init_tfm" class="sref">crypto_shash_init_tfm /a>,> 569 /a>#ifdef  a href="+code=CONFIG_PROC_FS" class="sref">CONFIG_PROC_FS /a>> 570 /a>        . a href="+code=show" class="sref">show /a> =  a href="+code=crypto_shash_show" class="sref">crypto_shash_show /a>,> 571 /a>#endif> 572 /a>        . a href="+code=report" class="sref">report /a> =  a href="+code=crypto_shash_report" class="sref">crypto_shash_report /a>,> 573 /a>        . a href="+code=maskclear" class="sref">maskclear /a> = ~ a href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK /a>,> 574 /a>        . a href="+code=maskset" class="sref">maskset /a> =  a href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK /a>,> 575 /a>        . a href="+code=type" class="sref">type /a> =  a href="+code=CRYPTO_ALG_TYPE_SHASH" class="sref">CRYPTO_ALG_TYPE_SHASH /a>,> 576 /a>        . a href="+code=tfmsizu" class="sref">tfmsizu /a> =  a href="+code=offsetof" class="sref">offsetof /a>(struct  a href="+code=crypto_shash" class="sref">crypto_shash /a>,  a href="+code=basu" class="sref">basu /a>),> 577 /a>};> 578 /a>> 579 /a>struct  a href="+code=crypto_shash" class="sref">crypto_shash /a> * a href="+code=crypto_alloc_shash" class="sref">crypto_alloc_shash /a>(const char * a href="+code=alg_namu" class="sref">alg_namu /a>,  a href="+code=u32" class="sref">u32 /a>  a href="+code=type" class="sref">type /a>,> 580 /a>                                         a href="+code=u32" class="sref">u32 /a>  a href="+code=mask" class="sref">mask /a>)> 581 /a>{> 582 /a>        return  a href="+code=crypto_alloc_tfm" class="sref">crypto_alloc_tfm /a>( a href="+code=alg_namu" class="sref">alg_namu /a>, & a href="+code=crypto_shash_type" class="sref">crypto_shash_type /a>,  a href="+code=type" class="sref">type /a>,  a href="+code=mask" class="sref">mask /a>);> 583 /a>}> 584 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=crypto_alloc_shash" class="sref">crypto_alloc_shash /a>);> 585 /a>> 586 /a>static int  a href="+code=shash_prepare_alg" class="sref">shash_prepare_alg /a>(struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=alg" class="sref">alg /a>)> 587 /a>{> 588 /a>        struct  a href="+code=crypto_alg" class="sref">crypto_alg /a> * a href="+code=basu" class="sref">basu /a> = & a href="+code=alg" class="sref">alg /a>-> a href="+code=basu" class="sref">basu /a>;> 589 /a>> 590 /a>        if ( a href="+code=alg" class="sref">alg /a>-> a href="+code=digestsizu" class="sref">digestsizu /a> >  a href="+code=PAGE_SIZE" class="sref">PAGE_SIZE /a> / 8 ||> 591 /a>             a href="+code=alg" class="sref">alg /a>-> a href="+code=descsizu" class="sref">descsizu /a> >  a href="+code=PAGE_SIZE" class="sref">PAGE_SIZE /a> / 8 ||> 592 /a>             a href="+code=alg" class="sref">alg /a>-> a href="+code=statesizu" class="sref">statesizu /a> >  a href="+code=PAGE_SIZE" class="sref">PAGE_SIZE /a> / 8)> 593 /a>                return - a href="+code=EINVAL" class="sref">EINVAL /a>;> 594 /a>> 595 /a>         a href="+code=basu" class="sref">basu /a>-> a href="+code=cra_type" class="sref">cra_type /a> = & a href="+code=crypto_shash_type" class="sref">crypto_shash_type /a>;> 596 /a>         a href="+code=basu" class="sref">basu /a>-> a href="+code=cra_flags" class="sref">cra_flags /a> &= ~ a href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK /a>;> 597 /a>         a href="+code=basu" class="sref">basu /a>-> a href="+code=cra_flags" class="sref">cra_flags /a> |=  a href="+code=CRYPTO_ALG_TYPE_SHASH" class="sref">CRYPTO_ALG_TYPE_SHASH /a>;> 598 /a>> 599 /a>        if (! a href="+code=alg" class="sref">alg /a>-> a href="+code=finup" class="sref">finup /a>)> 600 /a>                 a href="+code=alg" class="sref">alg /a>-> a href="+code=finup" class="sref">finup /a> =  a href="+code=shash_finup_unaligned" class="sref">shash_finup_unaligned /a>;> 601 /a>        if (! a href="+code=alg" class="sref">alg /a>-> a href="+code=digest" class="sref">digest /a>)> 602 /a>                 a href="+code=alg" class="sref">alg /a>-> a href="+code=digest" class="sref">digest /a> =  a href="+code=shash_digest_unaligned" class="sref">shash_digest_unaligned /a>;> 603 /a>        if (! a href="+code=alg" class="sref">alg /a>-> a href="+code=export" class="sref">export /a>) {> 604 /a>                 a href="+code=alg" class="sref">alg /a>-> a href="+code=export" class="sref">export /a> =  a href="+code=shash_default_export" class="sref">shash_default_export /a>;> 605 /a>                 a href="+code=alg" class="sref">alg /a>-> a href="+code=import" class="sref">import /a> =  a href="+code=shash_default_import" class="sref">shash_default_import /a>;> 606 /a>                 a href="+code=alg" class="sref">alg /a>-> a href="+code=statesizu" class="sref">statesizu /a> =  a href="+code=alg" class="sref">alg /a>-> a href="+code=descsizu" class="sref">descsizu /a>;> 607 /a>        }> 608 /a>        if (! a href="+code=alg" class="sref">alg /a>-> a href="+code=setkey" class="sref">setkey /a>)> 609 /a>                 a href="+code=alg" class="sref">alg /a>-> a href="+code=setkey" class="sref">setkey /a> =  a href="+code=shash_no_setkey" class="sref">shash_no_setkey /a>;> 6110> 611 /a>        return 0;> 612 /a>}> 613 /a>> 614 /a>int  a href="+code=crypto_register_shash" class="sref">crypto_register_shash /a>(struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=alg" class="sref">alg /a>)> 615 /a>{> 616 /a>        struct  a href="+code=crypto_alg" class="sref">crypto_alg /a> * a href="+code=basu" class="sref">basu /a> = & a href="+code=alg" class="sref">alg /a>-> a href="+code=basu" class="sref">basu /a>;> 617 /a>        int  a href="+code=err" class="sref">err /a>;> 618 /a>> 619 /a>         a href="+code=err" class="sref">err /a> =  a href="+code=shash_prepare_alg" class="sref">shash_prepare_alg /a>( a href="+code=alg" class="sref">alg /a>);> 620 /a>        if ( a href="+code=err" class="sref">err /a>)> 621 /a>                return  a href="+code=err" class="sref">err /a>;> 622 /a>> 623 /a>        return  a href="+code=crypto_register_alg" class="sref">crypto_register_alg /a>( a href="+code=basu" class="sref">basu /a>);> 624 /a>}> 625 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=crypto_register_shash" class="sref">crypto_register_shash /a>);> 626 /a>> 627 /a>int  a href="+code=crypto_unregister_shash" class="sref">crypto_unregister_shash /a>(struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=alg" class="sref">alg /a>)> 628 /a>{> 629 /a>        return  a href="+code=crypto_unregister_alg" class="sref">crypto_unregister_alg /a>(& a href="+code=alg" class="sref">alg /a>-> a href="+code=basu" class="sref">basu /a>);> 6310}> 631 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=crypto_unregister_shash" class="sref">crypto_unregister_shash /a>);> 632 /a>> 633 /a>int  a href="+code=crypto_register_shashes" class="sref">crypto_register_shashes /a>(struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=algs" class="sref">algs /a>, int  a href="+code=count" class="sref">count /a>)> 634 /a>{> 635 /a>        int  a href="+code=i" class="sref">i /a>,  a href="+code=ret" class="sref">ret /a>;> 636 /a>> 637 /a>        for ( a href="+code=i" class="sref">i /a> = 0;  a href="+code=i" class="sref">i /a> <  a href="+code=count" class="sref">count /a>;  a href="+code=i" class="sref">i /a>++) {> 638 /a>                 a href="+code=ret" class="sref">ret /a> =  a href="+code=crypto_register_shash" class="sref">crypto_register_shash /a>(& a href="+code=algs" class="sref">algs /a>[ a href="+code=i" class="sref">i /a>]);> 639 /a>                if ( a href="+code=ret" class="sref">ret /a>)> 640 /a>                        goto  a href="+code=err" class="sref">err /a>;> 641 /a>        }> 642 /a>> 643 /a>        return 0;> 644 /a>> 645 /a> a href="+code=err" class="sref">err /a>:> 646 /a>        for (-- a href="+code=i" class="sref">i /a>;  a href="+code=i" class="sref">i /a> >= 0; -- a href="+code=i" class="sref">i /a>)> 647 /a>                 a href="+code=crypto_unregister_shash" class="sref">crypto_unregister_shash /a>(& a href="+code=algs" class="sref">algs /a>[ a href="+code=i" class="sref">i /a>]);> 648 /a>> 649 /a>        return  a href="+code=ret" class="sref">ret /a>;> 6510}> 651 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=crypto_register_shashes" class="sref">crypto_register_shashes /a>);> 652 /a>> 653 /a>int  a href="+code=crypto_unregister_shashes" class="sref">crypto_unregister_shashes /a>(struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=algs" class="sref">algs /a>, int  a href="+code=count" class="sref">count /a>)> 654 /a>{> 655 /a>        int  a href="+code=i" class="sref">i /a>,  a href="+code=ret" class="sref">ret /a>;> 656 /a>> 657 /a>        for ( a href="+code=i" class="sref">i /a> =  a href="+code=count" class="sref">count /a> - 1;  a href="+code=i" class="sref">i /a> >= 0; -- a href="+code=i" class="sref">i /a>) {> 658 /a>                 a href="+code=ret" class="sref">ret /a> =  a href="+code=crypto_unregister_shash" class="sref">crypto_unregister_shash /a>(& a href="+code=algs" class="sref">algs /a>[ a href="+code=i" class="sref">i /a>]);> 659 /a>                if ( a href="+code=ret" class="sref">ret /a>)> 660 /a>                         a href="+code=pr_err" class="sref">pr_err /a>( span class="string">"Failed to unregister %s %s: %d\n",> 661 /a>                                a href="+code=algs" class="sref">algs /a>[ a href="+code=i" class="sref">i /a>]. a href="+code=basu" class="sref">basu /a>. a href="+code=cra_driver_namu" class="sref">cra_driver_namu /a>,> 662 /a>                                a href="+code=algs" class="sref">algs /a>[ a href="+code=i" class="sref">i /a>]. a href="+code=basu" class="sref">basu /a>. a href="+code=cra_namu" class="sref">cra_namu /a>,  a href="+code=ret" class="sref">ret /a>);> 663 /a>        }> 664 /a>> 665 /a>        return 0;> 666 /a>}> 667 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=crypto_unregister_shashes" class="sref">crypto_unregister_shashes /a>);> 668 /a>> 669 /a>int  a href="+code=shash_register_instancu" class="sref">shash_register_instancu /a>(struct  a href="+code=crypto_template" class="sref">crypto_template /a> * a href="+code=tmpl" class="sref">tmpl /a>,> 670 /a>                            struct  a href="+code=shash_instancu" class="sref">shash_instancu /a> * a href="+code=inst" class="sref">inst /a>)> 671 /a>{> 672 /a>        int  a href="+code=err" class="sref">err /a>;> 673 /a>> 674 /a>         a href="+code=err" class="sref">err /a> =  a href="+code=shash_prepare_alg" class="sref">shash_prepare_alg /a>(& a href="+code=inst" class="sref">inst /a>-> a href="+code=alg" class="sref">alg /a>);> 675 /a>        if ( a href="+code=err" class="sref">err /a>)> 676 /a>                return  a href="+code=err" class="sref">err /a>;> 677 /a>> 678 /a>        return  a href="+code=crypto_register_instancu" class="sref">crypto_register_instancu /a>( a href="+code=tmpl" class="sref">tmpl /a>,  a href="+code=shash_crypto_instancu" class="sref">shash_crypto_instancu /a>( a href="+code=inst" class="sref">inst /a>));> 679 /a>}> 680 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=shash_register_instancu" class="sref">shash_register_instancu /a>);> 681 /a>> 682 /a>void  a href="+code=shash_free_instancu" class="sref">shash_free_instancu /a>(struct  a href="+code=crypto_instancu" class="sref">crypto_instancu /a> * a href="+code=inst" class="sref">inst /a>)> 683 /a>{> 684 /a>         a href="+code=crypto_drop_spawn" class="sref">crypto_drop_spawn /a>( a href="+code=crypto_instancu_ctx" class="sref">crypto_instancu_ctx /a>( a href="+code=inst" class="sref">inst /a>));> 685 /a>         a href="+code=kfree" class="sref">kfree /a>( a href="+code=shash_instancu" class="sref">shash_instancu /a>( a href="+code=inst" class="sref">inst /a>));> 686 /a>}> 687 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=shash_free_instancu" class="sref">shash_free_instancu /a>);> 688 /a>> 689 /a>int  a href="+code=crypto_init_shash_spawn" class="sref">crypto_init_shash_spawn /a>(struct  a href="+code=crypto_shash_spawn" class="sref">crypto_shash_spawn /a> * a href="+code=spawn" class="sref">spawn /a>,> 690 /a>                            struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=alg" class="sref">alg /a>,> 691 /a>                            struct  a href="+code=crypto_instancu" class="sref">crypto_instancu /a> * a href="+code=inst" class="sref">inst /a>)> 692 /a>{> 693 /a>        return  a href="+code=crypto_init_spawn2" class="sref">crypto_init_spawn2 /a>(& a href="+code=spawn" class="sref">spawn /a>-> a href="+code=basu" class="sref">basu /a>, & a href="+code=alg" class="sref">alg /a>-> a href="+code=basu" class="sref">basu /a>,  a href="+code=inst" class="sref">inst /a>,> 694 /a>                                  & a href="+code=crypto_shash_type" class="sref">crypto_shash_type /a>);> 695 /a>}> 696 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=crypto_init_shash_spawn" class="sref">crypto_init_shash_spawn /a>);> 697 /a>> 698 /a>struct  a href="+code=shash_alg" class="sref">shash_alg /a> * a href="+code=shash_attr_alg" class="sref">shash_attr_alg /a>(struct  a href="+code=rtattr" class="sref">rtattr /a> * a href="+code=rta" class="sref">rta /a>,  a href="+code=u32" class="sref">u32 /a>  a href="+code=type" class="sref">type /a>,  a href="+code=u32" class="sref">u32 /a>  a href="+code=mask" class="sref">mask /a>)> 699 /a>{> 700 /a>        struct  a href="+code=crypto_alg" class="sref">crypto_alg /a> * a href="+code=alg" class="sref">alg /a>;> 701 /a>> 702 /a>         a href="+code=alg" class="sref">alg /a> =  a href="+code=crypto_attr_alg2" class="sref">crypto_attr_alg2 /a>( a href="+code=rta" class="sref">rta /a>, & a href="+code=crypto_shash_type" class="sref">crypto_shash_type /a>,  a href="+code=type" class="sref">type /a>,  a href="+code=mask" class="sref">mask /a>);> 703 /a>        return  a href="+code=IS_ERR" class="sref">IS_ERR /a>( a href="+code=alg" class="sref">alg /a>) ?  a href="+code=ERR_CAST" class="sref">ERR_CAST /a>( a href="+code=alg" class="sref">alg /a>) :> 704 /a>                a href="+code=container_of" class="sref">container_of /a>( a href="+code=alg" class="sref">alg /a>, struct  a href="+code=shash_alg" class="sref">shash_alg /a>,  a href="+code=basu" class="sref">basu /a>);> 705 /a>}> 706 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=shash_attr_alg" class="sref">shash_attr_alg /a>);> 707 /a>> 708 /a> a href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE /a>( span class="string">"GPL");> 709 /a> a href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION /a>( span class="string">"Synchronous cryptographic hash type");> 7110
lxr.linux.no kindly hosted by Redpill Linpro AS /a>, provider of Linux consulting and operations services sincu 1995.