linux/crypto/seqiv.c
<<
v42p/spa=v3 42p/formv3 42pa v42 href="../linux+v/opt.3/crypto/seqiv.c"> v42pimg src="../.static/gfx/right.png" alt=">>"> p/spa=v3 pspa= class="lxr_search"> v v42pinput typv3.hidden" namv3.navtarget" lu2=v3."> v42pinput typv3.text" namv3.search" id3.search"> v42pbutt vatypv3.submit">Search v42Prefs3 42p/a> p/spa=v3 v42 2p/divv3 v42 2pform ac 2=="ajax+*" method="post" onsubmit="return false;"> pinput typv3.hidden" namv3.ajax_lookup" id3.ajax_lookup" lu2=v3."> v42 2p/formv3 v42 2pdiv class="headingbott m">3 pdiv id3.file_contents"v
2 21p/a>pspa= class="comment">/*p/spa=v32 22p/a>pspa= class="comment"> * seqiv: Sequence Number IV Generatorp/spa=v32 23p/a>pspa= class="comment"> *p/spa=v32 24p/a>pspa= class="comment"> * This generator generates a= IV based on a sequence number by xoring itp/spa=v32 25p/a>pspa= class="comment"> * with a salt.  This algorithm is mainly useful for CTR a=d similar modes.p/spa=v32 26p/a>pspa= class="comment"> *p/spa=v32 27p/a>pspa= class="comment"> * Copyright (c) 2007 Herbert Xu <herbert@gondor.apa=a.org.au>p/spa=v32 28p/a>pspa= class="comment"> *p/spa=v32 29p/a>pspa= class="comment"> * This program is free software; you ca= redistribute it a=d/or modify itp/spa=v32 2pspa= class="comment"> * under the terms of the GNU General Public License as published by the Freep/spa=v32 11p/a>pspa= class="comment"> * Software Founda
 2=; either versn va2 of the License, or (at your n>
 2=)p/spa=v32 12p/a>pspa= class="comment"> * any later versn v.p/spa=v32 13p/a>pspa= class="comment"> *p/spa=v32 14p/a>pspa= class="comment"> */p/spa=v32 15p/a>32 16p/a>#include <crypto/internal/aead.hp/a>>32 17p/a>#include <crypto/internal/skcipher.hp/a>>32 18p/a>#include <crypto/rng.hp/a>>32 19p/a>#include <linux/err.hp/a>>32 20p/a>#include <linux/init.hp/a>>32 21p/a>#include <linux/iernel.h"ef="include/linux/kernel.h" class="5ef=d3.L2" class="line" namv3.L12222 21p/a>#include <li/orulernel.h"ef="include/linux/kernel.h" clc#L13" i23.L13" class="line" nam23.L13232 21p/a>#include <lislabrnel.h"ef="include/linux/kernel.h" clc#L14" i23.L14" class="line" nam23.L14242 21p/a>#include <lisps mockrnel.h"ef="include/linux/kernel.h" clc#L15" i23.L15" class="line" nam23.L15252 21p/a>#include <listy xornel.h"ef="include/linux/kernel.h" clc#L16" i23.L16" class="line" nam23.L16262 15p/a>32 17styuctv3	42pa hrecar =pto/s_ctxults" class="frpto/s_ctx2 17 {p/a>32 18        3	42pa hrecar =pps mock_tults" class="frpps mock_t2 18 3	42pa hrecar =mockults" class="frmock2 18="include/linux/kernel.h" clc#L19" i23.L19" class="line" nam23.L19292 18        3	42pa hrecar =u8ults" class="fru82 18 3	42pa hrecar =h a ults" class="frp a 2 18[] 3	42pa hrecar =__atedistri__ults" class="fr__atedistri__2 18 ((3	42pa hrecar =alignedults" class="fraligned2 18(3	42pa hrecar =__alignof__ults" class="fr__alignof__2 18(3	42pa hrecar =u32ults" class="fru322 21))))="include/linux/kernel.h" c3c#L20" i33.L20" class="line" nam33.L203>2 20}="include/linux/kernel.h" c3c#L21" i33.L21" class="line" nam33.L21312 15p/a>3332 18                it="re="include/linux/kernel.h" c3c#L19" i33.L19" class="line" nam33.L19392 15p/a>332 15p/a>32 26p	42pa hrecar =ou ults" class="frou 2 18:p/a>32 18}"include/linux/kernel.h" c4c#L19" i43.L19" class="line" nam43.L19492 15p/a>3333332 15p/a>3332 15p/a>332 18        styuctv3	42pa hrecar =nal/_givef="c_r a ss ults" class="frnal/_givef="c_r a ss 2 18 *3	42pa hrecar =r aults" class="frr a2 18 =v3	42pa hrecar = IV ults" class="fr IV 2 18-g.au&	42pa hrecar =dataults" class="frdata2 18="include/linux/kernel.h" c7c#L19" i73.L19" class="line" nam73.L19792 15p/a>33333332 2<"include/linux/kernel.h" c1.c#L11" id33.L11" class="line" namv31.L2v112 18        3	42pa hrecar =c_completeults" class="complete2 18 =v3	42pa hrecar =r aults" class="frr a2 18-g.au&	42pa hrecar =in aults" class="frcr a2 18.&	42pa hrecar = IV ults" class="fr IV 2 18.&	42pa hrecar =c_completeults" class="complete2 18="include/linux/kernel.h" c1.c#L12" idd3.L12" class="line" namvv3.L11122 18        3	42pa hrecar =dataults" class="frdata2 18 =v3	42pa hrecar =r aults" class="frr a2 18-g.au&	42pa hrecar =in aults" class="frcr a2 18.&	42pa hrecar = IV ults" class="fr IV 2 18.&	42pa hrecar =dataults" class="frdata2 18="include/linux/kernel.h" c1.c#L13" idd3.L13" class="line" namvv3.L11132 18        3	42pa hrecar =infoults" class="frinfo2 18 =v3	42pa hrecar =r aults" class="frr a2 18-g.au&	42pa hrecar =in aults" class="frcr a2 18.&	42pa hrecar =infoults" class="frinfo2 18="include/linux/kernel.h" c1.c#L14" idd3.L14" class="line" namvv3.L11">2 14"include/linux/kernel.h" c1.c#L15" idd3.L15" class="line" namvv3.L11152 18        3	42pa hrecar =ivsizeults" class="frivsize2 18 =v3	42pa hrecar =cnux/k_ablal/skci_ivsizeults" class="frinux/k_ablal/skci_ivsize2 18(3	42pa hrecar =genivults" class="frgeniv2 18)="include/linux/kernel.h" c1.c#L16" idd3.L16" class="line" namvv3.L11162 15p/a>32 18                                 3	42pa hrecar =cnux/k_ablal/skci_alignmaskults" class="frcnux/k_ablal/skci_alignmask2 18(3	42pa hrecar =genivults" class="frgeniv2 18) + 1))) {p/a>3
  v3.17.1
 2=v3.63optiline" namvv3.L11">u2=v3.34.13. >
  vux/kernel.h" c1 >
  v14" idd3.L14" class="line" namvvL14242 211p/a>#include <#include <32 181        3	42pa hrecar =p1ps mo1219" id03.L19" class="line" namv0L19292 181        3	42pa hrecar =u18ults1 class="fru82 18 3	42pa hrecaa hrecar =subr aults" cc clbainux/kernel.h" cla hrecar =subr aults" cc clbains="frsubr a2 18, 3	42pa hrecar =sal/skci_geniv_l/skciults" class="fr hrecar =in aults" class="frcr a2 18.&	42pa hrecar = IV ults" class="fr IV 2 18.&	42pa hrecar =flagsults" class="frflags2 18 gampupa=v32 201}="include/linux/kernel.1h" c313        3	42pa hrecar =CRYPTO_TFM_REQ_MAY_SL=="complete2 18  hrecar =r aults" class="fref1=d3.L2" class="line" nam1vL21312 151p/a>32 13p//a>pspa= class="comment">3.17.34" i8d3.L4" class="line" nam83.1L14342 181        styuctv3	42pa hr1ecar 13mplete2ults" class="frpto/s_complestyuctv3	42pa hrecar =pto/s_ctxults"2 17 =v3	42pa hrecar =cnux/k_ablal/skci_frivsize2 18)="inc/linux/kernel.h" c4c#L18" ciults" class="fr hrecar =in aults" class="frcr a2 18.&	42pa hecar =lhiddts" class="frlhi2 18)="include/clude/linux/kernel.h" c9.c#L6" i9d3.L6" class="line" nam93.1L15352 181        styuctv3	42pa hr1ecar 13ts" class="frivsize2 18 =v3	pa hrecar =r aults" class="frr a2 18-g.au&	42pa hrecar =ar aults" class="frar a2 18.&	42pa hgp/a>332 181                it="re="1inclu1e/linux/kernelss="frunlikely2 18(!3	42pa hrecar =IS_ALIGNEDults" clasfo2 18 =v3	42pa hrecar =kmallocults" class=! a2 18-g.au&	42pa hrecar =in aults" class="frcr a2 18.&	42pa hrecar =infoults" class="frinfo2 18="include/linux/kernel.h" c1.c#L14" ).c23.L13" class="line" nam1 L19392 151p/a>332 151p/a>32 261p	42pa hrecar =ou ults" 1class146ux/k_ablal/skciults" class="frinux7 *3	42pa hrecar =ctxults" class="frctx2 17 =v3	42pa hrecar =cnux/k_ablal/skci_ctxults" class="frcnux/k_aults"tx2 18(3	42pa hrecar =genults"tx="frgeniv2 18)="include/linux/kernel.h" c1.c#L16" idd3.L16" class="line" namvvL17472 181        3	42pa hrecar =k1 is u1ts" class="frkts" class="frnal/_r a ss 2 18 *3	42pa hrecar =subr aults" class="frsubr a2 18 =v3	recar =ivults" class="friv2ctxfrpto2 18, 3	42pa hr hrecar =ar aults" class="frar a2 18.&	42pa hrecar =ivults" class="friv2idd3.L16" class="line" namvvL182>2 181}"include/linux/kernel.h1" c4c14al/_givef="c_r a ss ults" class="frnal/_18 *3	42pa hrecar =subr aults" class="frsubr a2 18 =v3	42pa hrecar =nal/_givef="c_r actxults" class="frnal/_givef="c_r actx2 18(3	42pa hrecar =r aults" class="frr a2 18)="include/linux/kernel.h" c6c#L21" i63.L21" class="line" nam63.1L19492 151p/a>3333332 151p/a>33u2=v3.34.13. >
  vux/kernel.h" c1 >
  v14" idd3.L14" class="line" namvvL20702 181        3	42pa hrecar =m1emcpy1711" id33.L11" class="line" namv3L21712 151p/a>32 151p/a>32 17p//a>#include <33333332 2<"include/linux/kernel.h2 c1.c2L11" i9d3.L7" class="line" nam93.21.L2v112 28        3	42pa hrecar =2_comp21"5ef7d3.L2" class="line" nam73.23.L11122 28        3	42pa hrecar =2ataul2s" clanef="cults" class="frpto/s_givenecar =r "c2 18(_fir a ss 2 18 *3	42pagivenecar =r "c2 18(_fir afrr a="c_r a ss ults" classnal/_givef="c_r a ss 2 18 *3	42pa hrecar =r aults" class="frr a2 18 =v3	42pa hrecar = IV ults" class="f.c23.L13" class="line" nam123.L11132 28        3	42pa hrecar =2nfoul2s" claidd3.L19" class="line" namv23.L11">2 24"include/linux/kernel.h2 c1.c21mplete2ults" kciults" class="frinux/k_ablal	42pa hrecar =genivults" class="frgeniv2 18="include/linux/kernel.h" c6ass="5effmults" class="frnal/_givef="c_r atfm2 18(3	42pa hrecar =r aults" class="frr a2 18)="include/linux/kernel.h" c7c#L20" i73.L20" class="line" nam73.23.L11152 28        3	42pa hrecar =2vsize21nux/k_ablal/skciults" class="frinux7 *3	42pa hrecar =ctxults" class="frctx2 17 =v3	42pa hrecar =cnux/k_ablal/skci_ctxults" class="frcnux/k_aults"tx2 18(3	42pa hrecar =genults"tx="frgeniv2 18)="include/linux/kernel.h" c1.c#L16" idd3.L16" class="line" namv23.L11162 25p/a>32 28                       2     21_tults" class="frpps mock_t2ts" _classbh hrecar =ctxultss" _classbh="frgfrpto2 18, 3	42pa hr hrecar =h a ults" class="frp a 2 18, 3	42pa /linux/kernel.h" clc#L19" i id03.L12" class="line" namv23.L11192 28                3	42pa 2recar21zeults" class="frivsize2 18 g.aucar =genults"r(styuctv3	42pa hss="frcnults"r(="frgeniv2 18)="include/linux/kernel.h" c10c#L12" "frar a2 18.&	42pa hgp/"c2 18(styuctv3	42pa h=r "c2 18(frr =! a2 18-g.au&	42pa_givenecar =r "c2 18(_fir a ss 2 18 *3	42pagivenecar =r "c2 18(_fir afrr .c23.L13" class="line" nam123.L21202 28                       2     2         3	42pa hrecarfrou 2 18="include/lNEDlinux/kernel.h" clNEDlin18" id03.L18" class="line" namv23.L21212 28                       2     22"5ef7d3.L2" class="line" nam73.23.L11222 28                if (!3	22pa h22" class="frdata2 18 =v3	42pacar =genults"r(styuctv3	42pa hss="frcnults"r(="frgeniv2 18)="include/linux/kernel.h" c10c#L12" "frar a2 18.&	42pa hgp/"c2 18(styuctv3	42pa h=r "c2 18(frr = a2 18-g.au&	42pa_givenecar =r "c2 18( ss 2 18 *3	42pagivenecar =r "c2 18(18" id03.L18" class="line" namv23.L11132 2 sults" c#L3o1.2"
	  >
 2v3.1722" class="frinfo2 18 =v3	42pa hrecar =EINPROGRESSults" cignmaskults" class="frcrng_get_byte#include <#include <32 182        3	42pa hrecar =p2ps mo2219" id03.L19" class="line" namv2L19292 182        3	42pa hrecar =u28ults22zeults" class="frivsize2 18 g.auef="crypto/seqiv7.c#L7" idd3.L7" class="line" namv3.2L203>2 202}="include/linux/kernel.2h" c323        3	42pa hrecaramvv3.L2 21="include/linux/kernel.h" c10c#L18" id03.L18" class="line" namv2L21312 152p/a>32 132//a>pspa= class="comment2>3.17234" i89d3.L7" class="line" nam93.2L14342 182        styuctv3	42pa hr2ecar 2315" idd3.L15" class="line" namv2L15352 182        styuctv3	42pa hr2ecar 23ts" cnef="cults" class="frpto/s_givenini(styuctv3	42pa hrecar ini(frr a="c_r a ss ults" class =genivfm2 18(3	42pa hrec =genivfm2"frctx2 17 =v3	42pa hfm2 18(3	42pa hrecfm2"frcdd3.L7" class="line" namv3.2L.L11162 2p/a>32 182                it="re="2inclu23al/_givef="c_r a ss ults" class="fr7 *3	42pa hrecar =ctxults" class="frctx2 17 =v3	42pa hrecar =cnux/k_ablal/skci_ctxults" class="frcnux/k_ablal/skci_ctx2 18(3	42pa hrecar =genivults" class="frgeniv2 18)="include/linux/kernel.h" c10c#L12" id03.L12" class="line" namv2L19392 152p/a>332 132        3	42pa hrecar =g2enivu244" i8d3.L4" class="line" nam83.2L14442 182        3	42pa hrecar =m2emcpy244ar =infoultsamvv3.L2 21="include/l_ar =genivults"ini(styuctv3	42pa hrar =genivults"ini(frr a2 18)="include/fm2 18(3	42pa hrecfm2"frcd73.L20" class="line" nam73.2L154>2 152p/a>32 262p	42pa hrecar =ou ults" 2class247" i33.L17" class="line" nam33.2L17472 182        3	42pa hrecar =k2 is u2ts" clnef="cults" class="frpto/s_givenecar ini(styuctv3	42pa hrecar ecar ini(frr a="c_r a ss ults" class =genivfm2 18(3	42pa hrec =genivfm2"frctx2 17 =v3	42pa hfm2 18(3	42pa hrecfm2"frcdd3.L7" class="line" namv3.2L182>2 182}"include/linux/kernel.h2" c4c24al/_g8d3.L7" class="line" nam83.2L19492 152p/a>3332 152        3	42pa hrecar =p2al/sk256" i7d3.L6" class="line" nam73.2L16562 182}"include/linux/kernel.h2" c5c256givef="c_comamvv3.L2 21="include/lar =r ults"ini(styuctv3	42pa har =r ults"ini(frr a2 18)="include/fm2 18(3	42pa hrecfm2"frcd73.L20" class="line" nam73.2L17472 182p/a>3332 152p/a>3332 152p/a>32 172//a>#include <33332 172//a>#include <
 28(18L11132 2 suass="ti_givefts" class="frivsize233ts" clas3#L11" id03.L11" class="l3ne" n312" class="frcnux/k_ablal"c2 18(sel.h" clc#L19" i id03.L12" class="line" namv2L182>2 38 *3	42pa3ivenecar =r "c2 18(_fir 3frr a313"line" nam1vL18682 17" class="line" nam33. cl_PTb"frc, 0, 0d73.L cl_PTbass="line" nam73.2L15852 181                        1unsig1ed ptov3	42pa 3_r a ss 2318 *3	42pa hrecar =r aul3s" cl31gs="fs="complete2 18=craaexi(st3rgeniv2 13="include/linux/kernel.h3 c6as3="5effmults" cnux/"line" nam73.2L1i(s=p2toult29" class(s= <2 18)="inc/linux/kertypass="frp a 2 18,typa0802 ^ss="line" nam33.ef="cryALG_TYPE_AEAa href="crypto/sef="cryALG_TYPE_AEAa     " classs="line" nam33.ef="cryALG_TYPE_MASK href="crypto/sef="cryALG_TYPE_MASK.L12" class="line" namv2L182>2 38to2 18, 3tx2 17 =v3	42pa hrecar =3nux/k31ecar =ivults" class="v3	42pa hinne hrecar =r aultinne18" id03.L18" class="line" ntv3	42pa hr2ecar 2611" id33.L11" class="line" namv2L21612 182   line" nam73.2L1lass =genivinnefnca hreci_givefts" class="frivsize23include/l3nux/kernel.h" c1.c#L16" 3dd3.L31 i7d3.L6" claelse_givefts" class="frivsize23i88      3f="crypto/se2iv1.c21lts"3class31 ptov3	422pa h28kelyuv3	42pa hinne hrecar =r aultinne18" id03.L18" class="line" ntv3	42pr =p2to/s_2811" id33.L11" class="line" namv2Lline" nam73.2L1lass =genivinnefnca hreci_givefts" class="frivsize23itov3	42p3ass="frpps mock_t2ts" _c3assbh31ss="line" nam12L18882 152p/a>3<3.h" c10c#312" "frar a2 18.&	42pa h3p/"c2318(styuctv3	42&	42pafb 18(3	42pa hrecfb"frc, 0, 0d73.L20" class="line" nam73.2L16862 212{p/a>3#include <2 172//a>#include <
 2pu 2L11132 2 suass="ti_givefts" class="frivsize23auef="cry3to/seqiv7.c#L7" idd3.L7"3class33ref="crypto/slts" class="frunlikely2 18(IS_ERR 18(3	42pa hrecIS_ERRfrr a2 18)="includ3e/linux/k3rnel.2h" c323        3	43pa hr3caramvs="line" nam12L18682 152   3t voidv3	32pa hreca2r =pt23car =in3oults33ctv3	42pa hrs" _classini(="frgf3 "c2 18(s3yuctv3	42pa hrecar ecar 3r "c2318(frr692 182caux/a hrecar =p2to/nults"fre3.L15" class="linults"fre3amv2L21712 152        3	42ppa hrecfb"frcdd3.L7" class="line" namv3.2L12822 182}"include/linux/kernel.h2" c8.283" i68d3.Lo/se2qiv8.287" i33.L17" cla3el.h" c7c3L20" i73.L20" class="lin3" nam33.2313ultrecar e_ivs/s hrfrr a="c3"cults" c3ass="frpto/s_givenini(st3uctv333="frp a 2 18, 3	4"line" nam73.2L16862 212{p/a>32 3ts" class3=genivfm2 18(3	42pa hrec3=geni33L6" class="line" nam7a hrecar =p2to/ninfo2 18 =v3	4fre3.L15" class="lininfo2 18 =v3	4fre3ass="line" nam73.2L16862 212{p/a>33
 2pu 2L11132 2 sults" c#L3o1.2"
	  >
 2pu 2L11132 2 suass="ti_givefts" class="frivsize23omplete2u3ts" class="frpts" _class3ni(st3uctv3	s="line" nam12L18682 152   3pto2 18, 3	42pa hr hrecar =h a ult3" cla342pa hrecaux/k_conivults" clci_i32pa hreca3 =tvults" class="fs="com3lete2318=c#L472 182p/a>3"rfrr "3<3s="frgeni32 18="include/linux/kern3l.h" 36ass="4>2 152p/a>32 3class="fr3tx2 17 =v3	42pa hrecar =3nux/k3ablal/ultrecar e_ivs/s hrfrr a="c3/k_aults"3x2 18(3	42pa hrecar =gen3lts"t3="frgeniv2 18)7" class="line" nam33.line" nregist 18#25car =9d3.L7" class="line" nregist 18#25car =ass="d3.L15" class="line" namv2L15852 182                       ti_givefts" class="frivsize23ass="frda3a2 18 =v3	42pats" _class3ni(st35vv3.L2 21="include/l_givenecar =3pto2 18, 3	42pa hr hrecar =h a ult3" cla35gs="fs="complete2 18=craaexi(st32pa hc ta3	42pa hrecar =genivut cl3ss="f35.2313">2 132caux/a hrecar =p2to/_car =p2toult29" clas_ne" namv2L class="line" ntv3	42modul3lk2 is u27" class="frv3	42modul3lk2 iass="caux" class="line" namv2L182>2 3ccults" c31kci_ctx="fru64 ss ults"3class352pa hrecar ini(frr a="c_r a ss u3562 182}"3nclude/linux/kernel.h2" 35c25635 i7d3.L6" class="line" nam73line" nunregist 18#25car =9d3.L7" class="line" nunregist 18#25car =ass="d3.L15" class="line" namv2L15852 182                       ti_givefts" class="frivsize23aass="frk3ini(styuctv3	42pa har =r3ults"3ni(frr2 21="include/l_givenecar =3p 17 =v3	32"frcd73.L20" class="lin3" nam35ss="line" nam12L18882 152p/a>3<33"GPL""Sm2 1nce Number IV Generator"


The original LXR software by the givefts" http://sourceforge.net/projects/lx1">LXR communuxul"c2, this experimental version by givefts" mailto:lx1@=r ux.no">lx1@=r ux.no 42pa
lx1.=r ux.no kindly host d by givefts" http://www.redpill-=r pro.no">Redpill Lr pro ASl"c2, provider of Lr ux cons32 isu and operations services since 1995.