linux/crypto/camellia_generic.c
<<
232323./spa"v223.spa" class="lxr_search">2323 v2.">2323Search2323./spa"v223.input typv2.hidden" name="ajax_lookup" id="ajax_lookup" > v2.">22 .div id="file_contents"v
3 31./a>.spa" class="comment">/*./spa"v23 32./a>.spa" class="comment"> * Copyright (C) 2006./spa"v23 33./a>.spa" class="comment"> * NTT (Nipp	  Telegraph and Telephone Corporaue=")../spa"v23 34./a>.spa" class="comment"> *./spa"v23 35./a>.spa" class="comment"> * This program is free software; you ca" redistribute it and/or./spa"v23 36./a>.spa" class="comment"> * modify it under the terms of the GNU General Public License./spa"v23 37./a>.spa" class="comment"> * as published by the Free Software Foundaue="; either vers
	  2./spa"v23 38./a>.spa" class="comment"> * of the License, or (at your alue=") any later vers
	 ../spa"v23 39./a>.spa" class="comment"> *./spa"v23 ion a>.spa" class="comment"> * This program is distributed in the hope that it will be useful,./spa"v23 11./a>.spa" class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of./spa"v23 12./a>.spa" class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the./spa"v23 13./a>.spa" class="comment"> * GNU General Public License for more details../spa"v23 14./a>.spa" class="comment"> *./spa"v23 15./a>.spa" class="comment"> * You should have received a copy of the GNU General Public License./spa"v23 16./a>.spa" class="comment"> * along with this program; if not, write to the Free Software./spa"v23 17./a>.spa" class="comment"> * Foundaue=", Inc., 59 Temple Place - Suite 330, Bost=", MA  02111-1307, USA../spa"v23 18./a>.spa" class="comment"> */./spa"v23 19./a>23 2on a>.spa" class="comment">/*./spa"v23 21./a>.spa" class="comment"> * Algorithm Specificaue="./spa"v23 22./a>.spa" class="comment"> *  http://info.isl.ntt.co.jp/crypt/eng/camellia/specificaue="s.html./spa"v23 23./a>.spa" class="comment"> */./spa"v23 24./a>23 25./a>.spa" class="comment">/*./spa"v23 26./a>.spa" class="comment"> *./spa"v23 27./a>.spa" class="comment"> * NOTE --- NOTE --- NOTE --- NOTE./spa"v23 28./a>.spa" class="comment"> * This implementaue=" assumes that all memory addresses passed./spa"v23 29./a>.spa" class="comment"> * as parameters are four-byte aligned../spa"v23 3on a>.spa" class="comment"> *./spa"v23 31./a>.spa" class="comment"> */./spa"v23 32./a>23 33./a>#include <linux/crypto.h./a>>23 34./a>#include <linux/errno.h./a>>23 35./a>#include <linux/init.h./a>>23 36./a>#include <linux/kernel.h./a>>23 37./a>#include <linux/module.h./a>>23 38./a>#include <linux/bitops.h./a>>23 39./a>#include <>23 32v2	33.a hrecode=pto/camelsp  00"L32" class="frpto/camelsp  003 32[256] = {./a>2223 32vvvvvvvv0x40404000,v0x28282800,v0xd3d3d300,v0x7b7b7b00,./a>2222>223 32v2	33.a hrecode=pto/camelsp022="L32" class="frpto/camelsp022=3 32[256] = {./a>22222223 32v2	33.a hrecode=pto/camelsp3033"L32" class="frpto/camelsp30333 32[256] = {./a>2222223 32vvvvvvvv0x19001919,v0x87008787,v0x4e004e4e,v0x0b000b0b,./a>222222222223 32v2	33.a hrecode=pto/camelsp4404"L32" class="frpto/camelsp44043 32[256] = {./a>222222223 32vvvvvvvv0x25250025,v0x42420042,v0xa2a200a2,v0xfafa00fa,./a>22222>2/*2 * NB: L and R below stand for 'left' and 'right' as in written numbers.2 * That is, in (xxxL,xxxR) pair xxxL holds most significant digits,2 * _not_ least significant ones!2 */2/* key ccautants */2/*2 *  macros2 */223 32v*2	33.a hrecode=subkey"L32" class="frsubkey3 32,v2	33.a hrecode=ud="L32" class="fru">3 32v*2	33.a hrecode=subL"L32" class="frsubL3 32,v2	33.a hrecode=ud="L32" class="fru">3 32v*2	33.a hrecode=subR"L32" class="frsubR3 32,vintv2	33.a hrecode=max"L32" class="frmax3 32)./a>23 32v2	33.a hrecode=dw"L32" class="frdw3 32,v2	33.a hrecode=tl"L32" class="frtl3 32,v2	33.a hrecode=tr"L32" class="frtr3 32;./a>23 32v2	33.a hrecode=kw4l"L32" class="frkw4l3 32,v2	33.a hrecode=kw4r"L32" class="frkw4r3 32;./a>2/* absorb kw2 to other subkeys */2/* round 2 */2/* round 4 */2/* round 6 */2/* modified for FLinv(kl2) */2/* round 8 */2/* round 10 */2/* round 12 */2/* modified for FLinv(kl4) */23 32vvvvvvvv/* round 14 */2/* round 16 */2/* round 18 */2/* kw3 */2/* absorb kw4 to other subkeys */2/* modified for FLinv(kl6) */2/* round 20 */2/* round 22 */23 32vvvvvvvvvvvvvvvv2spanL15" clacomment">/* round 24 */2/* kw3 */2/* absorb kw4 to other subkeys */2/* round 23 */2/* round 21 */2/* round 19 */2/* absorb kw4 to other subkeys */2/* round 17 */2/* round 15 */2/* round 13 */2/* absorb kw4 to other subkeys */2/* round 11 */2/* round 9 */2/* round 7 */2/* absorb kw4 to other subkeys */2/* round 5 */2/* round 3 */2/* round 1 */2/* kw1 */2/* key XOR is end of F-function */2/* kw1 */2/* round 1 */22222/* L27^
1) */2/* absorb kw4 to other subkeys */22/* L27^
1) */2/* L2inv(kl2) */2/* L2inv(kl2) */2/* absorb kw4 to other subkeys */2222223 32vvvvvvvv2	33.a hrecode=dw"L32" class="frdw3 32 =v2	33.a hrecode=tl"L32" class="frtl3 32 & 2	33.a hrecode=subL"L32" class="frsubL3 32[16], 2spanL15" clacomment">/* L27^
3) */2/* absorb kw4 to other subkeys */22/* L27^
3) */2/* L2inv(kl4) */2/* L2inv(kl4) */2/* absorb kw4 to other subkeys */2222223 32vvvvvvvv2	33.a hrecode=SUBKEY_R"L32" class="frSUBKEY_R3 32(22) =v2	33.a hrecode=subR"L32" class="frsubR3 32[21] ^v2	33.a hrecode=subR"L32" class="frsubR3 32[23];./a>2/* round 18 */22/* L27^
5) */2/* absorb kw4 to other subkeys */22/* L27^
5) */2/* L2inv(kl6) */2/* L2inv(kl6) */2/* absorb kw4 to other subkeys */222222/* round 24 */223 32v*2	33.a hrecode=subkey"L32" class="frsubkey23 32v2	33.a hrecode=kll"L32" class="frkll3 32v2	33.a hrecode=il"L32" class="fril3 32v2	33.a hrecode=subL"L32" class="frsubL3 32[26]/./a>23 32v2	33.a hrecode=subR"L32" class="frsubR3 32[26]/./a>222/* absorb kw4 key"L28" class="frkey2/* absorb kw4 key"L28" class="frkey2/* absorb kw4 key"L28" class="frkey2/* absorb kw4 key"L28" class="frkey2/* lia_gate KL dependent subkeysv*/2/* kw1 */2/* kw2 */2/* rotation left shift 15bit */2/* absorb kw4 kll"L32" class="frkll/* k3 */2/* k4 */2/* rotation left shift 15+30bit */2/* absorb kw4 kll"L32" class="frkll/* k7 */2/* k8 */2/* rotation left shift 15+30+15bit */2/* absorb kw4 kll"L32" class="frkll/* k10 */2/* rotation left shift 15+30+15+17 bit */2/* absorb kw4 kll"L32" class="frkll/* kl3 */2/* kl4 */2/* rotation left shift 15+30+15+17+17 bit */2/* absorb kw4 kll"L32" class="frkll3 32vvvvvvvv2spanL15" clacomment">/* k13 */2/* k14 */2/* rotation left shift 15+30+15+17+17+17 bit */2/* absorb kw4 kll"L32" class="frkll/* k17 */2/* k18 */2/* lia_gate KA */2/* absorb kw4 kll"L32" class="frkll/* absorb kwe=krl"L32" class="frkrl3 32vvvvvvvvvvvvvvvvpan2	33.a hrecow4 kll"L32" class="frkllcurrenden rous  k ("fr, || , w0, w1kl6) */2/* absorb kw4 kll"L32" class="frkll/* absorb kwe=krl"L32" class="frkrl3 32./a>2/* lia_gate KL dependent subkeysv*/2/*, | kw2 */2/* absorb kw4 kll"L32" class="frkll/5,kd 16 */2/* absorb kw4 kll"L32" class="frkll3 32vvvvvvvv/**, |l kw2 */2/* absorb kw4 kll"L32" class="frkll/d 19 */2/* absorb kw4 kll"L32" class="frkll/**, |1 kw2 */23 32vvvvvvvv2	33.a hrecode=ROo_bevvvvvv/* absorb kw4 kll"L32" class="frkllk15, |1d 16 */2/* absorb kw4 kll"L32" class="frkllkw3, |w k14 */22/* absorb kde=subkey"L32" class="frsubkey3 32}./a>223 32v*2	33.a hrecode=subkey"L32" class="frsubkey223 32v2	33.a hrecode=kll"L32" class="frkllon lehalf of subk14 */23 32v2	33.a hrecodre=kll"L32" class="rfrkll/ighlehalf of subk14 */23 32v2	33.a hrecode=il"L32" class="friltemporary variablekeysv*/23 32v2	33.a hrecode=subL"L32" class="frsubL3 32[24]/./a>23 32v2	33.a hrecode=subR"L32" class="frsubR3 32[24]/./a>223 32vvvvvvvv22/* absorb kw4 key"L28" class="frkey2/* absorb kw4 key"L28" class="frkey2/* absorb kw4 key"L28" class="frkey2/* absorb kw4 key"L28" class="frkey2/* absorb kw4 key"L28" class="frkey2/* absorb kw4 key"L28" class="frkey23 32vvvvvvan2	33.a hrecodee=krl"L32" class="ffrkrl< 32 =v2	33.a hrecode=get_unaligned_bevvvvvv/* absorb kw4 key"L28" class="frkey2/* absorb kw4 key"L28" class="frkey22/* kw1 */2/* kw2 */2/* absorb kw4 kll"L32" class="frkll/d 19 */23 32vvvvvvan2	33.a hrecode=subL"L32" class="frsubL3 32[22] =v2	33.a hrecode=kll"L32" class="frkllk1 k10 */2/* absorb kw4 kll"L32" class="frkll/* kl3 */2/* kl4 */2/* absorb kw4 kll"L32" class="frkll/* k17 */23 32vvvvvvan2	33.a hrecode=subL"L32" class="frsubL3 32[22] =v2	33.a hrecode=kll"L32" class="frkllk1 k18 */2/* absorb kw4 kll"L32" class="frkllk2 kl3 */2/2 kl4 */22/* lia_gatR KL dependent subkeysv*/23 32vvvvvvvv2	33.a hrecode=ROLDQ"L32" class="frROLDQment">/* absorb kwre=kll"L32" class="rfrkll/* k3 */2/* absorb kwre=kll"L32" class="rfrkll/* kw1 */2/* kw2 */23 32vvvvvvvv2	33.a hrecode=ROLDQ"L32" class="frROLDQment">/* absorb kwre=kll"L32" class="rfrkll/* k13 */2/* absorb kwre=kll"L32" class="rfrkll/*d 19 */2/2 k10 */23 32vvvvvvvv2	33.a hrecode=ROo_bevvvvvv/* absorb kwre=kll"L32" class="rfrkll2/* lia_gate KA */2/* absorb kw4 kll"L32" class="frkll/* absorb kwe=krl"L32" class="frkrl3 32vvvvvvvvvvvvvvvvvvv2	33.a hrecode=CAMELLIA_SI2MA1L"L32" class="frCAMELLIA_SI2MA1L/* absorb kw4 kll"L32" class="frkll/* absorb kwe=krl"L32" class="frkrl3 32vvvvvvvv2	33.a hrecode=kll"L32" class="frkll2/* lia_gatB KA */2/* absorb kwre=kll"L32" class="rfrkll/* absorb kwre=krl"L32" class="ffrkrl3 32vvvvvvvvvvvvvvvvvvv2	33.a hrecode=CAMELLIA_SI6MA1L"L32" class="frCAMELLIA_SI6MA1L2/* lia_gate KL dependent subkeysv*/2/* absorb kw4 kll"L32" class="frkll/5eysv*/2/d 16 */23 32vvvvvvvv2	33.a hrecode=ROLDQ"L32" class="frROLDQment">/* absorb kw4 kll"L32" class="frkll/* kw1 */2rottenat>on leshi le32bitkw2 */2/*5eysv*/2/*d 16 */23 32vvvvvvvvrottenat>on leshi le49 from>/**,/* k-> k2*,/2 kw2 */2/* absorb kw4 kll"L32" class="frkllk2*kw2 */2/2 kw2 */22/* lia_gatB KL dependent subkeysv*/2/*kw2 */23 32vvvvvvvvk kw2 */2/* absorb kwre=kll"L32" class="rfrkllk k18 */2/* absorb kwre=kll"L32" class="rfrkll/*5eysv*/23 32vvvvvvvvk1d 16 */2/* absorb kwre=kll"L32" class="rfrkllkw k14 */22/* absorb knt sububR"L32" class="fr"frkey232././a>2223 nt">/* absorb kwre=kll"L32" class="rfrkll2/* absorb kwkkey"L28" class="kubR3/span2	33.a hrecod4 key"L28" class="frkey2/* absorb kwre=kll"L32" class="rfrkll/* absorb kwre=klr"L32" class="rfrklr3 32vvvvvvvv2	33.a hrecode==krr"L32" class="frrkrr3 = ~ =v2	33.a hrecodre=klr"L32" class="rfrklr<15././a>2/* absorb kwkkey"L28" class="kubR3+24, (unsnalig char *)&nt">/* absorb kwre=krl"L32" class="ffrkrl2/* absorb kwkkey"L28" class="kubR3+28, (unsnalig char *)&nt">/* absorb kwre=krr"L32" class="frrkrr3 3 + 4././a>2/* absorb kwkkey"L28" class="kubR3/span2	33.a hrecont sububR"L32" class="fr"frkey<) 4././a>22222223#deflasspan2	33.a hreco"frCAMELLILSubR"L32" class="frCAMELLILS6163ent">/* absorb ke=kll"L32" class=frkll222/* absorb kde=t0"L32" class="frt0223 32vvvvvvvv2	33.a hrecode=t1"L32" class="frt1<[|5] =v2	33.a hrecoe=klr"L32" class=frklr2/* absorb kd3evvvvvv222/* absorb kx=kll"L32" class=xrkrl/* absorb ku8=t0"L32" class=u35683)pan2	33.a hrecox=krr"L32" class=xrkrr3]/ssssssssssssssssssssssssssssssssss\an4./a>2/* absorb ku8=t0"L32" class=u35683)ent">/* absorb kx=kll"L32" class=xrkrl< >> 24)]/ssssssssssssssssssssssssss\an4./a>23 32vvvvvvvv2	33.a hrecode=ir"L32" class="frir<[sp ^=v2	33.a hrecocrypto/casp022bevvvvvv/* absorb ku8=t0"L32" class=u35683)ent">/* absorb kx=krr"L32" class=xrkrr3 >> 24)]/ssssssssssssssssssssssssss\an4./a>2/* absorb ku8=t0"L32" class=u35683)ent">/* absorb kx=kll"L32" class=xrkrl< >> 16)]/ssssssssssssssssssssssssss\an4./a>2/* absorb ku8=t0"L32" class=u35683)ent">/* absorb kx=krr"L32" class=xrkrr3 >> 16)]/ssssssssssssssssssssssssss\an4./a>2/* absorb ku8=t0"L32" class=u35683)ent">/* absorb kx=kll"L32" class=xrkrl< >> 8)]/sssssssssssssssssssssssssss\an4./a>2/* absorb ku8=t0"L32" class=u35683)ent">/* absorb kx=krr"L32" class=xrkrr3 >> 8)]/sssssssssssssssssssssssssss\an4./a>2/* absorb ku8=t0"L32" class=u35683)nt">/* absorb kx=kll"L32" class=xrkrl<]/ssssssssssssssssssssssssssssssssss\an4./a>2/* absorb kde=il"L32" class="fril232././a>2max[4]24: 128bitken href,>max[4]32: 256bitken href *4 */2/* absorb ku_bevvvvvv3 * =v2	33.a hrecont sububR"L32" class="fr"frkey3 * =v2	33.a hrecoio=ir"L32" class="okey223 nt">/* absorb kde=il"L32" class="friltemporary variablekeysv*/22pre whitening but absorb kw kw2 */22223 32vvvvvvvvmain itertenat>w2 */2/* absorb kd=ir"L32" class="rir<) ({ \an4./a>2/* absorb kio=ir"L32" class="okey< 32/span2	33.a hrecodo=ir"L32" class="okey< 12, \an4./a>2/* absorb kd=ir"L32" class="rir< + 2)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 2)/s\an4./a>2/* absorb kio=ir"L32" class="okey< 22/span2	33.a hrecodo=ir"L32" class="okey< 32/s\an4./a>2/* absorb kd=ir"L32" class="rir< + 3)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 3)/s\an4./a>2/* absorb kio=ir"L32" class="okey< 32/span2	33.a hrecodo=ir"L32" class="okey< 12, \an4./a>2/* absorb kd=ir"L32" class="rir< + 4)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 4)/s\an4./a>23 32vvvvvvvvvvvvvvvv2vvvvvvvv2	33.a hrecodo=ir"L32" class="okey< 22/span2	33.a hrecodo=ir"L32" class="okey< 32/span2	33.a hrecode=il"L32" class="fril/* absorb kio=ir"L32" class="okey< 22/span2	33.a hrecodo=ir"L32" class="okey< 32/s\an4./a>2/* absorb kd=ir"L32" class="rir< + 5)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 5)/s\an4./a>2/* absorb kio=ir"L32" class="okey< 32/span2	33.a hrecodo=ir"L32" class="okey< 12, \an4./a>2/* absorb kd=ir"L32" class="rir< + 6)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 6)/s\an4./a>2/* absorb kio=ir"L32" class="okey< 22/span2	33.a hrecodo=ir"L32" class="okey< 32/s\an4./a>2/* absorb kd=ir"L32" class="rir< + 7)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 7)/s\an4./a>22/* absorb kd=ir"L32" class="rir<) ({ \an4./a>2/* absorb kio=ir"L32" class="okey< 32/span2	33.a hrecodo=ir"L32" class="okey< 12, pan2	33.a hrecodo=ir"L32" class="okey< 22/span2	33.a hrecodo=ir"L32" class="okey< 32/s\an4./a>2/* absorb kd=ir"L32" class="rir< + 0)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 0)/s\an4./a>2/* absorb kd=ir"L32" class="rir< + 1)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 1)/s\an4./a>222223 32vvvvvvvv2	33.a hrecoROUNDSubR"L32" class=ROUNDS6163e8 30././a>222/* absorb kmax=ir"L32" class=max5683 ==33+  {2././a>222222232././a>2post whitening but kw k14 */2/* absorb kmax=ir"L32" class=max5683+ 4././a>2/* absorb kmax=ir"L32" class=max5683+ 4././a>2NB: io 32/ 12 should be swapped with  22/ 32 by caller!k14 */222/* absorb ku_bevvvvvv3 * =v2	33.a hrecont sububR"L32" class="fr"frkey3 * =v2	33.a hrecoio=ir"L32" class="okey23 nt">/* absorb kde=il"L32" class="friltemporary variablekeysv*/232././a>2pre whitening but absorb kw kw2 */22main itertenat>w2 */2/* absorb kd=ir"L32" class="rir<) ({ \an4./a>2/* absorb kio=ir"L32" class="okey< 32/span2	33.a hrecodo=ir"L32" class="okey< 12, \an4./a>2/* absorb kd=ir"L32" class="rir< + 7)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 7)/s\an4./a>23 32vvvvvvvv2	33.a hrecode=CAMELLROUNDSMubR"L32" class="frCAMELLROUNDSM6163ent">/* absorb kio=ir"L32" class="okey< 22/span2	33.a hrecodo=ir"L32" class="okey< 32/s\an4./a>2/* absorb kd=ir"L32" class="rir< + 6)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 6)/s\an4./a>2/* absorb kio=ir"L32" class="okey< 32/span2	33.a hrecodo=ir"L32" class="okey< 12, \an4./a>2/* absorb kd=ir"L32" class="rir< + 5)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 5)/s\an4./a>2/* absorb kio=ir"L32" class="okey< 22/span2	33.a hrecodo=ir"L32" class="okey< 32/s\an4./a>2/* absorb kd=ir"L32" class="rir< + 4)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 4)/s\an4./a>2/* absorb kio=ir"L32" class="okey< 32/span2	33.a hrecodo=ir"L32" class="okey< 12, \an4./a>23 32vvvvvvvvvvvvvvvv2vvvvvvvv2	33.a hrecoSUBKEY_subL"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 3)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 3)/s\an4./a>2/* absorb kio=ir"L32" class="okey< 22/span2	33.a hrecodo=ir"L32" class="okey< 32/s\an4./a>2/* absorb kd=ir"L32" class="rir< + 2)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 2)/s\an4./a>22/* absorb kd=ir"L32" class="rir<) ({ \an4./a>2/* absorb kio=ir"L32" class="okey< 32/span2	33.a hrecodo=ir"L32" class="okey< 12, pan2	33.a hrecodo=ir"L32" class="okey< 22/span2	33.a hrecodo=ir"L32" class="okey< 32/s\an4./a>2/* absorb kd=ir"L32" class="rir< + 1)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 1)/s\an4./a>2/* absorb kd=ir"L32" class="rir< + 0)/span2	33.a hrecoSUBKEY_subR"L32" class=SUBKEY_s6163ent">/* absorb kd=ir"L32" class="rir< + 0)/s\an4./a>23 32vvvvvvvvvvvvvvvv2vpan2	33.a hrecode=t0"L32" class="frt022/* absorb kd=ir"L32" class="rir< ==33+  {2././a>22222223 32vvvvvvvv2	33.a hrecoILSubR"L32" class=ILS6163e8 30././a>222222post whitening but kw k14 */222NB: 0,1 should be swapped with 2,3 by caller!k14 */23}2././a>222/* absorb kcrypto/cactx=ir"L32" class=crypto/cactx6083 {2././a>2/* absorb kkey_length=ir"L32" class=key_length526330././a>23 nt">/* absorb kkey_table=ir"L32" class=key_tablekey< vvv2	33.a hreco"frCAMELLTABLE_BYTE_LENubR"L32" class="frCAMELLTABLE_BYTE_LEN55>3 / sizeofent">/* absorb ku_bevvvvvv3)]30././a>2222/* absorb kcrypto/caset_sububR"L32" class=crypto/caset_sub6163estruct nt">/* absorb kchref=_tfmubR"L32" class=chref=_tfm55>3 * =v2	33.a hrecotfmubR"L32" class=tfm55>3, const nt">/* absorb ku8=t0"L32" class=u35683 * =v2	33.a hrecoin_sububR"L32" class=in_sub55>3,an4./a>23 32vvvvvvvvvvvvvvunsnalig int nt">/* absorb kkey_len=ir"L32" class=key_len55>3)an4./a>22/* absorb kcrypto/cactx=ir"L32" class=crypto/cactx6083 * =v2	33.a hrecocctx=ir"L32" class=cctx6083 p ^=v2	33.a hrecochref=_tfmactx=ir"L32" class=chref=_tfmactx6163ent">/* absorb ktfmubR"L32" class=tfm55>3 30././a>23 p (const unsnalig char *)nt">/* absorb kin_sububR"L32" class=in_sub55>330././a>23 * =v2	33.a hrecoflagsevvvvvv3 p &nt">/* absorb ktfmubR"L32" class=tfm55>3->^=v2	33.a hrecocht_flagsevvvvvv330././a>22/* absorb kkey_len=ir"L32" class=key_len55>3 != 16 && nt">/* absorb kkey_len=ir"L32" class=key_len55>3 != 24 && nt">/* absorb kkey_len=ir"L32" class=key_len55>3 != 3+  {2././a>23 |5] =v2	33.a hrecoCRYPTO_TFM_RES_BAD_KEY_sENubR"L32" class="RYPTO_TFM_RES_BAD_KEY_sEN55>330././a>2330././a>2232././a>2330././a>22/* absorb kkey_len=ir"L32" class=key_len55>3  {2././a>22/* absorb kcrypto/casetup128=t0"L32" class=crypto/casetup1286163ent">/* absorb ksububR"L32" class=sub55>3/span2	33.a hrecocctx=ir"L32" class=cctx6083->^=v2	33.a hrecokey_table=ir"L32" class=key_tablekey< 30././a>22210ic61ss="line" nam4e="Lnt">/* absorb kcrypto/casetup19bevvvvvv/* absorb ksububR"L32" class=sub55>3/span2	33.a hrecocctx=ir"L32" class=cctx6083->^=v2	33.a hrecokey_table=ir"L32" class=key_tablekey< 30./pre>
././a>210i35813 32vvvvvvvvvvvvvbreak30././a>210i25263 32vvvvvcase 32:2././a>210i35833 32vvvvvnam4e="Lnt">/* absorb kcrypto/casetup2 i55="L36" panL15crypto/casetup2525263ent">/* absorb ksububR"L32" class=sub55>3/span2	33.a hrecocctx=ir"L32" class=cctx6083->^=v2	33.a hrecokey_table=ir"L32" class=key_tablekey< 30././a>210i36043 32vvvvvvvvvvvvvbreak30././a>210i55813 32vvvvv}2././a>210i252632././a>210i161ss="line" return 030././a>210i855>3}2././a>210i36093an4./a>210 i5203sttenc voidvvvv2	33.a hrecocrypto/caen href60d="L4" panL15crypto/caen href6163estruct nt">/* absorb kchref=_tfmubR"L32" class=chref=_tfm55>3 * =v2	33.a hrecotfmubR"L32" class=tfm55>3, nt">/* absorb ku8=t0"L32" class=u35683 * =v2	33.a hrecoouf60d="L4" panL15ouf55>3, const nt">/* absorb ku8=t0"L32" class=u35683 * =v2	33.a hrecoinubR"L32" class=in55>3)an4./a>210 15833{2././a>210 25263 32vvvvvconst struct nt">/* absorb kcrypto/cactx=ir"L32" class=crypto/cactx6083 * =v2	33.a hrecocctx=ir"L32" class=cctx6083 p ^=v2	33.a hrecochref=_tfmactx=ir"L32" class=chref=_tfmactx6163ent">/* absorb ktfmubR"L32" class=tfm55>3 30././a>210 35263 32vvvvvconst nt">/* absorb k__be_bevvvvvv3 p (const nt">/* absorb k__be_bevvvvvv/* absorb kinubR"L32" class=in55>330././a>210 16143 32vvvvvvvv2	33.a hreco__be_bevvvvvv3 p (nt">/* absorb k__be_bevvvvvv/* absorb kouf60d="L4" panL15ouf55>330././a>210 55813 32vvvvvunsnalig int nt">/* absorb kmax=ir"L32" class=max568330././a>210 252632././a>210 36073 32vvvvvvvv2	33.a hrecou_bevvvvvv3 nt">/* absorb ktmpubR"L32" class=tmpkey< 4]30././a>210 3588332/./a>210 35693 32vvvvvvvv2	33.a hrecotmpubR"L32" class=tmpkey< 0] p ^=v2	33.a hrecobe_b_f=_cpuubR"L32" class=be_b_f=_cpu6163ent">/* absorb ksrcevvvvvv3 0] 30././a>210 i5693 32vvvvvvvv2	33.a hrecotmpubR"L32" class=tmpkey< 1] p ^=v2	33.a hrecobe_b_f=_cpuubR"L32" class=be_b_f=_cpu6163ent">/* absorb ksrcevvvvvv3 1] 30././a>210 36013 32vvvvvvvv2	33.a hrecotmpubR"L32" class=tmpkey< 2] p ^=v2	33.a hrecobe_b_f=_cpuubR"L32" class=be_b_f=_cpu6163ent">/* absorb ksrcevvvvvv3 2] 30././a>210 358>3 32vvvvvvvv2	33.a hrecotmpubR"L32" class=tmpkey< 3] p ^=v2	33.a hrecobe_b_f=_cpuubR"L32" class=be_b_f=_cpu6163ent">/* absorb ksrcevvvvvv3 3] 30././a>210 161332././a>210 16143 32vvvvvif ent">/* absorb kcctx=ir"L32" class=cctx6083->^=v2	33.a hrecokey_length=ir"L32" class=key_length5263[4= 16)an4./a>210 35653 32vvvvvvvvvvvvvnt">/* absorb kmax=ir"L32" class=max5683[4]2430././a>210 25263 32vvvvvelse0././a>210 161ss="line" nam4e="Lnt">/* absorb kmax=ir"L32" class=max5683[4]32;vvvvfor key lengths of 24 and]32k14 */210 3588332/./a>210 35693 32vvvvvvvv2	33.a hrecocrypto/cado_en href60d="L4" panL15crypto/cado_en href6163epan2	33.a hrecocctx=ir"L32" class=cctx6083->^=v2	33.a hrecokey_table=ir"L32" class=key_tablekey210 i588332/./a>210 16083 32vvvvvvvvdo_en href returns 0,1 swapped with 2,3 14 */210 358>3 32vvvvvvvv2	33.a hrecodsf60d="L4" panL15dsf55>3 0] p ^=v2	33.a hrecocpu_f=_be_bevvvvvv/* absorb ktmpubR"L32" class=tmpkey< 2]+ 4././a>210 35833 32vvvvvvvv2	33.a hrecodsf60d="L4" panL15dsf55>3 1] p ^=v2	33.a hrecocpu_f=_be_bevvvvvv/* absorb ktmpubR"L32" class=tmpkey< 3] 30././a>210 16143 32vvvvvvvv2	33.a hrecodsf60d="L4" panL15dsf55>3 2] p ^=v2	33.a hrecocpu_f=_be_bevvvvvv/* absorb ktmpubR"L32" class=tmpkey< 0] 30././a>210 36053 32vvvvvvvv2	33.a hrecodsf60d="L4" panL15dsf55>3 3] p ^=v2	33.a hrecocpu_f=_be_bevvvvvv/* absorb ktmpubR"L32" class=tmpkey< 1] 30././a>210 655>3}2././a>210 360732././a>210 85203sttenc voidvvvv2	33.a hrecocrypto/cade href=ir"L32" class=crypto/cade href6163estruct nt">/* absorb kchref=_tfmubR"L32" class=chref=_tfm55>3 * =v2	33.a hrecotfmubR"L32" class=tfm55>3, nt">/* absorb ku8=t0"L32" class=u35683 * =v2	33.a hrecoouf60d="L4" panL15ouf55>3, const nt">/* absorb ku8=t0"L32" class=u35683 * =v2	33.a hrecoinubR"L32" class=in55>3)an4./a>210 95833{2././a>210 i5263 32vvvvvconst struct nt">/* absorb kcrypto/cactx=ir"L32" class=crypto/cactx6083 * =v2	33.a hrecocctx=ir"L32" class=cctx6083 p ^=v2	33.a hrecochref=_tfmactx=ir"L32" class=chref=_tfmactx6163ent">/* absorb ktfmubR"L32" class=tfm55>3 30././a>210 15263 32vvvvvconst nt">/* absorb k__be_bevvvvvv3 p (const nt">/* absorb k__be_bevvvvvv/* absorb kinubR"L32" class=in55>330././a>210 358>3 32vvvvvvvv2	33.a hreco__be_bevvvvvv3 p (nt">/* absorb k__be_bevvvvvv/* absorb kouf60d="L4" panL15ouf55>330././a>210 35833 32vvvvvunsnalig int nt">/* absorb kmax=ir"L32" class=max568330././a>210 161432././a>210 36053 32vvvvvvvv2	33.a hrecou_bevvvvvv3 nt">/* absorb ktmpubR"L32" class=tmpkey< 4]30././a>210 252632././a>210 36073 32vvvvvvvv2	33.a hrecotmpubR"L32" class=tmpkey< 0] p ^=v2	33.a hrecobe_b_f=_cpuubR"L32" class=be_b_f=_cpu6163ent">/* absorb ksrcevvvvvv3 0] 30././a>210 35683 32vvvvvvvv2	33.a hrecotmpubR"L32" class=tmpkey< 1] p ^=v2	33.a hrecobe_b_f=_cpuubR"L32" class=be_b_f=_cpu6163ent">/* absorb ksrcevvvvvv3 1] 30././a>210 35693 32vvvvvvvv2	33.a hrecotmpubR"L32" class=tmpkey< 2] p ^=v2	33.a hrecobe_b_f=_cpuubR"L32" class=be_b_f=_cpu6163ent">/* absorb ksrcevvvvvv3 2] 30././a>210 i58>3 32vvvvvvvv2	33.a hrecotmpubR"L32" class=tmpkey< 3] p ^=v2	33.a hrecobe_b_f=_cpuubR"L32" class=be_b_f=_cpu6163ent">/* absorb ksrcevvvvvv3 3] 30././a>210 152632././a>210 358>3 32vvvvvif ent">/* absorb kcctx=ir"L32" class=cctx6083->^=v2	33.a hrecokey_length=ir"L32" class=key_length5263[4= 16)an4./a>210 35833 32vvvvvnam4e="Lnt">/* absorb kmax=ir"L32" class=max5683[4]2430././a>210 16143 32vvvvvelse0././a>210 35653 32vvvvvvvvvvvvvnt">/* absorb kmax=ir"L32" class=max5683[4]32;vvvvfor key lengths of 24 and]32k14 */210 252632././a>210 36073 32vvvvvvvv2	33.a hrecocrypto/cado_de href=ir"L32" class=crypto/cado_de href6163epan2	33.a hrecocctx=ir"L32" class=cctx6083->^=v2	33.a hrecokey_table=ir"L32" class=key_tablekey210 3588332/./a>210 35693 32vvvvvvvvdo_de href returns 0,1 swapped with 2,3 14 */210 i58>3 32vvvvvvvv2	33.a hrecodsf60d="L4" panL15dsf55>3 0] p ^=v2	33.a hrecocpu_f=_be_bevvvvvv/* absorb ktmpubR"L32" class=tmpkey< 2]+ 4././a>210 36013 32vvvvvvvv2	33.a hrecodsf60d="L4" panL15dsf55>3 1] p ^=v2	33.a hrecocpu_f=_be_bevvvvvv/* absorb ktmpubR"L32" class=tmpkey< 3] 30././a>210 358>3 32vvvvvvvv2	33.a hrecodsf60d="L4" panL15dsf55>3 2] p ^=v2	33.a hrecocpu_f=_be_bevvvvvv/* absorb ktmpubR"L32" class=tmpkey< 0] 30././a>210 35833 32vvvvvvvv2	33.a hrecodsf60d="L4" panL15dsf55>3 3] p ^=v2	33.a hrecocpu_f=_be_bevvvvvv/* absorb ktmpubR"L32" class=tmpkey< 1] 30././a>210 455>3}2././a>210 5588332/./a>210 65203sttenc struct nt">/* absorb kchref=_alg=ir"L32" class=chref=_alg55>3 nt">/* absorb kcrypto/caalg=ir"L32" class=crypto/caalg5683[4]{2././a>210 36073 32vvvvv.nt">/* absorb kcha_"lin=ir"L32" class=cha_"lin5653 32vvvvvvvvvvvv=32vvvvvvvv"crypto/c" */210 86073 32vvvvv.nt">/* absorb kcha_driver_"lin=ir"L32" class=cha_driver_"lin6073 32vvvvv=32vvvvvvvv"crypto/c-mellia_" */210 96073 32vvvvv.nt">/* absorb kcha_prioritbubR"L32" class=cha_prioritb5653 32vvvvvvvv=32vvvvv100,an4./a>210 i6073 32vvvvv.nt">/* absorb kcha_flagsevvvvvv332vvvvvvvvvvvv=32vvvvvvt">/* absorb k"RYPTO_ALG_TYPE_CIPHEsubR"L32" class="RYPTO_ALG_TYPE_CIPHEskey210 16073 32vvvvv.nt">/* absorb kcha_blocksizeevvvvvv332vvvvvvvv=32vvvvvvt">/* absorb k"frCAMELLBLOCK_SIZEubR"L32" class="frCAMELLBLOCK_SIZEkey210 26073 32vvvvv.nt">/* absorb kcha_ctxsizeevvvvvv332vvvvvvvvvv=32vvvvvsizeofestruct nt">/* absorb kcrypto/cactx=ir"L32" class=crypto/cactx6083)/an4./a>210 36073 32vvvvv.nt">/* absorb kcha_alignmaskevvvvvv332vvvvvvvv=32vvvvv3/an4./a>210 46073 32vvvvv.nt">/* absorb kcha_module=ir"L32" class=cha_module55>332vvvvvvvvvvv=32vvvvvvt">/* absorb kTHIS_MODULEubR"L32" class=THIS_MODULEkey210 56073 32vvvvv.nt">/* absorb kcha_uubR"L32" class=cha_u5653 32vvvvvvvvvvvvvvv=32vvvvv{2././a>210 25263 32vvvvvvvvvvvvv.nt">/* absorb kciphee=ir"L32" class=ciphee5683[4]{2././a>210 161ss="line" nam4e="L141vvvvv.nt">/* absorb kcia_min_subsizeevvvvvv/* absorb k"frCAMELLMIN_KEY_SIZEubR"L32" class="frCAMELLMIN_KEY_SIZEkey210 16183 32vvvvvvvvvvvvv141vvvvv.nt">/* absorb kcia_max_subsizeevvvvvv/* absorb k"frCAMELLMAX_KEY_SIZEubR"L32" class="frCAMELLMAX_KEY_SIZEkey210 25293 32vvvvvvvvvvvvvvvv2vvvv.nt">/* absorb kcia_setsububR"L32" class=cia_setsub55>332vvvvvvvvvvv=32vvvvvvt">/* absorb kcrypto/caset_sububR"L32" class=crypto/caset_sub6163/an4./a>210 i5293 32vvvvvvvvvvvvvvvv2vvvv.nt">/* absorb kcia_en href60d="L4" panL15c/caen href61632vvvvvvvvvvv=32vvvvvvt">/* absorb kcrypto/caen href60d="L4" panL15crypto/caen href6163/an4./a>210 35813 32vvvvvvvvvvvvvvvvvvvvv.nt">/* absorb kcia_de href=ir"L32" class=c/cade href61632vvvvvvvvvvv=32vvvvvvt">/* absorb kcrypto/cade href=ir"L32" class=crypto/cade href6163an4./a>210 358>3 32vvvvvvvvvvvvv}2././a>210 36073 32vvvvv}2././a>210 455>3}30././a>210 5588332/./a>210 65203sttenc int nt">/* absorb k__inif=ir"L32" class=__inif55>3 nt">/* absorb kcrypto/cainif=ir"L32" class=crypto/cainif6163evoid)an4./a>210 75833{2././a>210 16183 32vvvvvreturn nt">/* absorb kchref=_register_alg=ir"L32" class=chref=_register_alg6163e&nt">/* absorb kcrypto/caalg=ir"L32" class=crypto/caalg5683 30././a>210 955>3}2././a>210 i588332/./a>210 15203sttenc voidvvvv2	33.a hreco__exif=ir"L32" class=__exif55>3 nt">/* absorb kcrypto/cafini=ir"L32" class=crypto/cafini6163evoid)an4./a>210 25833{2././a>210 35833 32vvvvvvvv2	33.a hrecochref=_unregister_alg=ir"L32" class=chref=_unregister_alg6163e&nt">/* absorb kcrypto/caalg=ir"L32" class=crypto/caalg5683 30././a>210 455>3}2././a>210 5588332/./a>210 65203pan2	33.a hrecomoduleainif=ir"L32" class=moduleainif6163epan2	33.a hrecocrypto/cainif=ir"L32" class=crypto/cainif6163 30././a>210 75203pan2	33.a hrecomoduleaexif=ir"L32" class=moduleaexif6163epan2	33.a hrecocrypto/cafini=ir"L32" class=crypto/cafini6163 30././a>210 3588332/./a>210 95203pan2	33.a hrecoMODULE_DESCRIPTIONubR"L32" class=MODULE_DESCRIPTION6163epvv"Crypto/c Ciphee Algorithm" */211ic61sspan2	33.a hrecoMODULE_LICENSEubR"L32" class=MODULE_LICENSE6163epvv"GPL" */211035813nt">/* absorb kMODULE_AMELSubR"L32" class=MODULE_AMELS6163epvv"crypto/c" */211i25263./pre>
The original LXR software by thsspan2 33.ahttp://sourceforge.net/projects/lxr">LXR clacunitb5653, this expliacommal version by pan2 33.amailto:lxr@claux.no">lxr@claux.no5653. lxr.claux.no kindly hosted by pan2 33.ahttp://www.redpill-clapro.no">Redpill Llapro LS6163, providee of Llauxvconsulting and]oplitenons services since 1995.