linux/crypto/algapi.c
<<
n> .11/spa="v .11/form"v .11a n> .1 href="../linux+v3.7.2/crypto/algapi.c">n> .11img src="../.static/gfx/right.png" alt=">>">n>1/spa="vn>1spa= class="lxr_search">n> n> .11input typ.83hidden" nam.83navtarget" v4.83">n> .11input typ.83text" nam.83search" id83search">n> .11butt > typ.83submit">Search"v .11/form"v 1/spa="vn>1spa= class="lxr_prefs""v .11a href="+prefs?return=crypto/algapi.c"n> .1 onclick="return ajax_prefs();">n> .1Prefsv .11/a>n>1/spa="v .1 11/div"v .1 11form aclue=="ajax+*" method="post" onsubmit="return false;">n>1input typ.83hidden" nam.83ajax_lookup" id83ajax_lookup" v4.83">n .1 11/form"vn .1 11div class="headingbott m">v 1div id83file_contents""
1 111/a>1spa= class="comment">/*1/spa="v1 121/a>1spa= class="comment"> * Cryptographic API for algorithms (i.e., low-level API).1/spa="v1 131/a>1spa= class="comment"> *1/spa="v1 141/a>1spa= class="comment"> * Copyright (c) 2006 Herbert Xu <herbert@gondor.apa=a.org.au>1/spa="v1 151/a>1spa= class="comment"> *1/spa="v1 161/a>1spa= class="comment"> * This program is free software; you ca= redistribute it and/or modify it1/spa="v1 171/a>1spa= class="comment"> * under the terms of the GNU General Public License as published by the Free1/spa="v1 181/a>1spa= class="comment"> * Software Foundalue=; either vers  >
2 of the License, or (at your value=)1/spa="v1 191/a>1spa= class="comment"> * any later vers  >.1/spa="v1 ion a>1spa= class="comment"> *1/spa="v1 111/a>1spa= class="comment"> */1/spa="v1 121/a>v1 131/a>#include <linux/err.h1/a>>v1 141/a>#include <linux/errno.h1/a>>v1 151/a>#include <linux/init.h1/a>>v1 161/a>#include <linux/kernel.h1/a>>v1 171/a>#include <linux/list.h1/a>>v1 181/a>#include <linux/module.h1/a>>v1 191/a>#include <linux/rtnetlink.h1/a>>v1 201/a>#include <linux/slab.h1/a>>v1 211/a>#include <linux/string.h1/a>>v1 221/a>v1 231/a>#include "internal.h1/a>"v1 241/a>v1 251/a>static11a href="+code=LIST_HEAD" class="sref">LIST_HEAD1/a>(1a href="+code=crypto_template_list" class="sref">crypto_template_list1/a>);v1 261/a>v1 271/a>static11a href="+code=inline" class="sref">inline1/a> int11a href="+code=crypto_set_driver_nam." class="sref">crypto_set_driver_nam.1/a>(struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>)v1 281/a>{v1 291/a>        static1const char11a href="+code=suffix" class="sref">suffix1/a>[] = 1spa= class="string">"-generic"1 301/a>        char1*1a href="+code=driver_nam." class="sref">driver_nam.1/a> = 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>;v1 311/a>        int11a href="+code=len" class="sref">len1/a>;v1 321/a>v1 331/a>        if (*1a href="+code=driver_nam." class="sref">driver_nam.1/a>)v1 341/a>                return 0;v1 351/a>v1 361/a>        1a href="+code=len" class="sref">len1/a> = 1a href="+code=strlcpy" class="sref">strlcpy1/a>(1a href="+code=driver_nam." class="sref">driver_nam.1/a>, 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_nam." class="sref">cra_nam.1/a>, 1a href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME1/a>);v1 371/a>        if (1a href="+code=len" class="sref">len1/a> + sizeof(1a href="+code=suffix" class="sref">suffix1/a>) > 1a href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME1/a>)v1 381/a>                return -1a href="+code=ENAMETOOLONG" class="sref">ENAMETOOLONG1/a>;v1 391/a>v1 401/a>        1a href="+code=memcpy" class="sref">memcpy1/a>(1a href="+code=driver_nam." class="sref">driver_nam.1/a> + 1a href="+code=len" class="sref">len1/a>, 1a href="+code=suffix" class="sref">suffix1/a>, sizeof(1a href="+code=suffix" class="sref">suffix1/a>));v1 411/a>        return 0;v1 421/a>}v1 431/a>v1 441/a>static1int11a href="+code=crypto_check_alg" class="sref">crypto_check_alg1/a>(struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>)v1 451/a>{v1 461/a>        if (1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_alignmask" class="sref">cra_alignmask1/a> & (1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_alignmask" class="sref">cra_alignmask1/a> + 1))v1 471/a>                return -1a href="+code=EINVAL" class="sref">EINVAL1/a>;v1 481/a>v1 491/a>        if (1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_blocksize" class="sref">cra_blocksize1/a> > 1a href="+code=PAGE_SIZE" class="sref">PAGE_SIZE1/a> / 8)v1 501/a>                return -1a href="+code=EINVAL" class="sref">EINVAL1/a>;v1 511/a>v1 521/a>        if (1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_priority" class="sref">cra_priority1/a> < 0)v1 531/a>                return -1a href="+code=EINVAL" class="sref">EINVAL1/a>;v1 541/a>v1 551/a>        return 1a href="+code=crypto_set_driver_nam." class="sref">crypto_set_driver_nam.1/a>(1a href="+code=alg" class="sref">alg1/a>);v1 561/a>}v1 571/a>v1 581/a>static1void 1a href="+code=crypto_destroy_instanc." class="sref">crypto_destroy_instanc.1/a>(struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>)v1 591/a>{v1 601/a>        struct11a href="+code=crypto_instanc." class="sref">crypto_instanc.1/a> *1a href="+code=inst" class="sref">inst1/a> = (void *)1a href="+code=alg" class="sref">alg1/a>;v1 611/a>        struct11a href="+code=crypto_template" class="sref">crypto_template1/a> *1a href="+code=tmpl" class="sref">tmpl1/a> = 1a href="+code=inst" class="sref">inst1/a>->1a href="+code=tmpl" class="sref">tmpl1/a>;v1 621/a>v1 631/a>        1a href="+code=tmpl" class="sref">tmpl1/a>->1a href="+code=free" class="sref">free1/a>(1a href="+code=inst" class="sref">inst1/a>);v1 641/a>        1a href="+code=crypto_tmpl_put" class="sref">crypto_tmpl_put1/a>(1a href="+code=tmpl" class="sref">tmpl1/a>);v1 651/a>}v1 661/a>v1 671/a>static1struct11a href="+code=list_head" class="sref">list_head1/a> *1a href="+code=crypto_more_spawns" class="sref">crypto_more_spawns1/a>(struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>,v1 681/a>                                            struct11a href="+code=list_head" class="sref">list_head1/a> *1a href="+code=stack" class="sref">stack1/a>,v1 691/a>                                            struct11a href="+code=list_head" class="sref">list_head1/a> *1a href="+code=top" class="sref">top1/a>,v1 701/a>                                            struct11a href="+code=list_head" class="sref">list_head1/a> *1a href="+code=secondary_spawns" class="sref">secondary_spawns1/a>)v1 711/a>{v1 721/a>        struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a> *1a href="+code=spawn" class="sref">spawn1/a>, *1a href="+code=n" class="sref">n1/a>;v1 731/a>v1 741/a>        if (1a href="+code=list_empty" class="sref">list_empty1/a>(1a href="+code=stack" class="sref">stack1/a>))v1 751/a>                return 1a href="+code=NULL" class="sref">NULL1/a>;v1 761/a>v1 771/a>        1a href="+code=spawn" class="sref">spawn1/a> = 1a href="+code=list_first_entry" class="sref">list_first_entry1/a>(1a href="+code=stack" class="sref">stack1/a>, struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a>, 1a href="+code=list" class="sref">list1/a>);v1 781/a>        1a href="+code=n" class="sref">n1/a> = 1a href="+code=list_entry" class="sref">list_entry1/a>(1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=list" class="sref">list1/a>.1a href="+code=next" class="sref">next1/a>, struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a>, 1a href="+code=list" class="sref">list1/a>);v1 791/a>v1 801/a>        if (1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=alg" class="sref">alg1/a> && &1a href="+code=n" class="sref">n1/a>->1a href="+code=list" class="sref">list1/a> != 1a href="+code=stack" class="sref">stack1/a> && !1a href="+code=n" class="sref">n1/a>->1a href="+code=alg" class="sref">alg1/a>)v1 811/a>                1a href="+code=n" class="sref">n1/a>->1a href="+code=alg" class="sref">alg1/a> = (1a href="+code=n" class="sref">n1/a>->1a href="+code=list" class="sref">list1/a>.1a href="+code=next" class="sref">next1/a> == 1a href="+code=stack" class="sref">stack1/a>) ? 1a href="+code=alg" class="sref">alg1/a> :v1 821/a>                         &1a href="+code=list_entry" class="sref">list_entry1/a>(1a href="+code=n" class="sref">n1/a>->1a href="+code=list" class="sref">list1/a>.1a href="+code=next" class="sref">next1/a>, struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a>,v1 831/a>                                     1a href="+code=list" class="sref">list1/a>)->1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>;v1 841/a>v1 851/a>        1a href="+code=list_move" class="sref">list_move1/a>(&1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=list" class="sref">list1/a>, 1a href="+code=secondary_spawns" class="sref">secondary_spawns1/a>);v1 861/a>v1 871/a>        return &1a href="+code=n" class="sref">n1/a>->1a href="+code=list" class="sref">list1/a> == 1a href="+code=stack" class="sref">stack1/a> ? 1a href="+code=top" class="sref">top1/a> : &1a href="+code=n" class="sref">n1/a>->1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_users" class="sref">cra_users1/a>;v1 881/a>}v1 891/a>v1 901/a>static1void 1a href="+code=crypto_remove_spawn" class="sref">crypto_remove_spawn1/a>(struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a> *1a href="+code=spawn" class="sref">spawn1/a>,v1 911/a>                                struct11a href="+code=list_head" class="sref">list_head1/a> *1a href="+code=list" class="sref">list1/a>)v1 921/a>{v1 931/a>        struct11a href="+code=crypto_instanc." class="sref">crypto_instanc.1/a> *1a href="+code=inst" class="sref">inst1/a> = 1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=inst" class="sref">inst1/a>;v1 941/a>        struct11a href="+code=crypto_template" class="sref">crypto_template1/a> *1a href="+code=tmpl" class="sref">tmpl1/a> = 1a href="+code=inst" class="sref">inst1/a>->1a href="+code=tmpl" class="sref">tmpl1/a>;v1 951/a>v1 961/a>        if (1a href="+code=crypto_is_dead" class="sref">crypto_is_dead1/a>(&1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>))v1 971/a>                return;v1 981/a>v1 991/a>        1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_flags" class="sref">cra_flags1/a> |= 1a href="+code=CRYPTO_ALG_DEAD" class="sref">CRYPTO_ALG_DEAD1/a>;v11001/a>        if (1a href="+code=hlist_unhashed" class="sref">hlist_unhashed1/a>(&1a href="+code=inst" class="sref">inst1/a>->1a href="+code=list" class="sref">list1/a>))v11011/a>                return;v11021/a>v11031/a>        if (!1a href="+code=tmpl" class="sref">tmpl1/a> || !1a href="+code=crypto_tmpl_get" class="sref">crypto_tmpl_get1/a>(1a href="+code=tmpl" class="sref">tmpl1/a>))v11041/a>                return;v11051/a>v11061/a>        1a href="+code=crypto_notify" class="sref">crypto_notify1/a>(1a href="+code=CRYPTO_MSG_ALG_UNREGISTER" class="sref">CRYPTO_MSG_ALG_UNREGISTER1/a>, &1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>);v11071/a>        1a href="+code=list_move" class="sref">list_move1/a>(&1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_list" class="sref">cra_list1/a>, 1a href="+code=list" class="sref">list1/a>);v11081/a>        1a href="+code=hlist_del" class="sref">hlist_del1/a>(&1a href="+code=inst" class="sref">inst1/a>->1a href="+code=list" class="sref">list1/a>);v11091/a>        1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_destroy" class="sref">cra_destroy1/a> = 1a href="+code=crypto_destroy_instanc." class="sref">crypto_destroy_instanc.1/a>;v11ion a>v11111/a>        1a href="+code=BUG_ON" class="sref">BUG_ON1/a>(!1a href="+code=list_empty" class="sref">list_empty1/a>(&1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_users" class="sref">cra_users1/a>));v11121/a>}v11131/a>v11141/a>void 1a href="+code=crypto_remove_spawns" class="sref">crypto_remove_spawns1/a>(struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>, struct11a href="+code=list_head" class="sref">list_head1/a> *1a href="+code=list" class="sref">list1/a>,v11151/a>                          struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=nalg" class="sref">nalg1/a>)v11161/a>{v11171/a>        1a href="+code=u32" class="sref">u321/a> 1a href="+code=new_typ." class="sref">new_typ.1/a> = (1a href="+code=nalg" class="sref">nalg1/a> ?: 1a href="+code=alg" class="sref">alg1/a>)->1a href="+code=cra_flags" class="sref">cra_flags1/a>;v11181/a>        struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a> *1a href="+code=spawn" class="sref">spawn1/a>, *1a href="+code=n" class="sref">n1/a>;v11191/a>        1a href="+code=LIST_HEAD" class="sref">LIST_HEAD1/a>(1a href="+code=secondary_spawns" class="sref">secondary_spawns1/a>);v11201/a>        struct11a href="+code=list_head" class="sref">list_head1/a> *1a href="+code=spawns" class="sref">spawns1/a>;v11211/a>        1a href="+code=LIST_HEAD" class="sref">LIST_HEAD1/a>(1a href="+code=stack" class="sref">stack1/a>);v11221/a>        1a href="+code=LIST_HEAD" class="sref">LIST_HEAD1/a>(1a href="+code=top" class="sref">top1/a>);v11231/a>v11241/a>        1a href="+code=spawns" class="sref">spawns1/a> = &1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_users" class="sref">cra_users1/a>;v11251/a>        1a href="+code=list_for_each_entry_safe" class="sref">list_for_each_entry_safe1/a>(1a href="+code=spawn" class="sref">spawn1/a>, 1a href="+code=n" class="sref">n1/a>, 1a href="+code=spawns" class="sref">spawns1/a>, 1a href="+code=list" class="sref">list1/a>) {v11261/a>                if ((1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_flags" class="sref">cra_flags1/a> ^ 1a href="+code=new_typ." class="sref">new_typ.1/a>) & 1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=mask" class="sref">mask1/a>)v11271/a>                        continue;v11281/a>v11291/a>                1a href="+code=list_move" class="sref">list_move1/a>(&1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=list" class="sref">list1/a>, &1a href="+code=top" class="sref">top1/a>);v11301/a>        }v11311/a>v11321/a>        1a href="+code=spawns" class="sref">spawns1/a> = &1a href="+code=top" class="sref">top1/a>;v11331/a>        do {v11341/a>                while (!1a href="+code=list_empty" class="sref">list_empty1/a>(1a href="+code=spawns" class="sref">spawns1/a>)) {v11351/a>                        struct11a href="+code=crypto_instanc." class="sref">crypto_instanc.1/a> *1a href="+code=inst" class="sref">inst1/a>;v11361/a>v11371/a>                        1a href="+code=spawn" class="sref">spawn1/a> = 1a href="+code=list_first_entry" class="sref">list_first_entry1/a>(1a href="+code=spawns" class="sref">spawns1/a>, struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a>,v11381/a>                                                 1a href="+code=list" class="sref">list1/a>);v11391/a>                        1a href="+code=inst" class="sref">inst1/a> = 1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=inst" class="sref">inst1/a>;v114on a>v11411/a>                        1a href="+code=BUG_ON" class="sref">BUG_ON1/a>(&1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a> == 1a href="+code=alg" class="sref">alg1/a>);v11421/a>v11431/a>                        1a href="+code=list_move" class="sref">list_move1/a>(&1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=list" class="sref">list1/a>, &1a href="+code=stack" class="sref">stack1/a>);v11441/a>v11451/a>                        if (&1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a> == 1a href="+code=nalg" class="sref">nalg1/a>)v11461/a>                                break;v11471/a>v11481/a>                        1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=alg" class="sref">alg1/a> = 1a href="+code=NULL" class="sref">NULL1/a>;v11491/a>                        1a href="+code=spawns" class="sref">spawns1/a> = &1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_users" class="sref">cra_users1/a>;v11501/a>                }v11511/a>        } while ((1a href="+code=spawns" class="sref">spawns1/a> = 1a href="+code=crypto_more_spawns" class="sref">crypto_more_spawns1/a>(1a href="+code=alg" class="sref">alg1/a>, &1a href="+code=stack" class="sref">stack1/a>, &1a href="+code=top" class="sref">top1/a>,v11521/a>                                              &1a href="+code=secondary_spawns" class="sref">secondary_spawns1/a>)));v11531/a>v11541/a>        1a href="+code=list_for_each_entry_safe" class="sref">list_for_each_entry_safe1/a>(1a href="+code=spawn" class="sref">spawn1/a>, 1a href="+code=n" class="sref">n1/a>, &1a href="+code=secondary_spawns" class="sref">secondary_spawns1/a>, 1a href="+code=list" class="sref">list1/a>) {v11551/a>                if (1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=alg" class="sref">alg1/a>)v11561/a>                        1a href="+code=list_move" class="sref">list_move1/a>(&1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=list" class="sref">list1/a>, &1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_users" class="sref">cra_users1/a>);v11571/a>                elsev11581/a>                        1a href="+code=crypto_remove_spawn" class="sref">crypto_remove_spawn1/a>(1a href="+code=spawn" class="sref">spawn1/a>, 1a href="+code=list" class="sref">list1/a>);v11591/a>        }v11601/a>}v11611/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_remove_spawns" class="sref">crypto_remove_spawns1/a>);v11621/a>v11631/a>static1struct11a href="+code=crypto_larval" class="sref">crypto_larval1/a> *1a href="+code=__crypto_register_alg" class="sref">__crypto_register_alg1/a>(struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>)v11641/a>{v11651/a>        struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=q" class="sref">q1/a>;v11661/a>        struct11a href="+code=crypto_larval" class="sref">crypto_larval1/a> *1a href="+code=larval" class="sref">larval1/a>;v11671/a>        int11a href="+code=ret" class="sref">ret1/a> = -1a href="+code=EAGAIN" class="sref">EAGAIN1/a>;v11681/a>v11691/a>        if (1a href="+code=crypto_is_dead" class="sref">crypto_is_dead1/a>(1a href="+code=alg" class="sref">alg1/a>))v11701/a>                goto11a href="+code=err" class="sref">err1/a>;v11711/a>v11721/a>        1a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD1/a>(&1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_users" class="sref">cra_users1/a>);v11731/a>v11741/a>        1spa= class="comment">/* No cheating! */1/spa="v11751/a>        1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_flags" class="sref">cra_flags1/a> &= ~1a href="+code=CRYPTO_ALG_TESTED" class="sref">CRYPTO_ALG_TESTED1/a>;v11761/a>v11771/a>        1a href="+code=ret" class="sref">ret1/a> = -1a href="+code=EEXIST" class="sref">EEXIST1/a>;v11781/a>v11791/a>        1a href="+code=atomic_set" class="sref">atomic_set1/a>(&1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_refcnt" class="sref">cra_refcnt1/a>, 1);v11801/a>        1a href="+code=list_for_each_entry" class="sref">list_for_each_entry1/a>(1a href="+code=q" class="sref">q1/a>, &1a href="+code=crypto_alg_list" class="sref">crypto_alg_list1/a>, 1a href="+code=cra_list" class="sref">cra_list1/a>) {v11811/a>                if (1a href="+code=q" class="sref">q1/a> == 1a href="+code=alg" class="sref">alg1/a>)v11821/a>                        goto11a href="+code=err" class="sref">err1/a>;v11831/a>v11841/a>                if (1a href="+code=crypto_is_moribund" class="sref">crypto_is_moribund1/a>(1a href="+code=q" class="sref">q1/a>))v11851/a>                        continue;v11861/a>v11871/a>                if (1a href="+code=crypto_is_larval" class="sref">crypto_is_larval1/a>(1a href="+code=q" class="sref">q1/a>)) {v11881/a>                        if (!1a href="+code=strcmp" class="sref">strcmp1/a>(1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>, 1a href="+code=q" class="sref">q1/a>->1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>))v11891/a>                                goto11a href="+code=err" class="sref">err1/a>;v11901/a>                        continue;v11911/a>                }v11921/a>v11931/a>                if (!1a href="+code=strcmp" class="sref">strcmp1/a>(1a href="+code=q" class="sref">q1/a>->1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>, 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_nam." class="sref">cra_nam.1/a>) ||v11941/a>                    !1a href="+code=strcmp" class="sref">strcmp1/a>(1a href="+code=q" class="sref">q1/a>->1a href="+code=cra_nam." class="sref">cra_nam.1/a>, 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>))v11951/a>                        goto11a href="+code=err" class="sref">err1/a>;v11961/a>        }v11971/a>v11981/a>        1a href="+code=larval" class="sref">larval1/a> = 1a href="+code=crypto_larval_alloc" class="sref">crypto_larval_alloc1/a>(1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_nam." class="sref">cra_nam.1/a>,v11991/a>                                     1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_flags" class="sref">cra_flags1/a> | 1a href="+code=CRYPTO_ALG_TESTED" class="sref">CRYPTO_ALG_TESTED1/a>, 0);v12001/a>        if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=larval" class="sref">larval1/a>))v12011/a>                goto11a href="+code=out" class="sref">out1/a>;v12021/a>v12031/a>        1a href="+code=ret" class="sref">ret1/a> = -1a href="+code=ENOENT" class="sref">ENOENT1/a>;v12041/a>        1a href="+code=larval" class="sref">larval1/a>->1a href="+code=adult" class="sref">adult1/a> = 1a href="+code=crypto_mod_get" class="sref">crypto_mod_get1/a>(1a href="+code=alg" class="sref">alg1/a>);v12051/a>        if (!1a href="+code=larval" class="sref">larval1/a>->1a href="+code=adult" class="sref">adult1/a>)v12061/a>                goto11a href="+code=free_larval" class="sref">free_larval1/a>;v12071/a>v12081/a>        1a href="+code=atomic_set" class="sref">atomic_set1/a>(&1a href="+code=larval" class="sref">larval1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_refcnt" class="sref">cra_refcnt1/a>, 1);v12091/a>        1a href="+code=memcpy" class="sref">memcpy1/a>(1a href="+code=larval" class="sref">larval1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>, 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>,v12101/a>               1a href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME1/a>);v12111/a>        1a href="+code=larval" class="sref">larval1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_priority" class="sref">cra_priority1/a> = 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_priority" class="sref">cra_priority1/a>;v12121/a>v12131/a>        1a href="+code=list_add" class="sref">list_add1/a>(&1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_list" class="sref">cra_list1/a>, &1a href="+code=crypto_alg_list" class="sref">crypto_alg_list1/a>);v12141/a>        1a href="+code=list_add" class="sref">list_add1/a>(&1a href="+code=larval" class="sref">larval1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_list" class="sref">cra_list1/a>, &1a href="+code=crypto_alg_list" class="sref">crypto_alg_list1/a>);v12151/a>v12161/a>1a href="+code=out" class="sref">out1/a>:v12171/a>        return 1a href="+code=larval" class="sref">larval1/a>;v12181/a>v12191/a>1a href="+code=free_larval" class="sref">free_larval1/a>:v12201/a>        1a href="+code=kfree" class="sref">kfree1/a>(1a href="+code=larval" class="sref">larval1/a>);v12211/a>1a href="+code=err" class="sref">err1/a>:v12221/a>        1a href="+code=larval" class="sref">larval1/a> = 1a href="+code=ERR_PTR" class="sref">ERR_PTR1/a>(1a href="+code=ret" class="sref">ret1/a>);v12231/a>        goto11a href="+code=out" class="sref">out1/a>;v12241/a>}v12251/a>v12261/a>void 1a href="+code=crypto_alg_tested" class="sref">crypto_alg_tested1/a>(const char *1a href="+code=nam." class="sref">nam.1/a>, int11a href="+code=err" class="sref">err1/a>)v12271/a>{v12281/a>        struct11a href="+code=crypto_larval" class="sref">crypto_larval1/a> *1a href="+code=test" class="sref">test1/a>;v12291/a>        struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>;v12301/a>        struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=q" class="sref">q1/a>;v12311/a>        1a href="+code=LIST_HEAD" class="sref">LIST_HEAD1/a>(1a href="+code=list" class="sref">list1/a>);v12321/a>v12331/a>        1a href="+code=down_writ." class="sref">down_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v12341/a>        1a href="+code=list_for_each_entry" class="sref">list_for_each_entry1/a>(1a href="+code=q" class="sref">q1/a>, &1a href="+code=crypto_alg_list" class="sref">crypto_alg_list1/a>, 1a href="+code=cra_list" class="sref">cra_list1/a>) {v12351/a>                if (1a href="+code=crypto_is_moribund" class="sref">crypto_is_moribund1/a>(1a href="+code=q" class="sref">q1/a>) || !1a href="+code=crypto_is_larval" class="sref">crypto_is_larval1/a>(1a href="+code=q" class="sref">q1/a>))v12361/a>                        continue;v12371/a>v12381/a>                1a href="+code=test" class="sref">test1/a> = (struct11a href="+code=crypto_larval" class="sref">crypto_larval1/a> *)1a href="+code=q" class="sref">q1/a>;v12391/a>v12401/a>                if (!1a href="+code=strcmp" class="sref">strcmp1/a>(1a href="+code=q" class="sref">q1/a>->1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>, 1a href="+code=nam." class="sref">nam.1/a>))v12411/a>                        goto11a href="+code=found" class="sref">found1/a>;v12421/a>        }v12431/a>v12441/a>        1a href="+code=printk" class="sref">printk1/a>(1a href="+code=KERN_ERR" class="sref">KERN_ERR1/a> 1spa= class="string">"alg: Unexpected test result for %s: %d\n"1/spa=", 1a href="+code=nam." class="sref">nam.1/a>, 1a href="+code=err" class="sref">err1/a>);v12451/a>        goto11a href="+code=unlock" class="sref">unlock1/a>;v12461/a>v12471/a>1a href="+code=found" class="sref">found1/a>:v12481/a>        1a href="+code=q" class="sref">q1/a>->1a href="+code=cra_flags" class="sref">cra_flags1/a> |= 1a href="+code=CRYPTO_ALG_DEAD" class="sref">CRYPTO_ALG_DEAD1/a>;v12491/a>        1a href="+code=alg" class="sref">alg1/a> = 1a href="+code=test" class="sref">test1/a>->1a href="+code=adult" class="sref">adult1/a>;v12501/a>        if (1a href="+code=err" class="sref">err1/a> || 1a href="+code=list_empty" class="sref">list_empty1/a>(&1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_list" class="sref">cra_list1/a>))v12511/a>                goto11a href="+code=complete" class="sref">complete1/a>;v12521/a>v12531/a>        1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_flags" class="sref">cra_flags1/a> |= 1a href="+code=CRYPTO_ALG_TESTED" class="sref">CRYPTO_ALG_TESTED1/a>;v12541/a>v12551/a>        1a href="+code=list_for_each_entry" class="sref">list_for_each_entry1/a>(1a href="+code=q" class="sref">q1/a>, &1a href="+code=crypto_alg_list" class="sref">crypto_alg_list1/a>, 1a href="+code=cra_list" class="sref">cra_list1/a>) {v12561/a>                if (1a href="+code=q" class="sref">q1/a> == 1a href="+code=alg" class="sref">alg1/a>)v12571/a>                        continue;v12581/a>v12591/a>                if (1a href="+code=crypto_is_moribund" class="sref">crypto_is_moribund1/a>(1a href="+code=q" class="sref">q1/a>))v12601/a>                        continue;v12611/a>v12621/a>                if (1a href="+code=crypto_is_larval" class="sref">crypto_is_larval1/a>(1a href="+code=q" class="sref">q1/a>)) {v12631/a>                        struct11a href="+code=crypto_larval" class="sref">crypto_larval1/a> *1a href="+code=larval" class="sref">larval1/a> = (void *)1a href="+code=q" class="sref">q1/a>;v12641/a>v12651/a>                        1spa= class="comment">/*1/spa="v12661/a>1spa= class="comment">                         * Check to1see if either our generic nam. or1/spa="v12671/a>1spa= class="comment">                         * specific nam. ca= satisfy the nam. requested1/spa="v12681/a>1spa= class="comment">                         * by the larval entry q.1/spa="v12691/a>1spa= class="comment">                         */1/spa="v12701/a>                        if (1a href="+code=strcmp" class="sref">strcmp1/a>(1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_nam." class="sref">cra_nam.1/a>, 1a href="+code=q" class="sref">q1/a>->1a href="+code=cra_nam." class="sref">cra_nam.1/a>) &&v12711/a>                            1a href="+code=strcmp" class="sref">strcmp1/a>(1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>, 1a href="+code=q" class="sref">q1/a>->1a href="+code=cra_nam." class="sref">cra_nam.1/a>))v12721/a>                                continue;v12731/a>v12741/a>                        if (1a href="+code=larval" class="sref">larval1/a>->1a href="+code=adult" class="sref">adult1/a>)v12751/a>                                continue;v12761/a>                        if ((1a href="+code=q" class="sref">q1/a>->1a href="+code=cra_flags" class="sref">cra_flags1/a> ^ 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_flags" class="sref">cra_flags1/a>) & 1a href="+code=larval" class="sref">larval1/a>->1a href="+code=mask" class="sref">mask1/a>)v12771/a>                                continue;v12781/a>                        if (!1a href="+code=crypto_mod_get" class="sref">crypto_mod_get1/a>(1a href="+code=alg" class="sref">alg1/a>))v12791/a>                                continue;v128on a>v12811/a>                        1a href="+code=larval" class="sref">larval1/a>->1a href="+code=adult" class="sref">adult1/a> = 1a href="+code=alg" class="sref">alg1/a>;v12821/a>                        continue;v12831/a>                }v12841/a>v12851/a>                if (1a href="+code=strcmp" class="sref">strcmp1/a>(1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_nam." class="sref">cra_nam.1/a>, 1a href="+code=q" class="sref">q1/a>->1a href="+code=cra_nam." class="sref">cra_nam.1/a>))v12861/a>                        continue;v12871/a>v12881/a>                if (1a href="+code=strcmp" class="sref">strcmp1/a>(1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>, 1a href="+code=q" class="sref">q1/a>->1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>) &&v12891/a>                    1a href="+code=q" class="sref">q1/a>->1a href="+code=cra_priority" class="sref">cra_priority1/a> > 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_priority" class="sref">cra_priority1/a>)v12901/a>                        continue;v12911/a>v12921/a>                1a href="+code=crypto_remove_spawns" class="sref">crypto_remove_spawns1/a>(1a href="+code=q" class="sref">q1/a>, &1a href="+code=list" class="sref">list1/a>, 1a href="+code=alg" class="sref">alg1/a>);v12931/a>        }v12941/a>v12951/a>1a href="+code=complete" class="sref">complete1/a>:v12961/a>        1a href="+code=complete_all" class="sref">complete_all1/a>(&1a href="+code=test" class="sref">test1/a>->1a href="+code=completion" class="sref">completion1/a>);v12971/a>v12981/a>1a href="+code=unlock" class="sref">unlock1/a>:v12991/a>        1a href="+code=up_writ." class="sref">up_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v130on a>v13011/a>        1a href="+code=crypto_remove_final" class="sref">crypto_remove_final1/a>(&1a href="+code=list" class="sref">list1/a>);v13021/a>}v13031/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_alg_tested" class="sref">crypto_alg_tested1/a>);v13041/a>v13051/a>void 1a href="+code=crypto_remove_final" class="sref">crypto_remove_final1/a>(struct11a href="+code=list_head" class="sref">list_head1/a> *1a href="+code=list" class="sref">list1/a>)v13061/a>{v13071/a>        struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>;v13081/a>        struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=n" class="sref">n1/a>;v13091/a>v13101/a>        1a href="+code=list_for_each_entry_safe" class="sref">list_for_each_entry_safe1/a>(1a href="+code=alg" class="sref">alg1/a>, 1a href="+code=n" class="sref">n1/a>, 1a href="+code=list" class="sref">list1/a>, 1a href="+code=cra_list" class="sref">cra_list1/a>) {v13111/a>                1a href="+code=list_del_init" class="sref">list_del_init1/a>(&1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_list" class="sref">cra_list1/a>);v13121/a>                1a href="+code=crypto_alg_put" class="sref">crypto_alg_put1/a>(1a href="+code=alg" class="sref">alg1/a>);v13131/a>        }v13141/a>}v13151/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_remove_final" class="sref">crypto_remove_final1/a>);v13161/a>v13171/a>static1void 1a href="+code=crypto_wait_for_test" class="sref">crypto_wait_for_test1/a>(struct11a href="+code=crypto_larval" class="sref">crypto_larval1/a> *1a href="+code=larval" class="sref">larval1/a>)v13181/a>{v13191/a>        int11a href="+code=err" class="sref">err1/a>;v132on a>v13211/a>        1a href="+code=err" class="sref">err1/a> = 1a href="+code=crypto_probing_notify" class="sref">crypto_probing_notify1/a>(1a href="+code=CRYPTO_MSG_ALG_REGISTER" class="sref">CRYPTO_MSG_ALG_REGISTER1/a>, 1a href="+code=larval" class="sref">larval1/a>->1a href="+code=adult" class="sref">adult1/a>);v13221/a>        if (1a href="+code=err" class="sref">err1/a> != 1a href="+code=NOTIFY_STOP" class="sref">NOTIFY_STOP1/a>) {v13231/a>                if (1a href="+code=WARN_ON" class="sref">WARN_ON1/a>(1a href="+code=err" class="sref">err1/a> != 1a href="+code=NOTIFY_DONE" class="sref">NOTIFY_DONE1/a>))v13241/a>                        goto11a href="+code=out" class="sref">out1/a>;v13251/a>                1a href="+code=crypto_alg_tested" class="sref">crypto_alg_tested1/a>(1a href="+code=larval" class="sref">larval1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>, 0);v13261/a>        }v13271/a>v13281/a>        1a href="+code=err" class="sref">err1/a> = 1a href="+code=wait_for_completion_interruptibl." class="sref">wait_for_completion_interruptibl.1/a>(&1a href="+code=larval" class="sref">larval1/a>->1a href="+code=completion" class="sref">completion1/a>);v13291/a>        1a href="+code=WARN_ON" class="sref">WARN_ON1/a>(1a href="+code=err" class="sref">err1/a>);v133on a>v13311/a>1a href="+code=out" class="sref">out1/a>:v13321/a>        1a href="+code=crypto_larval_kill" class="sref">crypto_larval_kill1/a>(&1a href="+code=larval" class="sref">larval1/a>->1a href="+code=alg" class="sref">alg1/a>);v13331/a>}v13341/a>v13351/a>int11a href="+code=crypto_register_alg" class="sref">crypto_register_alg1/a>(struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>)v13361/a>{v13371/a>        struct11a href="+code=crypto_larval" class="sref">crypto_larval1/a> *1a href="+code=larval" class="sref">larval1/a>;v13381/a>        int11a href="+code=err" class="sref">err1/a>;v13391/a>v13401/a>        1a href="+code=err" class="sref">err1/a> = 1a href="+code=crypto_check_alg" class="sref">crypto_check_alg1/a>(1a href="+code=alg" class="sref">alg1/a>);v13411/a>        if (1a href="+code=err" class="sref">err1/a>)v13421/a>                return 1a href="+code=err" class="sref">err1/a>;v13431/a>v13441/a>        1a href="+code=down_writ." class="sref">down_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v13451/a>        1a href="+code=larval" class="sref">larval1/a> = 1a href="+code=__crypto_register_alg" class="sref">__crypto_register_alg1/a>(1a href="+code=alg" class="sref">alg1/a>);v13461/a>        1a href="+code=up_writ." class="sref">up_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v13471/a>v13481/a>        if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=larval" class="sref">larval1/a>))v13491/a>                return 1a href="+code=PTR_ERR" class="sref">PTR_ERR1/a>(1a href="+code=larval" class="sref">larval1/a>);v135on a>v13511/a>        1a href="+code=crypto_wait_for_test" class="sref">crypto_wait_for_test1/a>(1a href="+code=larval" class="sref">larval1/a>);v13521/a>        return 0;v13531/a>}v13541/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_register_alg" class="sref">crypto_register_alg1/a>);v13551/a>v13561/a>static1int11a href="+code=crypto_remove_alg" class="sref">crypto_remove_alg1/a>(struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>, struct11a href="+code=list_head" class="sref">list_head1/a> *1a href="+code=list" class="sref">list1/a>)v13571/a>{v13581/a>        if (1a href="+code=unlikely" class="sref">unlikely1/a>(1a href="+code=list_empty" class="sref">list_empty1/a>(&1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_list" class="sref">cra_list1/a>)))v13591/a>                return -1a href="+code=ENOENT" class="sref">ENOENT1/a>;v136on a>v13611/a>        1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_flags" class="sref">cra_flags1/a> |= 1a href="+code=CRYPTO_ALG_DEAD" class="sref">CRYPTO_ALG_DEAD1/a>;v13621/a>v13631/a>        1a href="+code=crypto_notify" class="sref">crypto_notify1/a>(1a href="+code=CRYPTO_MSG_ALG_UNREGISTER" class="sref">CRYPTO_MSG_ALG_UNREGISTER1/a>, 1a href="+code=alg" class="sref">alg1/a>);v13641/a>        1a href="+code=list_del_init" class="sref">list_del_init1/a>(&1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_list" class="sref">cra_list1/a>);v13651/a>        1a href="+code=crypto_remove_spawns" class="sref">crypto_remove_spawns1/a>(1a href="+code=alg" class="sref">alg1/a>, 1a href="+code=list" class="sref">list1/a>, 1a href="+code=NULL" class="sref">NULL1/a>);v13661/a>v13671/a>        return 0;v13681/a>}v13691/a>v13701/a>int11a href="+code=crypto_unregister_alg" class="sref">crypto_unregister_alg1/a>(struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>)v13711/a>{v13721/a>        int11a href="+code=ret" class="sref">ret1/a>;v13731/a>        1a href="+code=LIST_HEAD" class="sref">LIST_HEAD1/a>(1a href="+code=list" class="sref">list1/a>);v13741/a>v13751/a>        1a href="+code=down_writ." class="sref">down_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v13761/a>        1a href="+code=ret" class="sref">ret1/a> = 1a href="+code=crypto_remove_alg" class="sref">crypto_remove_alg1/a>(1a href="+code=alg" class="sref">alg1/a>, &1a href="+code=list" class="sref">list1/a>);v13771/a>        1a href="+code=up_writ." class="sref">up_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v13781/a>v13791/a>        if (1a href="+code=ret" class="sref">ret1/a>)v13801/a>                return 1a href="+code=ret" class="sref">ret1/a>;v13811/a>v13821/a>        1a href="+code=BUG_ON" class="sref">BUG_ON1/a>(1a href="+code=atomic_read" class="sref">atomic_read1/a>(&1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_refcnt" class="sref">cra_refcnt1/a>) != 1);v13831/a>        if (1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_destroy" class="sref">cra_destroy1/a>)v13841/a>                1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_destroy" class="sref">cra_destroy1/a>(1a href="+code=alg" class="sref">alg1/a>);v13851/a>v13861/a>        1a href="+code=crypto_remove_final" class="sref">crypto_remove_final1/a>(&1a href="+code=list" class="sref">list1/a>);v13871/a>        return 0;v13881/a>}v13891/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_unregister_alg" class="sref">crypto_unregister_alg1/a>);v139on a>v13911/a>int11a href="+code=crypto_register_algs" class="sref">crypto_register_algs1/a>(struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=algs" class="sref">algs1/a>, int11a href="+code=count" class="sref">count1/a>)v13921/a>{v13931/a>        int11a href="+code=i" class="sref">i1/a>, 1a href="+code=ret" class="sref">ret1/a>;v13941/a>v13951/a>        for (1a href="+code=i" class="sref">i1/a> = 0; 1a href="+code=i" class="sref">i1/a> < 1a href="+code=count" class="sref">count1/a>; 1a href="+code=i" class="sref">i1/a>++) {v13961/a>                1a href="+code=ret" class="sref">ret1/a> = 1a href="+code=crypto_register_alg" class="sref">crypto_register_alg1/a>(&1a href="+code=algs" class="sref">algs1/a>[1a href="+code=i" class="sref">i1/a>]);v13971/a>                if (1a href="+code=ret" class="sref">ret1/a>)v13981/a>                        goto11a href="+code=err" class="sref">err1/a>;v13991/a>        }v140on a>v14011/a>        return 0;v14021/a>v14031/a>1a href="+code=err" class="sref">err1/a>:v14041/a>        for (--1a href="+code=i" class="sref">i1/a>; 1a href="+code=i" class="sref">i1/a> >= 0; --1a href="+code=i" class="sref">i1/a>)v14051/a>                1a href="+code=crypto_unregister_alg" class="sref">crypto_unregister_alg1/a>(&1a href="+code=algs" class="sref">algs1/a>[1a href="+code=i" class="sref">i1/a>]);v14061/a>v14071/a>        return 1a href="+code=ret" class="sref">ret1/a>;v14081/a>}v14091/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_register_algs" class="sref">crypto_register_algs1/a>);v141on a>v14111/a>int11a href="+code=crypto_unregister_algs" class="sref">crypto_unregister_algs1/a>(struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=algs" class="sref">algs1/a>, int11a href="+code=count" class="sref">count1/a>)v14121/a>{v14131/a>        int11a href="+code=i" class="sref">i1/a>, 1a href="+code=ret" class="sref">ret1/a>;v14141/a>v14151/a>        for (1a href="+code=i" class="sref">i1/a> = 0; 1a href="+code=i" class="sref">i1/a> < 1a href="+code=count" class="sref">count1/a>; 1a href="+code=i" class="sref">i1/a>++) {v14161/a>                1a href="+code=ret" class="sref">ret1/a> = 1a href="+code=crypto_unregister_alg" class="sref">crypto_unregister_alg1/a>(&1a href="+code=algs" class="sref">algs1/a>[1a href="+code=i" class="sref">i1/a>]);v14171/a>                if (1a href="+code=ret" class="sref">ret1/a>)v14181/a>                        1a href="+code=pr_err" class="sref">pr_err1/a>(1spa= class="string">"Failed to unregister %s %s: %d\n"1/spa=",v14191/a>                               1a href="+code=algs" class="sref">algs1/a>[1a href="+code=i" class="sref">i1/a>].1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>, 1a href="+code=algs" class="sref">algs1/a>[1a href="+code=i" class="sref">i1/a>].1a href="+code=cra_nam." class="sref">cra_nam.1/a>, 1a href="+code=ret" class="sref">ret1/a>);v14201/a>        }v14211/a>v14221/a>        return 0;v14231/a>}v14241/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_unregister_algs" class="sref">crypto_unregister_algs1/a>);v14251/a>v14261/a>int11a href="+code=crypto_register_template" class="sref">crypto_register_template1/a>(struct11a href="+code=crypto_template" class="sref">crypto_template1/a> *1a href="+code=tmpl" class="sref">tmpl1/a>)v14271/a>{v14281/a>        struct11a href="+code=crypto_template" class="sref">crypto_template1/a> *1a href="+code=q" class="sref">q1/a>;v14291/a>        int11a href="+code=err" class="sref">err1/a> = -1a href="+code=EEXIST" class="sref">EEXIST1/a>;v143on a>v14311/a>        1a href="+code=down_writ." class="sref">down_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v14321/a>v14331/a>        1a href="+code=list_for_each_entry" class="sref">list_for_each_entry1/a>(1a href="+code=q" class="sref">q1/a>, &1a href="+code=crypto_template_list" class="sref">crypto_template_list1/a>, 1a href="+code=list" class="sref">list1/a>) {v14341/a>                if (1a href="+code=q" class="sref">q1/a> == 1a href="+code=tmpl" class="sref">tmpl1/a>)v14351/a>                        goto11a href="+code=out" class="sref">out1/a>;v14361/a>        }v14371/a>v14381/a>        1a href="+code=list_add" class="sref">list_add1/a>(&1a href="+code=tmpl" class="sref">tmpl1/a>->1a href="+code=list" class="sref">list1/a>, &1a href="+code=crypto_template_list" class="sref">crypto_template_list1/a>);v14391/a>        1a href="+code=crypto_notify" class="sref">crypto_notify1/a>(1a href="+code=CRYPTO_MSG_TMPL_REGISTER" class="sref">CRYPTO_MSG_TMPL_REGISTER1/a>, 1a href="+code=tmpl" class="sref">tmpl1/a>);v14401/a>        1a href="+code=err" class="sref">err1/a> = 0;v14411/a>1a href="+code=out" class="sref">out1/a>:v14421/a>        1a href="+code=up_writ." class="sref">up_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v14431/a>        return 1a href="+code=err" class="sref">err1/a>;v14441/a>}v14451/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_register_template" class="sref">crypto_register_template1/a>);v14461/a>v14471/a>void 1a href="+code=crypto_unregister_template" class="sref">crypto_unregister_template1/a>(struct11a href="+code=crypto_template" class="sref">crypto_template1/a> *1a href="+code=tmpl" class="sref">tmpl1/a>)v14481/a>{v14491/a>        struct11a href="+code=crypto_instance" class="sref">crypto_instance1/a> *1a href="+code=inst" class="sref">inst1/a>;v14501/a>        struct11a href="+code=hlist_node" class="sref">hlist_node1/a> *1a href="+code=p" class="sref">p1/a>, *1a href="+code=n" class="sref">n1/a>;v14511/a>        struct11a href="+code=hlist_head" class="sref">hlist_head1/a> *1a href="+code=list" class="sref">list1/a>;v14521/a>        1a href="+code=LIST_HEAD" class="sref">LIST_HEAD1/a>(1a href="+code=users" class="sref">users1/a>);v14531/a>v14541/a>        1a href="+code=down_writ." class="sref">down_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v14551/a>v14561/a>        1a href="+code=BUG_ON" class="sref">BUG_ON1/a>(1a href="+code=list_empty" class="sref">list_empty1/a>(&1a href="+code=tmpl" class="sref">tmpl1/a>->1a href="+code=list" class="sref">list1/a>));v14571/a>        1a href="+code=list_del_init" class="sref">list_del_init1/a>(&1a href="+code=tmpl" class="sref">tmpl1/a>->1a href="+code=list" class="sref">list1/a>);v14581/a>v14591/a>        1a href="+code=list" class="sref">list1/a> = &1a href="+code=tmpl" class="sref">tmpl1/a>->1a href="+code=instances" class="sref">instances1/a>;v14601/a>        1a href="+code=hlist_for_each_entry" class="sref">hlist_for_each_entry1/a>(1a href="+code=inst" class="sref">inst1/a>, 1a href="+code=p" class="sref">p1/a>, 1a href="+code=list" class="sref">list1/a>, 1a href="+code=list" class="sref">list1/a>) {v14611/a>                int11a href="+code=err" class="sref">err1/a> = 1a href="+code=crypto_remove_alg" class="sref">crypto_remove_alg1/a>(&1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>, &1a href="+code=users" class="sref">users1/a>);v14621/a>                1a href="+code=BUG_ON" class="sref">BUG_ON1/a>(1a href="+code=err" class="sref">err1/a>);v14631/a>        }v14641/a>v14651/a>        1a href="+code=crypto_notify" class="sref">crypto_notify1/a>(1a href="+code=CRYPTO_MSG_TMPL_UNREGISTER" class="sref">CRYPTO_MSG_TMPL_UNREGISTER1/a>, 1a href="+code=tmpl" class="sref">tmpl1/a>);v14661/a>v14671/a>        1a href="+code=up_writ." class="sref">up_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v14681/a>v14691/a>        1a href="+code=hlist_for_each_entry_safe" class="sref">hlist_for_each_entry_safe1/a>(1a href="+code=inst" class="sref">inst1/a>, 1a href="+code=p" class="sref">p1/a>, 1a href="+code=n" class="sref">n1/a>, 1a href="+code=list" class="sref">list1/a>, 1a href="+code=list" class="sref">list1/a>) {v14701/a>                1a href="+code=BUG_ON" class="sref">BUG_ON1/a>(1a href="+code=atomic_read" class="sref">atomic_read1/a>(&1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_refcnt" class="sref">cra_refcnt1/a>) != 1);v14711/a>                1a href="+code=tmpl" class="sref">tmpl1/a>->1a href="+code=free" class="sref">free1/a>(1a href="+code=inst" class="sref">inst1/a>);v14721/a>        }v14731/a>        1a href="+code=crypto_remove_final" class="sref">crypto_remove_final1/a>(&1a href="+code=users" class="sref">users1/a>);v14741/a>}v14751/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_unregister_template" class="sref">crypto_unregister_template1/a>);v14761/a>v14771/a>static1struct11a href="+code=crypto_template" class="sref">crypto_template1/a> *1a href="+code=__crypto_lookup_template" class="sref">__crypto_lookup_template1/a>(const char *1a href="+code=nam." class="sref">nam.1/a>)v14781/a>{v14791/a>        struct11a href="+code=crypto_template" class="sref">crypto_template1/a> *1a href="+code=q" class="sref">q1/a>, *1a href="+code=tmpl" class="sref">tmpl1/a> = 1a href="+code=NULL" class="sref">NULL1/a>;v148on a>v14811/a>        1a href="+code=down_read" class="sref">down_read1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v14821/a>        1a href="+code=list_for_each_entry" class="sref">list_for_each_entry1/a>(1a href="+code=q" class="sref">q1/a>, &1a href="+code=crypto_template_list" class="sref">crypto_template_list1/a>, 1a href="+code=list" class="sref">list1/a>) {v14831/a>                if (1a href="+code=strcmp" class="sref">strcmp1/a>(1a href="+code=q" class="sref">q1/a>->1a href="+code=nam." class="sref">nam.1/a>, 1a href="+code=nam." class="sref">nam.1/a>))v14841/a>                        continue;v14851/a>                if (1a href="+code=unlikely" class="sref">unlikely1/a>(!1a href="+code=crypto_tmpl_get" class="sref">crypto_tmpl_get1/a>(1a href="+code=q" class="sref">q1/a>)))v14861/a>                        continue;v14871/a>v14881/a>                1a href="+code=tmpl" class="sref">tmpl1/a> = 1a href="+code=q" class="sref">q1/a>;v14891/a>                break;v14901/a>        }v14911/a>        1a href="+code=up_read" class="sref">up_read1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v14921/a>v14931/a>        return 1a href="+code=tmpl" class="sref">tmpl1/a>;v14941/a>}v14951/a>v14961/a>struct11a href="+code=crypto_template" class="sref">crypto_template1/a> *1a href="+code=crypto_lookup_template" class="sref">crypto_lookup_template1/a>(const char *1a href="+code=nam." class="sref">nam.1/a>)v14971/a>{v14981/a>        return 1a href="+code=try_then_request_modul." class="sref">try_then_request_modul.1/a>(1a href="+code=__crypto_lookup_template" class="sref">__crypto_lookup_template1/a>(1a href="+code=nam." class="sref">nam.1/a>), 1a href="+code=nam." class="sref">nam.1/a>);v14991/a>}v150on a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_lookup_template" class="sref">crypto_lookup_template1/a>);v15011/a>v15021/a>int11a href="+code=crypto_register_instance" class="sref">crypto_register_instance1/a>(struct11a href="+code=crypto_template" class="sref">crypto_template1/a> *1a href="+code=tmpl" class="sref">tmpl1/a>,v15031/a>                             struct11a href="+code=crypto_instance" class="sref">crypto_instance1/a> *1a href="+code=inst" class="sref">inst1/a>)v15041/a>{v15051/a>        struct11a href="+code=crypto_larval" class="sref">crypto_larval1/a> *1a href="+code=larval" class="sref">larval1/a>;v15061/a>        int11a href="+code=err" class="sref">err1/a>;v15071/a>v15081/a>        1a href="+code=err" class="sref">err1/a> = 1a href="+code=crypto_check_alg" class="sref">crypto_check_alg1/a>(&1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>);v15091/a>        if (1a href="+code=err" class="sref">err1/a>)v15101/a>                goto11a href="+code=err" class="sref">err1/a>;v15111/a>v15121/a>        1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_modul." class="sref">cra_modul.1/a> = 1a href="+code=tmpl" class="sref">tmpl1/a>->1a href="+code=modul." class="sref">modul.1/a>;v15131/a>        1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_flags" class="sref">cra_flags1/a> |= 1a href="+code=CRYPTO_ALG_INSTANCE" class="sref">CRYPTO_ALG_INSTANCE1/a>;v15141/a>v15151/a>        1a href="+code=down_writ." class="sref">down_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v15161/a>v15171/a>        1a href="+code=larval" class="sref">larval1/a> = 1a href="+code=__crypto_register_alg" class="sref">__crypto_register_alg1/a>(&1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>);v15181/a>        if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=larval" class="sref">larval1/a>))v15191/a>                goto11a href="+code=unlock" class="sref">unlock1/a>;v152on a>v15211/a>        1a href="+code=hlist_add_head" class="sref">hlist_add_head1/a>(&1a href="+code=inst" class="sref">inst1/a>->1a href="+code=list" class="sref">list1/a>, &1a href="+code=tmpl" class="sref">tmpl1/a>->1a href="+code=instances" class="sref">instances1/a>);v15221/a>        1a href="+code=inst" class="sref">inst1/a>->1a href="+code=tmpl" class="sref">tmpl1/a> = 1a href="+code=tmpl" class="sref">tmpl1/a>;v15231/a>v15241/a>1a href="+code=unlock" class="sref">unlock1/a>:v15251/a>        1a href="+code=up_writ." class="sref">up_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v15261/a>v15271/a>        1a href="+code=err" class="sref">err1/a> = 1a href="+code=PTR_ERR" class="sref">PTR_ERR1/a>(1a href="+code=larval" class="sref">larval1/a>);v15281/a>        if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=larval" class="sref">larval1/a>))v15291/a>                goto11a href="+code=err" class="sref">err1/a>;v153on a>v15311/a>        1a href="+code=crypto_wait_for_test" class="sref">crypto_wait_for_test1/a>(1a href="+code=larval" class="sref">larval1/a>);v15321/a>        1a href="+code=err" class="sref">err1/a> = 0;v15331/a>v15341/a>1a href="+code=err" class="sref">err1/a>:v15351/a>        return 1a href="+code=err" class="sref">err1/a>;v15361/a>}v15371/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_register_instance" class="sref">crypto_register_instance1/a>);v15381/a>v15391/a>int11a href="+code=crypto_unregister_instance" class="sref">crypto_unregister_instance1/a>(struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>)v15401/a>{v15411/a>        int11a href="+code=err" class="sref">err1/a>;v15421/a>        struct11a href="+code=crypto_instance" class="sref">crypto_instance1/a> *1a href="+code=inst" class="sref">inst1/a> = (void *)1a href="+code=alg" class="sref">alg1/a>;v15431/a>        struct11a href="+code=crypto_template" class="sref">crypto_template1/a> *1a href="+code=tmpl" class="sref">tmpl1/a> = 1a href="+code=inst" class="sref">inst1/a>->1a href="+code=tmpl" class="sref">tmpl1/a>;v15441/a>        1a href="+code=LIST_HEAD" class="sref">LIST_HEAD1/a>(1a href="+code=users" class="sref">users1/a>);v15451/a>v15461/a>        if (!(1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_flags" class="sref">cra_flags1/a> & 1a href="+code=CRYPTO_ALG_INSTANCE" class="sref">CRYPTO_ALG_INSTANCE1/a>))v15471/a>                return -1a href="+code=EINVAL" class="sref">EINVAL1/a>;v15481/a>v15491/a>        1a href="+code=BUG_ON" class="sref">BUG_ON1/a>(1a href="+code=atomic_read" class="sref">atomic_read1/a>(&1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_refcnt" class="sref">cra_refcnt1/a>) != 1);v155on a>v15511/a>        1a href="+code=down_writ." class="sref">down_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v15521/a>v15531/a>        1a href="+code=hlist_del_init" class="sref">hlist_del_init1/a>(&1a href="+code=inst" class="sref">inst1/a>->1a href="+code=list" class="sref">list1/a>);v15541/a>        1a href="+code=err" class="sref">err1/a> = 1a href="+code=crypto_remove_alg" class="sref">crypto_remove_alg1/a>(1a href="+code=alg" class="sref">alg1/a>, &1a href="+code=users" class="sref">users1/a>);v15551/a>v15561/a>        1a href="+code=up_writ." class="sref">up_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v15571/a>v15581/a>        if (1a href="+code=err" class="sref">err1/a>)v15591/a>                return 1a href="+code=err" class="sref">err1/a>;v156on a>v15611/a>        1a href="+code=tmpl" class="sref">tmpl1/a>->1a href="+code=free" class="sref">free1/a>(1a href="+code=inst" class="sref">inst1/a>);v15621/a>        1a href="+code=crypto_remove_final" class="sref">crypto_remove_final1/a>(&1a href="+code=users" class="sref">users1/a>);v15631/a>v15641/a>        return 0;v15651/a>}v15661/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_unregister_instance" class="sref">crypto_unregister_instance1/a>);v15671/a>v15681/a>int11a href="+code=crypto_init_spawn" class="sref">crypto_init_spawn1/a>(struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a> *1a href="+code=spawn" class="sref">spawn1/a>, struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>,v15691/a>                      struct11a href="+code=crypto_instance" class="sref">crypto_instance1/a> *1a href="+code=inst" class="sref">inst1/a>, 1a href="+code=u32" class="sref">u321/a> 1a href="+code=mask" class="sref">mask1/a>)v15701/a>{v15711/a>        int11a href="+code=err" class="sref">err1/a> = -1a href="+code=EAGAIN" class="sref">EAGAIN1/a>;v15721/a>v15731/a>        1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=inst" class="sref">inst1/a> = 1a href="+code=inst" class="sref">inst1/a>;v15741/a>        1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=mask" class="sref">mask1/a> = 1a href="+code=mask" class="sref">mask1/a>;v15751/a>v15761/a>        1a href="+code=down_writ." class="sref">down_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v15771/a>        if (!1a href="+code=crypto_is_moribund" class="sref">crypto_is_moribund1/a>(1a href="+code=alg" class="sref">alg1/a>)) {v15781/a>                1a href="+code=list_add" class="sref">list_add1/a>(&1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=list" class="sref">list1/a>, &1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_users" class="sref">cra_users1/a>);v15791/a>                1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=alg" class="sref">alg1/a> = 1a href="+code=alg" class="sref">alg1/a>;v15801/a>                1a href="+code=err" class="sref">err1/a> = 0;v15811/a>        }v15821/a>        1a href="+code=up_writ." class="sref">up_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v15831/a>v15841/a>        return 1a href="+code=err" class="sref">err1/a>;v15851/a>}v15861/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_init_spawn" class="sref">crypto_init_spawn1/a>);v15871/a>v15881/a>int11a href="+code=crypto_init_spawn2" class="sref">crypto_init_spawn21/a>(struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a> *1a href="+code=spawn" class="sref">spawn1/a>, struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>,v15891/a>                       struct11a href="+code=crypto_instance" class="sref">crypto_instance1/a> *1a href="+code=inst" class="sref">inst1/a>,v15901/a>                       const struct11a href="+code=crypto_type" class="sref">crypto_type1/a> *1a href="+code=frontend" class="sref">frontend1/a>)v15911/a>{v15921/a>        int11a href="+code=err" class="sref">err1/a> = -1a href="+code=EINVAL" class="sref">EINVAL1/a>;v15931/a>v15941/a>        if ((1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_flags" class="sref">cra_flags1/a> ^11a href="+code=frontend" class="sref">frontend1/a>->1a href="+code=type" class="sref">type1/a>) & 1a href="+code=frontend" class="sref">frontend1/a>->1a href="+code=maskset" class="sref">maskset1/a>)v15951/a>                goto11a href="+code=out" class="sref">out1/a>;v15961/a>v15971/a>        1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=frontend" class="sref">frontend1/a> = 1a href="+code=frontend" class="sref">frontend1/a>;v15981/a>        1a href="+code=err" class="sref">err1/a> = 1a href="+code=crypto_init_spawn" class="sref">crypto_init_spawn1/a>(1a href="+code=spawn" class="sref">spawn1/a>, 1a href="+code=alg" class="sref">alg1/a>, 1a href="+code=inst" class="sref">inst1/a>, 1a href="+code=frontend" class="sref">frontend1/a>->1a href="+code=maskset" class="sref">maskset1/a>);v15991/a>v160on a>1a href="+code=out" class="sref">out1/a>:v16011/a>        return 1a href="+code=err" class="sref">err1/a>;v16021/a>}v16031/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_init_spawn2" class="sref">crypto_init_spawn21/a>);v16041/a>v16051/a>void 1a href="+code=crypto_drop_spawn" class="sref">crypto_drop_spawn1/a>(struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a> *1a href="+code=spawn" class="sref">spawn1/a>)v16061/a>{v16071/a>        if (!1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=alg" class="sref">alg1/a>)v16081/a>                return;v16091/a>v16101/a>        1a href="+code=down_writ." class="sref">down_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v16111/a>        1a href="+code=list_del" class="sref">list_del1/a>(&1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=list" class="sref">list1/a>);v16121/a>        1a href="+code=up_writ." class="sref">up_writ.1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v16131/a>}v16141/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_drop_spawn" class="sref">crypto_drop_spawn1/a>);v16151/a>v16161/a>static1struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=crypto_spawn_alg" class="sref">crypto_spawn_alg1/a>(struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a> *1a href="+code=spawn" class="sref">spawn1/a>)v16171/a>{v16181/a>        struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>;v16191/a>        struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg2" class="sref">alg21/a>;v162on a>v16211/a>        1a href="+code=down_read" class="sref">down_read1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v16221/a>        1a href="+code=alg" class="sref">alg1/a> = 1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=alg" class="sref">alg1/a>;v16231/a>        1a href="+code=alg2" class="sref">alg21/a> = 1a href="+code=alg" class="sref">alg1/a>;v16241/a>        if (1a href="+code=alg2" class="sref">alg21/a>)v16251/a>                1a href="+code=alg2" class="sref">alg21/a> = 1a href="+code=crypto_mod_get" class="sref">crypto_mod_get1/a>(1a href="+code=alg2" class="sref">alg21/a>);v16261/a>        1a href="+code=up_read" class="sref">up_read1/a>(&1a href="+code=crypto_alg_sem" class="sref">crypto_alg_sem1/a>);v16271/a>v16281/a>        if (!1a href="+code=alg2" class="sref">alg21/a>) {v16291/a>                if (1a href="+code=alg" class="sref">alg1/a>)v16301/a>                       11a href="+code=crypto_shoot_alg" class="sref">crypto_shoot_alg1/a>(1a href="+code=alg" class="sref">alg1/a>);v16311/a>                return 1a href="+code=ERR_PTR" class="sref">ERR_PTR1/a>(-1a href="+code=EAGAIN" class="sref">EAGAIN1/a>);v16321/a>        }v16331/a>v16341/a>        return 1a href="+code=alg" class="sref">alg1/a>;v16351/a>}v16361/a>v16371/a>struct11a href="+code=crypto_tfm" class="sref">crypto_tfm1/a> *1a href="+code=crypto_spawn_tfm" class="sref">crypto_spawn_tfm1/a>(struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a> *1a href="+code=spawn" class="sref">spawn1/a>, 1a href="+code=u32" class="sref">u321/a> 1a href="+code=type" class="sref">type1/a>,v16381/a>                                   11a href="+code=u32" class="sref">u321/a> 1a href="+code=mask" class="sref">mask1/a>)v16391/a>{v16401/a>        struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>;v16411/a>        struct11a href="+code=crypto_tfm" class="sref">crypto_tfm1/a> *1a href="+code=tfm" class="sref">tfm1/a>;v16421/a>v16431/a>        1a href="+code=alg" class="sref">alg1/a> = 1a href="+code=crypto_spawn_alg" class="sref">crypto_spawn_alg1/a>(1a href="+code=spawn" class="sref">spawn1/a>);v16441/a>        if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=alg" class="sref">alg1/a>))v16451/a>                return 1a href="+code=ERR_CAST" class="sref">ERR_CAST1/a>(1a href="+code=alg" class="sref">alg1/a>);v16461/a>v16471/a>        1a href="+code=tfm" class="sref">tfm1/a> = 1a href="+code=ERR_PTR" class="sref">ERR_PTR1/a>(-1a href="+code=EINVAL" class="sref">EINVAL1/a>);v16481/a>        if (1a href="+code=unlikely" class="sref">unlikely1/a>((1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_flags" class="sref">cra_flags1/a> ^11a href="+code=type" class="sref">type1/a>) & 1a href="+code=mask" class="sref">mask1/a>))v16491/a>                goto11a href="+code=out_put_alg" class="sref">out_put_alg1/a>;v165on a>v16511/a>        1a href="+code=tfm" class="sref">tfm1/a> = 1a href="+code=__crypto_alloc_tfm" class="sref">__crypto_alloc_tfm1/a>(1a href="+code=alg" class="sref">alg1/a>, 1a href="+code=type" class="sref">type1/a>, 1a href="+code=mask" class="sref">mask1/a>);v16521/a>        if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=tfm" class="sref">tfm1/a>))v16531/a>                goto11a href="+code=out_put_alg" class="sref">out_put_alg1/a>;v16541/a>v16551/a>        return 1a href="+code=tfm" class="sref">tfm1/a>;v16561/a>v16571/a>1a href="+code=out_put_alg" class="sref">out_put_alg1/a>:v16581/a>        1a href="+code=crypto_mod_put" class="sref">crypto_mod_put1/a>(1a href="+code=alg" class="sref">alg1/a>);v16591/a>        return 1a href="+code=tfm" class="sref">tfm1/a>;v166on a>}v16611/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_spawn_tfm" class="sref">crypto_spawn_tfm1/a>);v16621/a>v16631/a>void *1a href="+code=crypto_spawn_tfm2" class="sref">crypto_spawn_tfm21/a>(struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a> *1a href="+code=spawn" class="sref">spawn1/a>)v16641/a>{v16651/a>        struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>;v16661/a>        struct11a href="+code=crypto_tfm" class="sref">crypto_tfm1/a> *1a href="+code=tfm" class="sref">tfm1/a>;v16671/a>v16681/a>        1a href="+code=alg" class="sref">alg1/a> = 1a href="+code=crypto_spawn_alg" class="sref">crypto_spawn_alg1/a>(1a href="+code=spawn" class="sref">spawn1/a>);v16691/a>        if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=alg" class="sref">alg1/a>))v16701/a>                return 1a href="+code=ERR_CAST" class="sref">ERR_CAST1/a>(1a href="+code=alg" class="sref">alg1/a>);v16711/a>v16721/a>        1a href="+code=tfm" class="sref">tfm1/a> = 1a href="+code=crypto_create_tfm" class="sref">crypto_create_tfm1/a>(1a href="+code=alg" class="sref">alg1/a>, 1a href="+code=spawn" class="sref">spawn1/a>->1a href="+code=frontend" class="sref">frontend1/a>);v16731/a>        if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=tfm" class="sref">tfm1/a>))v16741/a>                goto11a href="+code=out_put_alg" class="sref">out_put_alg1/a>;v16751/a>v16761/a>        return 1a href="+code=tfm" class="sref">tfm1/a>;v16771/a>v16781/a>1a href="+code=out_put_alg" class="sref">out_put_alg1/a>:v16791/a>        1a href="+code=crypto_mod_put" class="sref">crypto_mod_put1/a>(1a href="+code=alg" class="sref">alg1/a>);v16801/a>        return 1a href="+code=tfm" class="sref">tfm1/a>;v16811/a>}v16821/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_spawn_tfm2" class="sref">crypto_spawn_tfm21/a>);v16831/a>v16841/a>int11a href="+code=crypto_register_notifier" class="sref">crypto_register_notifier1/a>(struct11a href="+code=notifier_block" class="sref">notifier_block1/a> *1a href="+code=nb" class="sref">nb1/a>)v16851/a>{v16861/a>        return 1a href="+code=blocking_notifier_chain_register" class="sref">blocking_notifier_chain_register1/a>(&1a href="+code=crypto_chain" class="sref">crypto_chain1/a>, 1a href="+code=nb" class="sref">nb1/a>);v16871/a>}v16881/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_register_notifier" class="sref">crypto_register_notifier1/a>);v16891/a>v16901/a>int11a href="+code=crypto_unregister_notifier" class="sref">crypto_unregister_notifier1/a>(struct11a href="+code=notifier_block" class="sref">notifier_block1/a> *1a href="+code=nb" class="sref">nb1/a>)v16911/a>{v16921/a>        return 1a href="+code=blocking_notifier_chain_unregister" class="sref">blocking_notifier_chain_unregister1/a>(&1a href="+code=crypto_chain" class="sref">crypto_chain1/a>, 1a href="+code=nb" class="sref">nb1/a>);v16931/a>}v16941/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_unregister_notifier" class="sref">crypto_unregister_notifier1/a>);v16951/a>v16961/a>struct11a href="+code=crypto_attr_type" class="sref">crypto_attr_type1/a> *1a href="+code=crypto_get_attr_type" class="sref">crypto_get_attr_type1/a>(struct11a href="+code=rtattr" class="sref">rtattr1/a> **1a href="+code=tb" class="sref">tb1/a>)v16971/a>{v16981/a>        struct11a href="+code=rtattr" class="sref">rtattr1/a> *1a href="+code=rta" class="sref">rta1/a> = 1a href="+code=tb" class="sref">tb1/a>[0];v16991/a>        struct11a href="+code=crypto_attr_type" class="sref">crypto_attr_type1/a> *1a href="+code=algt" class="sref">algt1/a>;v170on a>v17011/a>        if (!1a href="+code=rta" class="sref">rta1/a>)v17021/a>                return 1a href="+code=ERR_PTR" class="sref">ERR_PTR1/a>(-1a href="+code=ENOENT" class="sref">ENOENT1/a>);v17031/a>        if (1a href="+code=RTA_PAYLOAD" class="sref">RTA_PAYLOAD1/a>(1a href="+code=rta" class="sref">rta1/a>) < sizeof(*1a href="+code=algt" class="sref">algt1/a>))v17041/a>                return 1a href="+code=ERR_PTR" class="sref">ERR_PTR1/a>(-1a href="+code=EINVAL" class="sref">EINVAL1/a>);v17051/a>        if (1a href="+code=rta" class="sref">rta1/a>->1a href="+code=rta_type" class="sref">rta_type1/a> != 1a href="+code=CRYPTOA_TYPE" class="sref">CRYPTOA_TYPE1/a>)v17061/a>                return 1a href="+code=ERR_PTR" class="sref">ERR_PTR1/a>(-1a href="+code=EINVAL" class="sref">EINVAL1/a>);v17071/a>v17081/a>        1a href="+code=algt" class="sref">algt1/a> = 1a href="+code=RTA_DATA" class="sref">RTA_DATA1/a>(1a href="+code=rta" class="sref">rta1/a>);v17091/a>v17101/a>        return 1a href="+code=algt" class="sref">algt1/a>;v17111/a>}v17121/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_get_attr_type" class="sref">crypto_get_attr_type1/a>);v17131/a>v17141/a>int11a href="+code=crypto_check_attr_type" class="sref">crypto_check_attr_type1/a>(struct11a href="+code=rtattr" class="sref">rtattr1/a> **1a href="+code=tb" class="sref">tb1/a>, 1a href="+code=u32" class="sref">u321/a> 1a href="+code=type" class="sref">type1/a>)v17151/a>{v17161/a>        struct11a href="+code=crypto_attr_type" class="sref">crypto_attr_type1/a> *1a href="+code=algt" class="sref">algt1/a>;v17171/a>v17181/a>        1a href="+code=algt" class="sref">algt1/a> = 1a href="+code=crypto_get_attr_type" class="sref">crypto_get_attr_type1/a>(1a href="+code=tb" class="sref">tb1/a>);v17191/a>        if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=algt" class="sref">algt1/a>))v17201/a>                return 1a href="+code=PTR_ERR" class="sref">PTR_ERR1/a>(1a href="+code=algt" class="sref">algt1/a>);v17211/a>v17221/a>        if ((1a href="+code=algt" class="sref">algt1/a>->1a href="+code=type" class="sref">type1/a> ^11a href="+code=type" class="sref">type1/a>) & 1a href="+code=algt" class="sref">algt1/a>->1a href="+code=mask" class="sref">mask1/a>)v17231/a>                return -1a href="+code=EINVAL" class="sref">EINVAL1/a>;v17241/a>v17251/a>        return 0;v17261/a>}v17271/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_check_attr_type" class="sref">crypto_check_attr_type1/a>);v17281/a>v17291/a>const char *1a href="+code=crypto_attr_alg_nam." class="sref">crypto_attr_alg_nam.1/a>(struct11a href="+code=rtattr" class="sref">rtattr1/a> *1a href="+code=rta" class="sref">rta1/a>)v17301/a>{v17311/a>        struct11a href="+code=crypto_attr_alg" class="sref">crypto_attr_alg1/a> *1a href="+code=alga" class="sref">alga1/a>;v17321/a>v17331/a>        if (!1a href="+code=rta" class="sref">rta1/a>)v17341/a>                return 1a href="+code=ERR_PTR" class="sref">ERR_PTR1/a>(-1a href="+code=ENOENT" class="sref">ENOENT1/a>);v17351/a>        if (1a href="+code=RTA_PAYLOAD" class="sref">RTA_PAYLOAD1/a>(1a href="+code=rta" class="sref">rta1/a>) < sizeof(*1a href="+code=alga" class="sref">alga1/a>))v17361/a>                return 1a href="+code=ERR_PTR" class="sref">ERR_PTR1/a>(-1a href="+code=EINVAL" class="sref">EINVAL1/a>);v17371/a>        if (1a href="+code=rta" class="sref">rta1/a>->1a href="+code=rta_type" class="sref">rta_type1/a> != 1a href="+code=CRYPTOA_ALG" class="sref">CRYPTOA_ALG1/a>)v17381/a>                return 1a href="+code=ERR_PTR" class="sref">ERR_PTR1/a>(-1a href="+code=EINVAL" class="sref">EINVAL1/a>);v17391/a>v17401/a>        1a href="+code=alga" class="sref">alga1/a> = 1a href="+code=RTA_DATA" class="sref">RTA_DATA1/a>(1a href="+code=rta" class="sref">rta1/a>);v17411/a>        1a href="+code=alga" class="sref">alga1/a>->1a href="+code=nam." class="sref">nam.1/a>[1a href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME1/a> - 1] = 0;v17421/a>v17431/a>        return 1a href="+code=alga" class="sref">alga1/a>->1a href="+code=nam." class="sref">nam.1/a>;v17441/a>}v17451/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_attr_alg_nam." class="sref">crypto_attr_alg_nam.1/a>);v17461/a>v17471/a>struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=crypto_attr_alg2" class="sref">crypto_attr_alg21/a>(struct11a href="+code=rtattr" class="sref">rtattr1/a> *1a href="+code=rta" class="sref">rta1/a>,v17481/a>                                   1const struct11a href="+code=crypto_type" class="sref">crypto_type1/a> *1a href="+code=frontend" class="sref">frontend1/a>,v17491/a>                                    1a href="+code=u32" class="sref">u321/a> 1a href="+code=type" class="sref">type1/a>, 1a href="+code=u32" class="sref">u321/a> 1a href="+code=mask" class="sref">mask1/a>)v17501/a>{v17511/a>        const char *1a href="+code=nam." class="sref">nam.1/a>;v17521/a>        int11a href="+code=err" class="sref">err1/a>;v17531/a>v17541/a>        1a href="+code=nam." class="sref">nam.1/a> = 1a href="+code=crypto_attr_alg_nam." class="sref">crypto_attr_alg_nam.1/a>(1a href="+code=rta" class="sref">rta1/a>);v17551/a>        1a href="+code=err" class="sref">err1/a> = 1a href="+code=PTR_ERR" class="sref">PTR_ERR1/a>(1a href="+code=nam." class="sref">nam.1/a>);v17561/a>        if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=nam." class="sref">nam.1/a>))v17571/a>                return 1a href="+code=ERR_PTR" class="sref">ERR_PTR1/a>(1a href="+code=err" class="sref">err1/a>);v17581/a>v17591/a>        return 1a href="+code=crypto_find_alg" class="sref">crypto_find_alg1/a>(1a href="+code=nam." class="sref">nam.1/a>, 1a href="+code=frontend" class="sref">frontend1/a>, 1a href="+code=type" class="sref">type1/a>, 1a href="+code=mask" class="sref">mask1/a>);v176on a>}v17611/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_attr_alg2" class="sref">crypto_attr_alg21/a>);v17621/a>v17631/a>int11a href="+code=crypto_attr_u32" class="sref">crypto_attr_u321/a>(struct11a href="+code=rtattr" class="sref">rtattr1/a> *1a href="+code=rta" class="sref">rta1/a>, 1a href="+code=u32" class="sref">u321/a> *1a href="+code=num" class="sref">num1/a>)v17641/a>{v17651/a>        struct11a href="+code=crypto_attr_u32" class="sref">crypto_attr_u321/a> *1a href="+code=nu32" class="sref">nu321/a>;v17661/a>v17671/a>        if (!1a href="+code=rta" class="sref">rta1/a>)v17681/a>                return -1a href="+code=ENOENT" class="sref">ENOENT1/a>;v17691/a>        if (1a href="+code=RTA_PAYLOAD" class="sref">RTA_PAYLOAD1/a>(1a href="+code=rta" class="sref">rta1/a>) < sizeof(*1a href="+code=nu32" class="sref">nu321/a>))v17701/a>                return -1a href="+code=EINVAL" class="sref">EINVAL1/a>;v17711/a>        if (1a href="+code=rta" class="sref">rta1/a>->1a href="+code=rta_type" class="sref">rta_type1/a> != 1a href="+code=CRYPTOA_U32" class="sref">CRYPTOA_U321/a>)v17721/a>                return -1a href="+code=EINVAL" class="sref">EINVAL1/a>;v17731/a>v17741/a>        1a href="+code=nu32" class="sref">nu321/a> = 1a href="+code=RTA_DATA" class="sref">RTA_DATA1/a>(1a href="+code=rta" class="sref">rta1/a>);v17751/a>        *1a href="+code=num" class="sref">num1/a> = 1a href="+code=nu32" class="sref">nu321/a>->1a href="+code=num" class="sref">num1/a>;v17761/a>v17771/a>        return 0;v17781/a>}v17791/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_attr_u32" class="sref">crypto_attr_u321/a>);v178on a>v17811/a>void *1a href="+code=crypto_alloc_instance2" class="sref">crypto_alloc_instance21/a>(const char *1a href="+code=nam." class="sref">nam.1/a>, struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>,v17821/a>                             unsigned int11a href="+code=head" class="sref">head1/a>)v17831/a>{v17841/a>        struct11a href="+code=crypto_instance" class="sref">crypto_instance1/a> *1a href="+code=inst" class="sref">inst1/a>;v17851/a>        char *1a href="+code=p" class="sref">p1/a>;v17861/a>        int11a href="+code=err" class="sref">err1/a>;v17871/a>v17881/a>        1a href="+code=p" class="sref">p1/a> = 1a href="+code=kzalloc" class="sref">kzalloc1/a>(1a href="+code=head" class="sref">head1/a> + sizeof(*1a href="+code=inst" class="sref">inst1/a>) + sizeof(struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a>),v17891/a>                    1a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL1/a>);v17901/a>        if (!1a href="+code=p" class="sref">p1/a>)v17911/a>                return 1a href="+code=ERR_PTR" class="sref">ERR_PTR1/a>(-1a href="+code=ENOMEM" class="sref">ENOMEM1/a>);v17921/a>v17931/a>        1a href="+code=inst" class="sref">inst1/a> = (void *)(1a href="+code=p" class="sref">p1/a> +11a href="+code=head" class="sref">head1/a>);v17941/a>v17951/a>        1a href="+code=err" class="sref">err1/a> = -1a href="+code=ENAMETOOLONG" class="sref">ENAMETOOLONG1/a>;v17961/a>        if (1a href="+code=snprintf" class="sref">snprintf1/a>(1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_nam." class="sref">cra_nam.1/a>, 1a href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME1/a>, 1span class="string">"%s(%s)", 1a href="+code=nam." class="sref">nam.1/a>,v17971/a>                     1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_nam." class="sref">cra_nam.1/a>) >= 1a href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME1/a>)v17981/a>                goto11a href="+code=err_free_inst" class="sref">err_free_inst1/a>;v17991/a>v18001/a>        if (1a href="+code=snprintf" class="sref">snprintf1/a>(1a href="+code=inst" class="sref">inst1/a>->1a href="+code=alg" class="sref">alg1/a>.1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>, 1a href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME1/a>, 1span class="string">"%s(%s)",v18011/a>                     1a href="+code=nam." class="sref">nam.1/a>, 1a href="+code=alg" class="sref">alg1/a>->1a href="+code=cra_driver_nam." class="sref">cra_driver_nam.1/a>) >= 1a href="+code=CRYPTO_MAX_ALG_NAME" class="sref">CRYPTO_MAX_ALG_NAME1/a>)v18021/a>                goto11a href="+code=err_free_inst" class="sref">err_free_inst1/a>;v18031/a>v18041/a>        return 1a href="+code=p" class="sref">p1/a>;v18051/a>v18061/a>1a href="+code=err_free_inst" class="sref">err_free_inst1/a>:v18071/a>        1a href="+code=kfree" class="sref">kfree1/a>(1a href="+code=p" class="sref">p1/a>);v18081/a>        return 1a href="+code=ERR_PTR" class="sref">ERR_PTR1/a>(1a href="+code=err" class="sref">err1/a>);v18091/a>}v18101/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_alloc_instance2" class="sref">crypto_alloc_instance21/a>);v18111/a>v18121/a>struct11a href="+code=crypto_instance" class="sref">crypto_instance1/a> *1a href="+code=crypto_alloc_instance" class="sref">crypto_alloc_instance1/a>(const char *1a href="+code=nam." class="sref">nam.1/a>,v18131/a>                                              struct11a href="+code=crypto_alg" class="sref">crypto_alg1/a> *1a href="+code=alg" class="sref">alg1/a>)v18141/a>{v18151/a>        struct11a href="+code=crypto_instance" class="sref">crypto_instance1/a> *1a href="+code=inst" class="sref">inst1/a>;v18161/a>        struct11a href="+code=crypto_spawn" class="sref">crypto_spawn1/a> *1a href="+code=spawn" class="sref">spawn1/a>;v18171/a>        int11a href="+code=err" class="sref">err1/a>;v18181/a>v18191/a>        1a href="+code=inst" class="sref">inst1/a> = 1a href="+code=crypto_alloc_instance2" class="sref">crypto_alloc_instance21/a>(1a href="+code=nam." class="sref">nam.1/a>, 1a href="+code=alg" class="sref">alg1/a>, 0);v18201/a>        if (1a href="+code=IS_ERR" class="sref">IS_ERR1/a>(1a href="+code=inst" class="sref">inst1/a>))v18211/a>                goto11a href="+code=out" class="sref">out1/a>;v18221/a>v18231/a>        1a href="+code=spawn" class="sref">spawn1/a> = 1a href="+code=crypto_instance_ctx" class="sref">crypto_instance_ctx1/a>(1a href="+code=inst" class="sref">inst1/a>);v18241/a>        1a href="+code=err" class="sref">err1/a> = 1a href="+code=crypto_init_spawn" class="sref">crypto_init_spawn1/a>(1a href="+code=spawn" class="sref">spawn1/a>, 1a href="+code=alg" class="sref">alg1/a>, 1a href="+code=inst" class="sref">inst1/a>,v18251/a>                                1a href="+code=CRYPTO_ALG_TYPE_MASK" class="sref">CRYPTO_ALG_TYPE_MASK1/a> | 1a href="+code=CRYPTO_ALG_ASYNC" class="sref">CRYPTO_ALG_ASYNC1/a>);v18261/a>v18271/a>        if (1a href="+code=err" class="sref">err1/a>)v18281/a>                goto11a href="+code=err_free_inst" class="sref">err_free_inst1/a>;v18291/a>v18301/a>        return 1a href="+code=inst" class="sref">inst1/a>;v18311/a>v18321/a>1a href="+code=err_free_inst" class="sref">err_free_inst1/a>:v18331/a>        1a href="+code=kfree" class="sref">kfree1/a>(1a href="+code=inst" class="sref">inst1/a>);v18341/a>        1a href="+code=inst" class="sref">inst1/a> = 1a href="+code=ERR_PTR" class="sref">ERR_PTR1/a>(1a href="+code=err" class="sref">err1/a>);v18351/a>v18361/a>1a href="+code=out" class="sref">out1/a>:v18371/a>        return 1a href="+code=inst" class="sref">inst1/a>;v18381/a>}v18391/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_alloc_instance" class="sref">crypto_alloc_instance1/a>);v184on a>v18411/a>void 1a href="+code=crypto_init_queue" class="sref">crypto_init_queue1/a>(struct11a href="+code=crypto_queue" class="sref">crypto_queue1/a> *1a href="+code=queue" class="sref">queue1/a>, unsigned int11a href="+code=max_qlen" class="sref">max_qlen1/a>)v18421/a>{v18431/a>        1a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD1/a>(&1a href="+code=queue" class="sref">queue1/a>->1a href="+code=list" class="sref">list1/a>);v18441/a>        1a href="+code=queue" class="sref">queue1/a>->1a href="+code=backlog" class="sref">backlog1/a> = &1a href="+code=queue" class="sref">queue1/a>->1a href="+code=list" class="sref">list1/a>;v18451/a>        1a href="+code=queue" class="sref">queue1/a>->1a href="+code=qlen" class="sref">qlen1/a> = 0;v18461/a>        1a href="+code=queue" class="sref">queue1/a>->1a href="+code=max_qlen" class="sref">max_qlen1/a> = 1a href="+code=max_qlen" class="sref">max_qlen1/a>;v18471/a>}v18481/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_init_queue" class="sref">crypto_init_queue1/a>);v18491/a>v18501/a>int11a href="+code=crypto_enqueue_request" class="sref">crypto_enqueue_request1/a>(struct11a href="+code=crypto_queue" class="sref">crypto_queue1/a> *1a href="+code=queue" class="sref">queue1/a>,v18511/a>                           struct11a href="+code=crypto_async_request" class="sref">crypto_async_request1/a> *1a href="+code=request" class="sref">request1/a>)v18521/a>{v18531/a>        int11a href="+code=err" class="sref">err1/a> = -1a href="+code=EINPROGRESS" class="sref">EINPROGRESS1/a>;v18541/a>v18551/a>        if (1a href="+code=unlikely" class="sref">unlikely1/a>(1a href="+code=queue" class="sref">queue1/a>->1a href="+code=qlen" class="sref">qlen1/a> >= 1a href="+code=queue" class="sref">queue1/a>->1a href="+code=max_qlen" class="sref">max_qlen1/a>)) {v18561/a>                1a href="+code=err" class="sref">err1/a> = -1a href="+code=EBUSY" class="sref">EBUSY1/a>;v18571/a>                if (!(1a href="+code=request" class="sref">request1/a>->1a href="+code=flags" class="sref">flags1/a> & 1a href="+code=CRYPTO_TFM_REQ_MAY_BACKLOG" class="sref">CRYPTO_TFM_REQ_MAY_BACKLOG1/a>))v18581/a>                        goto11a href="+code=out" class="sref">out1/a>;v18591/a>                if (1a href="+code=queue" class="sref">queue1/a>->1a href="+code=backlog" class="sref">backlog1/a> == &1a href="+code=queue" class="sref">queue1/a>->1a href="+code=list" class="sref">list1/a>)v18601/a>                        1a href="+code=queue" class="sref">queue1/a>->1a href="+code=backlog" class="sref">backlog1/a> = &1a href="+code=request" class="sref">request1/a>->1a href="+code=list" class="sref">list1/a>;v18611/a>        }v18621/a>v18631/a>        1a href="+code=queue" class="sref">queue1/a>->1a href="+code=qlen" class="sref">qlen1/a>++;v18641/a>        1a href="+code=list_add_tail" class="sref">list_add_tail1/a>(&1a href="+code=request" class="sref">request1/a>->1a href="+code=list" class="sref">list1/a>, &1a href="+code=queue" class="sref">queue1/a>->1a href="+code=list" class="sref">list1/a>);v18651/a>v18661/a>1a href="+code=out" class="sref">out1/a>:v18671/a>        return 1a href="+code=err" class="sref">err1/a>;v18681/a>}v18691/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_enqueue_request" class="sref">crypto_enqueue_request1/a>);v187on a>v18711/a>void *1a href="+code=__crypto_dequeue_request" class="sref">__crypto_dequeue_request1/a>(struct11a href="+code=crypto_queue" class="sref">crypto_queue1/a> *1a href="+code=queue" class="sref">queue1/a>, unsigned int11a href="+code=offset" class="sref">offset1/a>)v18721/a>{v18731/a>        struct11a href="+code=list_head" class="sref">list_head1/a> *1a href="+code=request" class="sref">request1/a>;v18741/a>v18751/a>        if (1a href="+code=unlikely" class="sref">unlikely1/a>(!1a href="+code=queue" class="sref">queue1/a>->1a href="+code=qlen" class="sref">qlen1/a>))v18761/a>                return 1a href="+code=NULL" class="sref">NULL1/a>;v18771/a>v18781/a>        1a href="+code=queue" class="sref">queue1/a>->1a href="+code=qlen" class="sref">qlen1/a>--;v18791/a>v18801/a>        if (1a href="+code=queue" class="sref">queue1/a>->1a href="+code=backlog" class="sref">backlog1/a> != &1a href="+code=queue" class="sref">queue1/a>->1a href="+code=list" class="sref">list1/a>)v18811/a>                1a href="+code=queue" class="sref">queue1/a>->1a href="+code=backlog" class="sref">backlog1/a> = 1a href="+code=queue" class="sref">queue1/a>->1a href="+code=backlog" class="sref">backlog1/a>->1a href="+code=next" class="sref">next1/a>;v18821/a>v18831/a>        1a href="+code=request" class="sref">request1/a> = 1a href="+code=queue" class="sref">queue1/a>->1a href="+code=list" class="sref">list1/a>.1a href="+code=next" class="sref">next1/a>;v18841/a>        1a href="+code=list_del" class="sref">list_del1/a>(1a href="+code=request" class="sref">request1/a>);v18851/a>v18861/a>        return (char *)1a href="+code=list_entry" class="sref">list_entry1/a>(1a href="+code=request" class="sref">request1/a>, struct11a href="+code=crypto_async_request" class="sref">crypto_async_request1/a>, 1a href="+code=list" class="sref">list1/a>) -v18871/a>               1a href="+code=offset" class="sref">offset1/a>;v18881/a>}v18891/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=__crypto_dequeue_request" class="sref">__crypto_dequeue_request1/a>);v189on a>v18911/a>struct11a href="+code=crypto_async_request" class="sref">crypto_async_request1/a> *1a href="+code=crypto_dequeue_request" class="sref">crypto_dequeue_request1/a>(struct11a href="+code=crypto_queue" class="sref">crypto_queue1/a> *1a href="+code=queue" class="sref">queue1/a>)v18921/a>{v18931/a>        return 1a href="+code=__crypto_dequeue_request" class="sref">__crypto_dequeue_request1/a>(1a href="+code=queue" class="sref">queue1/a>, 0);v18941/a>}v18951/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_dequeue_request" class="sref">crypto_dequeue_request1/a>);v18961/a>v18971/a>int11a href="+code=crypto_tfm_in_queue" class="sref">crypto_tfm_in_queue1/a>(struct11a href="+code=crypto_queue" class="sref">crypto_queue1/a> *1a href="+code=queue" class="sref">queue1/a>, struct11a href="+code=crypto_tfm" class="sref">crypto_tfm1/a> *1a href="+code=tfm" class="sref">tfm1/a>)v18981/a>{v18991/a>        struct11a href="+code=crypto_async_request" class="sref">crypto_async_request1/a> *1a href="+code=req" class="sref">req1/a>;v190on a>v19011/a>        1a href="+code=list_for_each_entry" class="sref">list_for_each_entry1/a>(1a href="+code=req" class="sref">req1/a>, &1a href="+code=queue" class="sref">queue1/a>->1a href="+code=list" class="sref">list1/a>, 1a href="+code=list" class="sref">list1/a>) {v19021/a>                if (1a href="+code=req" class="sref">req1/a>->1a href="+code=tfm" class="sref">tfm1/a> == 1a href="+code=tfm" class="sref">tfm1/a>)v19031/a>                        return 1;v19041/a>        }v19051/a>v19061/a>        return 0;v19071/a>}v19081/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_tfm_in_queue" class="sref">crypto_tfm_in_queue1/a>);v19091/a>v19101/a>static 1a href="+code=inline" class="sref">inline1/a> void 1a href="+code=crypto_inc_byte" class="sref">crypto_inc_byte1/a>(1a href="+code=u8" class="sref">u81/a> *1a href="+code=a" class="sref">a1/a>, unsigned int11a href="+code=size" class="sref">size1/a>)v19111/a>{v19121/a>        1a href="+code=u8" class="sref">u81/a> *1a href="+code=b" class="sref">b1/a> = (1a href="+code=a" class="sref">a1/a> +11a href="+code=size" class="sref">size1/a>);v19131/a>        1a href="+code=u8" class="sref">u81/a> 1a href="+code=c" class="sref">c1/a>;v19141/a>v19151/a>        for (; 1a href="+code=size" class="sref">size1/a>; 1a href="+code=size" class="sref">size1/a>--) {v19161/a>                1a href="+code=c" class="sref">c1/a> = *--1a href="+code=b" class="sref">b1/a> + 1;v19171/a>                *1a href="+code=b" class="sref">b1/a> = 1a href="+code=c" class="sref">c1/a>;v19181/a>                if (1a href="+code=c" class="sref">c1/a>)v19191/a>                        break;v19201/a>        }v19211/a>}v19221/a>v19231/a>void 1a href="+code=crypto_inc" class="sref">crypto_inc1/a>(1a href="+code=u8" class="sref">u81/a> *1a href="+code=a" class="sref">a1/a>, unsigned int11a href="+code=size" class="sref">size1/a>)v19241/a>{v19251/a>        1a href="+code=__be32" class="sref">__be321/a> *1a href="+code=b" class="sref">b1/a> = (1a href="+code=__be32" class="sref">__be321/a> *)(1a href="+code=a" class="sref">a1/a> +11a href="+code=size" class="sref">size1/a>);v19261/a>        1a href="+code=u32" class="sref">u321/a> 1a href="+code=c" class="sref">c1/a>;v19271/a>v19281/a>        for (; 1a href="+code=size" class="sref">size1/a> >= 4; 1a href="+code=size" class="sref">size1/a> -= 4) {v19291/a>                1a href="+code=c" class="sref">c1/a> = 1a href="+code=be32_to_cpu" class="sref">be32_to_cpu1/a>(*--1a href="+code=b" class="sref">b1/a>) + 1;v19301/a>                *1a href="+code=b" class="sref">b1/a> = 1a href="+code=cpu_to_be32" class="sref">cpu_to_be321/a>(1a href="+code=c" class="sref">c1/a>);v19311/a>                if (1a href="+code=c" class="sref">c1/a>)v19321/a>                        return;v19331/a>        }v19341/a>v19351/a>        1a href="+code=crypto_inc_byte" class="sref">crypto_inc_byte1/a>(1a href="+code=a" class="sref">a1/a>, 1a href="+code=size" class="sref">size1/a>);v19361/a>}v19371/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_inc" class="sref">crypto_inc1/a>);v19381/a>v19391/a>static 1a href="+code=inline" class="sref">inline1/a> void 1a href="+code=crypto_xor_byte" class="sref">crypto_xor_byte1/a>(1a href="+code=u8" class="sref">u81/a> *1a href="+code=a" class="sref">a1/a>, const 1a href="+code=u8" class="sref">u81/a> *1a href="+code=b" class="sref">b1/a>, unsigned int11a href="+code=size" class="sref">size1/a>)v19401/a>{v19411/a>        for (; 1a href="+code=size" class="sref">size1/a>; 1a href="+code=size" class="sref">size1/a>--)v19421/a>                *1a href="+code=a" class="sref">a1/a>++ ^= *1a href="+code=b" class="sref">b1/a>++;v19431/a>}v19441/a>v19451/a>void 1a href="+code=crypto_xor" class="sref">crypto_xor1/a>(1a href="+code=u8" class="sref">u81/a> *1a href="+code=dst" class="sref">dst1/a>, const 1a href="+code=u8" class="sref">u81/a> *1a href="+code=src" class="sref">src1/a>, unsigned int11a href="+code=size" class="sref">size1/a>)v19461/a>{v19471/a>        1a href="+code=u32" class="sref">u321/a> *1a href="+code=a" class="sref">a1/a> = (1a href="+code=u32" class="sref">u321/a> *)1a href="+code=dst" class="sref">dst1/a>;v19481/a>        1a href="+code=u32" class="sref">u321/a> *1a href="+code=b" class="sref">b1/a> = (1a href="+code=u32" class="sref">u321/a> *)1a href="+code=src" class="sref">src1/a>;v19491/a>v19501/a>        for (; 1a href="+code=size" class="sref">size1/a> >= 4; 1a href="+code=size" class="sref">size1/a> -= 4)v19511/a>                *1a href="+code=a" class="sref">a1/a>++ ^= *1a href="+code=b" class="sref">b1/a>++;v19521/a>v19531/a>        1a href="+code=crypto_xor_byte" class="sref">crypto_xor_byte1/a>((1a href="+code=u8" class="sref">u81/a> *)1a href="+code=a" class="sref">a1/a>, (1a href="+code=u8" class="sref">u81/a> *)1a href="+code=b" class="sref">b1/a>, 1a href="+code=size" class="sref">size1/a>);v19541/a>}v19551/a>1a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL1/a>(1a href="+code=crypto_xor" class="sref">crypto_xor1/a>);v19561/a>v19571/a>static int11a href="+code=__init" class="sref">__init1/a> 1a href="+code=crypto_algapi_init" class="sref">crypto_algapi_init1/a>(void)v19581/a>{v19591/a>        1a href="+code=crypto_init_proc" class="sref">crypto_init_proc1/a>();v19601/a>        return 0;v19611/a>}v19621/a>v19631/a>static void 1a href="+code=__exit" class="sref">__exit1/a> 1a href="+code=crypto_algapi_exit" class="sref">crypto_algapi_exit1/a>(void)v19641/a>{v19651/a>        1a href="+code=crypto_exit_proc" class="sref">crypto_exit_proc1/a>();v19661/a>}v19671/a>v19681/a>1a href="+code=module_init" class="sref">module_init1/a>(1a href="+code=crypto_algapi_init" class="sref">crypto_algapi_init1/a>);v19691/a>1a href="+code=module_exit" class="sref">module_exit1/a>(1a href="+code=crypto_algapi_exit" class="sref">crypto_algapi_exit1/a>);v197on a>v19711/a>1a href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE1/a>(1span class="string">"GPL");v19721/a>1a href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION1/a>(1span class="string">"Cryptographic algorithms API");v19731/a>
lxr.linux.no kindly hosted by Redpill Linpro AS1/a>, provider of Linux consulting and operations services since 1995.