#define CUBEHASH_ROUNDS 16 #include "crypto_hash.h" #include "crypto_uint8.h" #include "crypto_uint16.h" #include "crypto_uint32.h" typedef crypto_uint8 crypto_uint1; typedef crypto_uint8 crypto_uint3; typedef crypto_uint8 crypto_uint4; typedef crypto_uint8 crypto_uint5; typedef crypto_uint16 crypto_uint11; int crypto_hash(unsigned char *out,const unsigned char *in,unsigned long long inlen) { crypto_uint4 newx00; crypto_uint4 x00[8] = {(512 / 8) % 16,(512 / 8) / 16}; crypto_uint4 newx01; crypto_uint4 x01[8] = {32 % 16,32 / 16}; crypto_uint4 newx02; crypto_uint4 x02[8] = {CUBEHASH_ROUNDS % 16,CUBEHASH_ROUNDS / 16}; crypto_uint4 newx03; crypto_uint4 x03[8] = {0}; crypto_uint4 newx04; crypto_uint4 x04[8] = {0}; crypto_uint4 newx05; crypto_uint4 x05[8] = {0}; crypto_uint4 newx06; crypto_uint4 x06[8] = {0}; crypto_uint4 newx07; crypto_uint4 x07[8] = {0}; crypto_uint4 newx08; crypto_uint4 x08[8] = {0}; crypto_uint4 newx09; crypto_uint4 x09[8] = {0}; crypto_uint4 newx0a; crypto_uint4 x0a[8] = {0}; crypto_uint4 newx0b; crypto_uint4 x0b[8] = {0}; crypto_uint4 newx0c; crypto_uint4 x0c[8] = {0}; crypto_uint4 newx0d; crypto_uint4 x0d[8] = {0}; crypto_uint4 newx0e; crypto_uint4 x0e[8] = {0}; crypto_uint4 newx0f; crypto_uint4 x0f[8] = {0}; crypto_uint4 newx10; crypto_uint4 x10[8] = {0}; crypto_uint4 newx11; crypto_uint4 x11[8] = {0}; crypto_uint4 newx12; crypto_uint4 x12[8] = {0}; crypto_uint4 newx13; crypto_uint4 x13[8] = {0}; crypto_uint4 newx14; crypto_uint4 x14[8] = {0}; crypto_uint4 newx15; crypto_uint4 x15[8] = {0}; crypto_uint4 newx16; crypto_uint4 x16[8] = {0}; crypto_uint4 newx17; crypto_uint4 x17[8] = {0}; crypto_uint4 newx18; crypto_uint4 x18[8] = {0}; crypto_uint4 newx19; crypto_uint4 x19[8] = {0}; crypto_uint4 newx1a; crypto_uint4 x1a[8] = {0}; crypto_uint4 newx1b; crypto_uint4 x1b[8] = {0}; crypto_uint4 newx1c; crypto_uint4 x1c[8] = {0}; crypto_uint4 newx1d; crypto_uint4 x1d[8] = {0}; crypto_uint4 newx1e; crypto_uint4 x1e[8] = {0}; crypto_uint4 newx1f; crypto_uint4 x1f[8] = {0}; crypto_uint11 newq0; crypto_uint11 q0; crypto_uint11 newq1; crypto_uint11 q1; crypto_uint11 newq2; crypto_uint11 q2; crypto_uint11 newq3; crypto_uint11 q3; crypto_uint11 newq4; crypto_uint11 q4; crypto_uint11 newq5; crypto_uint11 q5; crypto_uint11 newq6; crypto_uint11 q6; crypto_uint11 newq7; crypto_uint11 q7; crypto_uint11 newq8; crypto_uint11 q8; crypto_uint11 newq9; crypto_uint11 q9; crypto_uint11 newqa; crypto_uint11 qa; crypto_uint11 newqb; crypto_uint11 qb; crypto_uint11 newqc; crypto_uint11 qc; crypto_uint11 newqd; crypto_uint11 qd; crypto_uint11 newqe; crypto_uint11 qe; crypto_uint11 newqf; crypto_uint11 qf; crypto_uint1 keep; crypto_uint1 keep2; crypto_uint1 qshift; crypto_uint1 qshift2; crypto_uint1 newcarry0; crypto_uint1 carry0 = 0; crypto_uint1 newcarry1; crypto_uint1 carry1 = 0; crypto_uint1 newcarry2; crypto_uint1 carry2 = 0; crypto_uint1 newcarry3; crypto_uint1 carry3 = 0; crypto_uint1 newcarry4; crypto_uint1 carry4 = 0; crypto_uint1 newcarry5; crypto_uint1 carry5 = 0; crypto_uint1 newcarry6; crypto_uint1 carry6 = 0; crypto_uint1 newcarry7; crypto_uint1 carry7 = 0; crypto_uint1 newcarry8; crypto_uint1 carry8 = 0; crypto_uint1 newcarry9; crypto_uint1 carry9 = 0; crypto_uint1 newcarrya; crypto_uint1 carrya = 0; crypto_uint1 newcarryb; crypto_uint1 carryb = 0; crypto_uint1 newcarryc; crypto_uint1 carryc = 0; crypto_uint1 newcarryd; crypto_uint1 carryd = 0; crypto_uint1 newcarrye; crypto_uint1 carrye = 0; crypto_uint1 newcarryf; crypto_uint1 carryf = 0; crypto_uint4 z0; crypto_uint4 z1; crypto_uint4 z2; crypto_uint4 z3; crypto_uint4 z4; crypto_uint4 z5; crypto_uint4 z6; crypto_uint4 z7; crypto_uint4 z8; crypto_uint4 z9; crypto_uint4 za; crypto_uint4 zb; crypto_uint4 zc; crypto_uint4 zd; crypto_uint4 ze; crypto_uint4 zf; crypto_uint5 sum0; crypto_uint5 sum1; crypto_uint5 sum2; crypto_uint5 sum3; crypto_uint5 sum4; crypto_uint5 sum5; crypto_uint5 sum6; crypto_uint5 sum7; crypto_uint5 sum8; crypto_uint5 sum9; crypto_uint5 suma; crypto_uint5 sumb; crypto_uint5 sumc; crypto_uint5 sumd; crypto_uint5 sume; crypto_uint5 sumf; crypto_uint4 s0; crypto_uint4 t0; crypto_uint4 s1; crypto_uint4 t1; crypto_uint4 s2; crypto_uint4 t2; crypto_uint4 s3; crypto_uint4 t3; crypto_uint4 s4; crypto_uint4 t4; crypto_uint4 s5; crypto_uint4 t5; crypto_uint4 s6; crypto_uint4 t6; crypto_uint4 s7; crypto_uint4 t7; crypto_uint4 s8; crypto_uint4 t8; crypto_uint4 s9; crypto_uint4 t9; crypto_uint4 sa; crypto_uint4 ta; crypto_uint4 sb; crypto_uint4 tb; crypto_uint4 sc; crypto_uint4 tc; crypto_uint4 sd; crypto_uint4 td; crypto_uint4 se; crypto_uint4 te; crypto_uint4 sf; crypto_uint4 tf; crypto_uint3 bot0; crypto_uint3 bot1; crypto_uint3 bot2; crypto_uint3 bot3; crypto_uint3 bot4; crypto_uint3 bot5; crypto_uint3 bot6; crypto_uint3 bot7; crypto_uint3 bot8; crypto_uint3 bot9; crypto_uint3 bota; crypto_uint3 botb; crypto_uint3 botc; crypto_uint3 botd; crypto_uint3 bote; crypto_uint3 botf; crypto_uint1 bit0; crypto_uint1 bit1; crypto_uint1 bit2; crypto_uint1 bit3; crypto_uint1 bit4; crypto_uint1 bit5; crypto_uint1 bit6; crypto_uint1 bit7; crypto_uint1 bit8; crypto_uint1 bit9; crypto_uint1 bita; crypto_uint1 bitb; crypto_uint1 bitc; crypto_uint1 bitd; crypto_uint1 bite; crypto_uint1 bitf; crypto_uint3 mid0; crypto_uint3 mid1; crypto_uint3 mid2; crypto_uint3 mid3; crypto_uint3 mid4; crypto_uint3 mid5; crypto_uint3 mid6; crypto_uint3 mid7; crypto_uint3 mid8; crypto_uint3 mid9; crypto_uint3 mida; crypto_uint3 midb; crypto_uint3 midc; crypto_uint3 midd; crypto_uint3 mide; crypto_uint3 midf; crypto_uint1 bip0; crypto_uint1 bip1; crypto_uint1 bip2; crypto_uint1 bip3; crypto_uint1 bip4; crypto_uint1 bip5; crypto_uint1 bip6; crypto_uint1 bip7; crypto_uint1 bip8; crypto_uint1 bip9; crypto_uint1 bipa; crypto_uint1 bipb; crypto_uint1 bipc; crypto_uint1 bipd; crypto_uint1 bipe; crypto_uint1 bipf; crypto_uint3 top0; crypto_uint3 top1; crypto_uint3 top2; crypto_uint3 top3; crypto_uint3 top4; crypto_uint3 top5; crypto_uint3 top6; crypto_uint3 top7; crypto_uint3 top8; crypto_uint3 top9; crypto_uint3 topa; crypto_uint3 topb; crypto_uint3 topc; crypto_uint3 topd; crypto_uint3 tope; crypto_uint3 topf; int i; int r; int cycle; int bigcycle; int finalization = 0; unsigned char tmp[32]; r = 16; goto morerounds; if (inlen < 32) goto inlenbelow32; mainloop: for (i = 0;i < 4;++i) { x00[2*i] ^= (in[i] & 15); x01[2*i] ^= (in[i + 4] & 15); x02[2*i] ^= (in[i + 8] & 15); x03[2*i] ^= (in[i + 12] & 15); x04[2*i] ^= (in[i + 16] & 15); x05[2*i] ^= (in[i + 20] & 15); x06[2*i] ^= (in[i + 24] & 15); x07[2*i] ^= (in[i + 28] & 15); x00[2*i+1] ^= ((in[i] >> 4) & 15); x01[2*i+1] ^= ((in[i + 4] >> 4) & 15); x02[2*i+1] ^= ((in[i + 8] >> 4) & 15); x03[2*i+1] ^= ((in[i + 12] >> 4) & 15); x04[2*i+1] ^= ((in[i + 16] >> 4) & 15); x05[2*i+1] ^= ((in[i + 20] >> 4) & 15); x06[2*i+1] ^= ((in[i + 24] >> 4) & 15); x07[2*i+1] ^= ((in[i + 28] >> 4) & 15); } in += 32; inlen -= 32; r = CUBEHASH_ROUNDS; morerounds: q0 = (x08[6] >> 1) | ((crypto_uint11) x08[7] << 3); q1 = (x09[6] >> 1) | ((crypto_uint11) x09[7] << 3); q2 = (x0a[6] >> 1) | ((crypto_uint11) x0a[7] << 3); q3 = (x0b[6] >> 1) | ((crypto_uint11) x0b[7] << 3); q4 = (x0c[6] >> 1) | ((crypto_uint11) x0c[7] << 3); q5 = (x0d[6] >> 1) | ((crypto_uint11) x0d[7] << 3); q6 = (x0e[6] >> 1) | ((crypto_uint11) x0e[7] << 3); q7 = (x0f[6] >> 1) | ((crypto_uint11) x0f[7] << 3); q8 = (x00[6] >> 1) | ((crypto_uint11) x00[7] << 3); q9 = (x01[6] >> 1) | ((crypto_uint11) x01[7] << 3); qa = (x02[6] >> 1) | ((crypto_uint11) x02[7] << 3); qb = (x03[6] >> 1) | ((crypto_uint11) x03[7] << 3); qc = (x04[6] >> 1) | ((crypto_uint11) x04[7] << 3); qd = (x05[6] >> 1) | ((crypto_uint11) x05[7] << 3); qe = (x06[6] >> 1) | ((crypto_uint11) x06[7] << 3); qf = (x07[6] >> 1) | ((crypto_uint11) x07[7] << 3); for (;r > 0;--r) { for (bigcycle = 0;bigcycle < 2;++bigcycle) { for (cycle = 0;cycle < 8;++cycle) { z0 = x00[cycle]; z1 = x01[cycle]; z2 = x02[cycle]; z3 = x03[cycle]; z4 = x04[cycle]; z5 = x05[cycle]; z6 = x06[cycle]; z7 = x07[cycle]; z8 = x08[cycle]; z9 = x09[cycle]; za = x0a[cycle]; zb = x0b[cycle]; zc = x0c[cycle]; zd = x0d[cycle]; ze = x0e[cycle]; zf = x0f[cycle]; sum0 = x10[cycle] + (crypto_uint5) z0 + carry0; sum1 = x11[cycle] + (crypto_uint5) z1 + carry1; sum2 = x12[cycle] + (crypto_uint5) z2 + carry2; sum3 = x13[cycle] + (crypto_uint5) z3 + carry3; sum4 = x14[cycle] + (crypto_uint5) z4 + carry4; sum5 = x15[cycle] + (crypto_uint5) z5 + carry5; sum6 = x16[cycle] + (crypto_uint5) z6 + carry6; sum7 = x17[cycle] + (crypto_uint5) z7 + carry7; sum8 = x18[cycle] + (crypto_uint5) z8 + carry8; sum9 = x19[cycle] + (crypto_uint5) z9 + carry9; suma = x1a[cycle] + (crypto_uint5) za + carrya; sumb = x1b[cycle] + (crypto_uint5) zb + carryb; sumc = x1c[cycle] + (crypto_uint5) zc + carryc; sumd = x1d[cycle] + (crypto_uint5) zd + carryd; sume = x1e[cycle] + (crypto_uint5) ze + carrye; sumf = x1f[cycle] + (crypto_uint5) zf + carryf; s0 = sum0 & 15; s1 = sum1 & 15; s2 = sum2 & 15; s3 = sum3 & 15; s4 = sum4 & 15; s5 = sum5 & 15; s6 = sum6 & 15; s7 = sum7 & 15; s8 = sum8 & 15; s9 = sum9 & 15; sa = suma & 15; sb = sumb & 15; sc = sumc & 15; sd = sumd & 15; se = sume & 15; sf = sumf & 15; keep = cycle < 7; newcarry0 = keep & (sum0 >> 4); newcarry1 = keep & (sum1 >> 4); newcarry2 = keep & (sum2 >> 4); newcarry3 = keep & (sum3 >> 4); newcarry4 = keep & (sum4 >> 4); newcarry5 = keep & (sum5 >> 4); newcarry6 = keep & (sum6 >> 4); newcarry7 = keep & (sum7 >> 4); newcarry8 = keep & (sum8 >> 4); newcarry9 = keep & (sum9 >> 4); newcarrya = keep & (suma >> 4); newcarryb = keep & (sumb >> 4); newcarryc = keep & (sumc >> 4); newcarryd = keep & (sumd >> 4); newcarrye = keep & (sume >> 4); newcarryf = keep & (sumf >> 4); t0 = q0 & 15; t1 = q1 & 15; t2 = q2 & 15; t3 = q3 & 15; t4 = q4 & 15; t5 = q5 & 15; t6 = q6 & 15; t7 = q7 & 15; t8 = q8 & 15; t9 = q9 & 15; ta = qa & 15; tb = qb & 15; tc = qc & 15; td = qd & 15; te = qe & 15; tf = qf & 15; newx00 = s0 ^ t0; newx01 = s1 ^ t1; newx02 = s2 ^ t2; newx03 = s3 ^ t3; newx04 = s4 ^ t4; newx05 = s5 ^ t5; newx06 = s6 ^ t6; newx07 = s7 ^ t7; newx08 = s8 ^ t8; newx09 = s9 ^ t9; newx0a = sa ^ ta; newx0b = sb ^ tb; newx0c = sc ^ tc; newx0d = sd ^ td; newx0e = se ^ te; newx0f = sf ^ tf; newx10 = bigcycle ? s1 : s2; newx11 = bigcycle ? s0 : s3; newx12 = bigcycle ? s3 : s0; newx13 = bigcycle ? s2 : s1; newx14 = bigcycle ? s5 : s6; newx15 = bigcycle ? s4 : s7; newx16 = bigcycle ? s7 : s4; newx17 = bigcycle ? s6 : s5; newx18 = bigcycle ? s9 : sa; newx19 = bigcycle ? s8 : sb; newx1a = bigcycle ? sb : s8; newx1b = bigcycle ? sa : s9; newx1c = bigcycle ? sd : se; newx1d = bigcycle ? sc : sf; newx1e = bigcycle ? sf : sc; newx1f = bigcycle ? se : sd; bot0 = (q0 & 112) >> 4; bot1 = (q1 & 112) >> 4; bot2 = (q2 & 112) >> 4; bot3 = (q3 & 112) >> 4; bot4 = (q4 & 112) >> 4; bot5 = (q5 & 112) >> 4; bot6 = (q6 & 112) >> 4; bot7 = (q7 & 112) >> 4; bot8 = (q8 & 112) >> 4; bot9 = (q9 & 112) >> 4; bota = (qa & 112) >> 4; botb = (qb & 112) >> 4; botc = (qc & 112) >> 4; botd = (qd & 112) >> 4; bote = (qe & 112) >> 4; botf = (qf & 112) >> 4; qshift = !bigcycle ^ keep; bit0 = qshift ? ((q0 & 128) >> 7) : (bigcycle ? (newx08 & 1) : (z8 & 1)); bit1 = qshift ? ((q1 & 128) >> 7) : (bigcycle ? (newx09 & 1) : (z9 & 1)); bit2 = qshift ? ((q2 & 128) >> 7) : (bigcycle ? (newx0a & 1) : (za & 1)); bit3 = qshift ? ((q3 & 128) >> 7) : (bigcycle ? (newx0b & 1) : (zb & 1)); bit4 = qshift ? ((q4 & 128) >> 7) : (bigcycle ? (newx0c & 1) : (zc & 1)); bit5 = qshift ? ((q5 & 128) >> 7) : (bigcycle ? (newx0d & 1) : (zd & 1)); bit6 = qshift ? ((q6 & 128) >> 7) : (bigcycle ? (newx0e & 1) : (ze & 1)); bit7 = qshift ? ((q7 & 128) >> 7) : (bigcycle ? (newx0f & 1) : (zf & 1)); bit8 = qshift ? ((q8 & 128) >> 7) : (bigcycle ? (newx00 & 1) : (z0 & 1)); bit9 = qshift ? ((q9 & 128) >> 7) : (bigcycle ? (newx01 & 1) : (z1 & 1)); bita = qshift ? ((qa & 128) >> 7) : (bigcycle ? (newx02 & 1) : (z2 & 1)); bitb = qshift ? ((qb & 128) >> 7) : (bigcycle ? (newx03 & 1) : (z3 & 1)); bitc = qshift ? ((qc & 128) >> 7) : (bigcycle ? (newx04 & 1) : (z4 & 1)); bitd = qshift ? ((qd & 128) >> 7) : (bigcycle ? (newx05 & 1) : (z5 & 1)); bite = qshift ? ((qe & 128) >> 7) : (bigcycle ? (newx06 & 1) : (z6 & 1)); bitf = qshift ? ((qf & 128) >> 7) : (bigcycle ? (newx07 & 1) : (z7 & 1)); keep2 = cycle < 6; qshift2 = !bigcycle ^ keep2; mid0 = qshift2 ? ((q0 & 1792) >> 8) : (bigcycle ? (newx08 >> 1) : (z8 >> 1)); mid1 = qshift2 ? ((q1 & 1792) >> 8) : (bigcycle ? (newx09 >> 1) : (z9 >> 1)); mid2 = qshift2 ? ((q2 & 1792) >> 8) : (bigcycle ? (newx0a >> 1) : (za >> 1)); mid3 = qshift2 ? ((q3 & 1792) >> 8) : (bigcycle ? (newx0b >> 1) : (zb >> 1)); mid4 = qshift2 ? ((q4 & 1792) >> 8) : (bigcycle ? (newx0c >> 1) : (zc >> 1)); mid5 = qshift2 ? ((q5 & 1792) >> 8) : (bigcycle ? (newx0d >> 1) : (zd >> 1)); mid6 = qshift2 ? ((q6 & 1792) >> 8) : (bigcycle ? (newx0e >> 1) : (ze >> 1)); mid7 = qshift2 ? ((q7 & 1792) >> 8) : (bigcycle ? (newx0f >> 1) : (zf >> 1)); mid8 = qshift2 ? ((q8 & 1792) >> 8) : (bigcycle ? (newx00 >> 1) : (z0 >> 1)); mid9 = qshift2 ? ((q9 & 1792) >> 8) : (bigcycle ? (newx01 >> 1) : (z1 >> 1)); mida = qshift2 ? ((qa & 1792) >> 8) : (bigcycle ? (newx02 >> 1) : (z2 >> 1)); midb = qshift2 ? ((qb & 1792) >> 8) : (bigcycle ? (newx03 >> 1) : (z3 >> 1)); midc = qshift2 ? ((qc & 1792) >> 8) : (bigcycle ? (newx04 >> 1) : (z4 >> 1)); midd = qshift2 ? ((qd & 1792) >> 8) : (bigcycle ? (newx05 >> 1) : (z5 >> 1)); mide = qshift2 ? ((qe & 1792) >> 8) : (bigcycle ? (newx06 >> 1) : (z6 >> 1)); midf = qshift2 ? ((qf & 1792) >> 8) : (bigcycle ? (newx07 >> 1) : (z7 >> 1)); bip0 = bigcycle ? (keep2 & (z4 & 1)) : (!keep2 & (newx04 & 1)); bip1 = bigcycle ? (keep2 & (z5 & 1)) : (!keep2 & (newx05 & 1)); bip2 = bigcycle ? (keep2 & (z6 & 1)) : (!keep2 & (newx06 & 1)); bip3 = bigcycle ? (keep2 & (z7 & 1)) : (!keep2 & (newx07 & 1)); bip4 = bigcycle ? (keep2 & (z0 & 1)) : (!keep2 & (newx00 & 1)); bip5 = bigcycle ? (keep2 & (z1 & 1)) : (!keep2 & (newx01 & 1)); bip6 = bigcycle ? (keep2 & (z2 & 1)) : (!keep2 & (newx02 & 1)); bip7 = bigcycle ? (keep2 & (z3 & 1)) : (!keep2 & (newx03 & 1)); bip8 = bigcycle ? (keep2 & (zc & 1)) : (!keep2 & (newx0c & 1)); bip9 = bigcycle ? (keep2 & (zd & 1)) : (!keep2 & (newx0d & 1)); bipa = bigcycle ? (keep2 & (ze & 1)) : (!keep2 & (newx0e & 1)); bipb = bigcycle ? (keep2 & (zf & 1)) : (!keep2 & (newx0f & 1)); bipc = bigcycle ? (keep2 & (z8 & 1)) : (!keep2 & (newx08 & 1)); bipd = bigcycle ? (keep2 & (z9 & 1)) : (!keep2 & (newx09 & 1)); bipe = bigcycle ? (keep2 & (za & 1)) : (!keep2 & (newx0a & 1)); bipf = bigcycle ? (keep2 & (zb & 1)) : (!keep2 & (newx0b & 1)); top0 = bigcycle ? (z4 >> 1) : (newx04 >> 1); top1 = bigcycle ? (z5 >> 1) : (newx05 >> 1); top2 = bigcycle ? (z6 >> 1) : (newx06 >> 1); top3 = bigcycle ? (z7 >> 1) : (newx07 >> 1); top4 = bigcycle ? (z0 >> 1) : (newx00 >> 1); top5 = bigcycle ? (z1 >> 1) : (newx01 >> 1); top6 = bigcycle ? (z2 >> 1) : (newx02 >> 1); top7 = bigcycle ? (z3 >> 1) : (newx03 >> 1); top8 = bigcycle ? (zc >> 1) : (newx0c >> 1); top9 = bigcycle ? (zd >> 1) : (newx0d >> 1); topa = bigcycle ? (ze >> 1) : (newx0e >> 1); topb = bigcycle ? (zf >> 1) : (newx0f >> 1); topc = bigcycle ? (z8 >> 1) : (newx08 >> 1); topd = bigcycle ? (z9 >> 1) : (newx09 >> 1); tope = bigcycle ? (za >> 1) : (newx0a >> 1); topf = bigcycle ? (zb >> 1) : (newx0b >> 1); newq0 = bot0 | (bit0 << 3) | (mid0 << 4) | (bip0 << 7) | (top0 << 8); newq1 = bot1 | (bit1 << 3) | (mid1 << 4) | (bip1 << 7) | (top1 << 8); newq2 = bot2 | (bit2 << 3) | (mid2 << 4) | (bip2 << 7) | (top2 << 8); newq3 = bot3 | (bit3 << 3) | (mid3 << 4) | (bip3 << 7) | (top3 << 8); newq4 = bot4 | (bit4 << 3) | (mid4 << 4) | (bip4 << 7) | (top4 << 8); newq5 = bot5 | (bit5 << 3) | (mid5 << 4) | (bip5 << 7) | (top5 << 8); newq6 = bot6 | (bit6 << 3) | (mid6 << 4) | (bip6 << 7) | (top6 << 8); newq7 = bot7 | (bit7 << 3) | (mid7 << 4) | (bip7 << 7) | (top7 << 8); newq8 = bot8 | (bit8 << 3) | (mid8 << 4) | (bip8 << 7) | (top8 << 8); newq9 = bot9 | (bit9 << 3) | (mid9 << 4) | (bip9 << 7) | (top9 << 8); newqa = bota | (bita << 3) | (mida << 4) | (bipa << 7) | (topa << 8); newqb = botb | (bitb << 3) | (midb << 4) | (bipb << 7) | (topb << 8); newqc = botc | (bitc << 3) | (midc << 4) | (bipc << 7) | (topc << 8); newqd = botd | (bitd << 3) | (midd << 4) | (bipd << 7) | (topd << 8); newqe = bote | (bite << 3) | (mide << 4) | (bipe << 7) | (tope << 8); newqf = botf | (bitf << 3) | (midf << 4) | (bipf << 7) | (topf << 8); x00[cycle] = newx00; x01[cycle] = newx01; x02[cycle] = newx02; x03[cycle] = newx03; x04[cycle] = newx04; x05[cycle] = newx05; x06[cycle] = newx06; x07[cycle] = newx07; x08[cycle] = newx08; x09[cycle] = newx09; x0a[cycle] = newx0a; x0b[cycle] = newx0b; x0c[cycle] = newx0c; x0d[cycle] = newx0d; x0e[cycle] = newx0e; x0f[cycle] = newx0f; x10[cycle] = newx10; x11[cycle] = newx11; x12[cycle] = newx12; x13[cycle] = newx13; x14[cycle] = newx14; x15[cycle] = newx15; x16[cycle] = newx16; x17[cycle] = newx17; x18[cycle] = newx18; x19[cycle] = newx19; x1a[cycle] = newx1a; x1b[cycle] = newx1b; x1c[cycle] = newx1c; x1d[cycle] = newx1d; x1e[cycle] = newx1e; x1f[cycle] = newx1f; q0 = newq0; q1 = newq1; q2 = newq2; q3 = newq3; q4 = newq4; q5 = newq5; q6 = newq6; q7 = newq7; q8 = newq8; q9 = newq9; qa = newqa; qb = newqb; qc = newqc; qd = newqd; qe = newqe; qf = newqf; carry0 = newcarry0; carry1 = newcarry1; carry2 = newcarry2; carry3 = newcarry3; carry4 = newcarry4; carry5 = newcarry5; carry6 = newcarry6; carry7 = newcarry7; carry8 = newcarry8; carry9 = newcarry9; carrya = newcarrya; carryb = newcarryb; carryc = newcarryc; carryd = newcarryd; carrye = newcarrye; carryf = newcarryf; } } } if (inlen >= 32) goto mainloop; inlenbelow32: if (finalization == 0) { for (i = 0;i < inlen;++i) tmp[i] = in[i]; tmp[i] = 128; for (++i;i < 32;++i) tmp[i] = 0; in = tmp; inlen = 32; finalization = 1; goto mainloop; } if (finalization == 1) { x1f[0] ^= 1; r = 32; finalization = 2; goto morerounds; } for (i = 0;i < 4;++i) { out[i ] = x00[2*i] | (x00[2*i+1] << 4); out[i + 4] = x01[2*i] | (x01[2*i+1] << 4); out[i + 8] = x02[2*i] | (x02[2*i+1] << 4); out[i + 12] = x03[2*i] | (x03[2*i+1] << 4); out[i + 16] = x04[2*i] | (x04[2*i+1] << 4); out[i + 20] = x05[2*i] | (x05[2*i+1] << 4); out[i + 24] = x06[2*i] | (x06[2*i+1] << 4); out[i + 28] = x07[2*i] | (x07[2*i+1] << 4); out[i + 32] = x08[2*i] | (x08[2*i+1] << 4); out[i + 36] = x09[2*i] | (x09[2*i+1] << 4); out[i + 40] = x0a[2*i] | (x0a[2*i+1] << 4); out[i + 44] = x0b[2*i] | (x0b[2*i+1] << 4); out[i + 48] = x0c[2*i] | (x0c[2*i+1] << 4); out[i + 52] = x0d[2*i] | (x0d[2*i+1] << 4); out[i + 56] = x0e[2*i] | (x0e[2*i+1] << 4); out[i + 60] = x0f[2*i] | (x0f[2*i+1] << 4); } return 0; }