/ Check-in [3ec73711]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Lowercase local variable names in the SHA3 extension in order to avoid collisions with macros in termios.h.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3ec7371161bd617e40328aa015b09acc2b37b0b5d269a87050a0c57163f92801
User & Date: drh 2017-12-20 23:46:29
Context
2017-12-21
02:17
Add the experimental ".expert" command to the sqlite3.exe shell. check-in: 0821bae7 user: drh tags: trunk
2017-12-20
23:46
Lowercase local variable names in the SHA3 extension in order to avoid collisions with macros in termios.h. check-in: 3ec73711 user: drh tags: trunk
2017-12-19
18:56
Fix crash in sqlite3_vtab_collation() when called for an IS NOT NULL constraint. check-in: ad38d2c4 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/misc/shathree.c.

    74     74   };
    75     75   
    76     76   /*
    77     77   ** A single step of the Keccak mixing function for a 1600-bit state
    78     78   */
    79     79   static void KeccakF1600Step(SHA3Context *p){
    80     80     int i;
    81         -  u64 B0, B1, B2, B3, B4;
    82         -  u64 C0, C1, C2, C3, C4;
    83         -  u64 D0, D1, D2, D3, D4;
           81  +  u64 b0, b1, b2, b3, b4;
           82  +  u64 c0, c1, c2, c3, c4;
           83  +  u64 d0, d1, d2, d3, d4;
    84     84     static const u64 RC[] = {
    85     85       0x0000000000000001ULL,  0x0000000000008082ULL,
    86     86       0x800000000000808aULL,  0x8000000080008000ULL,
    87     87       0x000000000000808bULL,  0x0000000080000001ULL,
    88     88       0x8000000080008081ULL,  0x8000000000008009ULL,
    89     89       0x000000000000008aULL,  0x0000000000000088ULL,
    90     90       0x0000000080008009ULL,  0x000000008000000aULL,
................................................................................
    91     91       0x000000008000808bULL,  0x800000000000008bULL,
    92     92       0x8000000000008089ULL,  0x8000000000008003ULL,
    93     93       0x8000000000008002ULL,  0x8000000000000080ULL,
    94     94       0x000000000000800aULL,  0x800000008000000aULL,
    95     95       0x8000000080008081ULL,  0x8000000000008080ULL,
    96     96       0x0000000080000001ULL,  0x8000000080008008ULL
    97     97     };
    98         -# define A00 (p->u.s[0])
    99         -# define A01 (p->u.s[1])
   100         -# define A02 (p->u.s[2])
   101         -# define A03 (p->u.s[3])
   102         -# define A04 (p->u.s[4])
   103         -# define A10 (p->u.s[5])
   104         -# define A11 (p->u.s[6])
   105         -# define A12 (p->u.s[7])
   106         -# define A13 (p->u.s[8])
   107         -# define A14 (p->u.s[9])
   108         -# define A20 (p->u.s[10])
   109         -# define A21 (p->u.s[11])
   110         -# define A22 (p->u.s[12])
   111         -# define A23 (p->u.s[13])
   112         -# define A24 (p->u.s[14])
   113         -# define A30 (p->u.s[15])
   114         -# define A31 (p->u.s[16])
   115         -# define A32 (p->u.s[17])
   116         -# define A33 (p->u.s[18])
   117         -# define A34 (p->u.s[19])
   118         -# define A40 (p->u.s[20])
   119         -# define A41 (p->u.s[21])
   120         -# define A42 (p->u.s[22])
   121         -# define A43 (p->u.s[23])
   122         -# define A44 (p->u.s[24])
           98  +# define a00 (p->u.s[0])
           99  +# define a01 (p->u.s[1])
          100  +# define a02 (p->u.s[2])
          101  +# define a03 (p->u.s[3])
          102  +# define a04 (p->u.s[4])
          103  +# define a10 (p->u.s[5])
          104  +# define a11 (p->u.s[6])
          105  +# define a12 (p->u.s[7])
          106  +# define a13 (p->u.s[8])
          107  +# define a14 (p->u.s[9])
          108  +# define a20 (p->u.s[10])
          109  +# define a21 (p->u.s[11])
          110  +# define a22 (p->u.s[12])
          111  +# define a23 (p->u.s[13])
          112  +# define a24 (p->u.s[14])
          113  +# define a30 (p->u.s[15])
          114  +# define a31 (p->u.s[16])
          115  +# define a32 (p->u.s[17])
          116  +# define a33 (p->u.s[18])
          117  +# define a34 (p->u.s[19])
          118  +# define a40 (p->u.s[20])
          119  +# define a41 (p->u.s[21])
          120  +# define a42 (p->u.s[22])
          121  +# define a43 (p->u.s[23])
          122  +# define a44 (p->u.s[24])
   123    123   # define ROL64(a,x) ((a<<x)|(a>>(64-x)))
   124    124   
   125    125     for(i=0; i<24; i+=4){
   126         -    C0 = A00^A10^A20^A30^A40;
   127         -    C1 = A01^A11^A21^A31^A41;
   128         -    C2 = A02^A12^A22^A32^A42;
   129         -    C3 = A03^A13^A23^A33^A43;
   130         -    C4 = A04^A14^A24^A34^A44;
   131         -    D0 = C4^ROL64(C1, 1);
   132         -    D1 = C0^ROL64(C2, 1);
   133         -    D2 = C1^ROL64(C3, 1);
   134         -    D3 = C2^ROL64(C4, 1);
   135         -    D4 = C3^ROL64(C0, 1);
   136         -
   137         -    B0 = (A00^D0);
   138         -    B1 = ROL64((A11^D1), 44);
   139         -    B2 = ROL64((A22^D2), 43);
   140         -    B3 = ROL64((A33^D3), 21);
   141         -    B4 = ROL64((A44^D4), 14);
   142         -    A00 =   B0 ^((~B1)&  B2 );
   143         -    A00 ^= RC[i];
   144         -    A11 =   B1 ^((~B2)&  B3 );
   145         -    A22 =   B2 ^((~B3)&  B4 );
   146         -    A33 =   B3 ^((~B4)&  B0 );
   147         -    A44 =   B4 ^((~B0)&  B1 );
   148         -
   149         -    B2 = ROL64((A20^D0), 3);
   150         -    B3 = ROL64((A31^D1), 45);
   151         -    B4 = ROL64((A42^D2), 61);
   152         -    B0 = ROL64((A03^D3), 28);
   153         -    B1 = ROL64((A14^D4), 20);
   154         -    A20 =   B0 ^((~B1)&  B2 );
   155         -    A31 =   B1 ^((~B2)&  B3 );
   156         -    A42 =   B2 ^((~B3)&  B4 );
   157         -    A03 =   B3 ^((~B4)&  B0 );
   158         -    A14 =   B4 ^((~B0)&  B1 );
   159         -
   160         -    B4 = ROL64((A40^D0), 18);
   161         -    B0 = ROL64((A01^D1), 1);
   162         -    B1 = ROL64((A12^D2), 6);
   163         -    B2 = ROL64((A23^D3), 25);
   164         -    B3 = ROL64((A34^D4), 8);
   165         -    A40 =   B0 ^((~B1)&  B2 );
   166         -    A01 =   B1 ^((~B2)&  B3 );
   167         -    A12 =   B2 ^((~B3)&  B4 );
   168         -    A23 =   B3 ^((~B4)&  B0 );
   169         -    A34 =   B4 ^((~B0)&  B1 );
   170         -
   171         -    B1 = ROL64((A10^D0), 36);
   172         -    B2 = ROL64((A21^D1), 10);
   173         -    B3 = ROL64((A32^D2), 15);
   174         -    B4 = ROL64((A43^D3), 56);
   175         -    B0 = ROL64((A04^D4), 27);
   176         -    A10 =   B0 ^((~B1)&  B2 );
   177         -    A21 =   B1 ^((~B2)&  B3 );
   178         -    A32 =   B2 ^((~B3)&  B4 );
   179         -    A43 =   B3 ^((~B4)&  B0 );
   180         -    A04 =   B4 ^((~B0)&  B1 );
   181         -
   182         -    B3 = ROL64((A30^D0), 41);
   183         -    B4 = ROL64((A41^D1), 2);
   184         -    B0 = ROL64((A02^D2), 62);
   185         -    B1 = ROL64((A13^D3), 55);
   186         -    B2 = ROL64((A24^D4), 39);
   187         -    A30 =   B0 ^((~B1)&  B2 );
   188         -    A41 =   B1 ^((~B2)&  B3 );
   189         -    A02 =   B2 ^((~B3)&  B4 );
   190         -    A13 =   B3 ^((~B4)&  B0 );
   191         -    A24 =   B4 ^((~B0)&  B1 );
          126  +    c0 = a00^a10^a20^a30^a40;
          127  +    c1 = a01^a11^a21^a31^a41;
          128  +    c2 = a02^a12^a22^a32^a42;
          129  +    c3 = a03^a13^a23^a33^a43;
          130  +    c4 = a04^a14^a24^a34^a44;
          131  +    d0 = c4^ROL64(c1, 1);
          132  +    d1 = c0^ROL64(c2, 1);
          133  +    d2 = c1^ROL64(c3, 1);
          134  +    d3 = c2^ROL64(c4, 1);
          135  +    d4 = c3^ROL64(c0, 1);
          136  +
          137  +    b0 = (a00^d0);
          138  +    b1 = ROL64((a11^d1), 44);
          139  +    b2 = ROL64((a22^d2), 43);
          140  +    b3 = ROL64((a33^d3), 21);
          141  +    b4 = ROL64((a44^d4), 14);
          142  +    a00 =   b0 ^((~b1)&  b2 );
          143  +    a00 ^= RC[i];
          144  +    a11 =   b1 ^((~b2)&  b3 );
          145  +    a22 =   b2 ^((~b3)&  b4 );
          146  +    a33 =   b3 ^((~b4)&  b0 );
          147  +    a44 =   b4 ^((~b0)&  b1 );
          148  +
          149  +    b2 = ROL64((a20^d0), 3);
          150  +    b3 = ROL64((a31^d1), 45);
          151  +    b4 = ROL64((a42^d2), 61);
          152  +    b0 = ROL64((a03^d3), 28);
          153  +    b1 = ROL64((a14^d4), 20);
          154  +    a20 =   b0 ^((~b1)&  b2 );
          155  +    a31 =   b1 ^((~b2)&  b3 );
          156  +    a42 =   b2 ^((~b3)&  b4 );
          157  +    a03 =   b3 ^((~b4)&  b0 );
          158  +    a14 =   b4 ^((~b0)&  b1 );
          159  +
          160  +    b4 = ROL64((a40^d0), 18);
          161  +    b0 = ROL64((a01^d1), 1);
          162  +    b1 = ROL64((a12^d2), 6);
          163  +    b2 = ROL64((a23^d3), 25);
          164  +    b3 = ROL64((a34^d4), 8);
          165  +    a40 =   b0 ^((~b1)&  b2 );
          166  +    a01 =   b1 ^((~b2)&  b3 );
          167  +    a12 =   b2 ^((~b3)&  b4 );
          168  +    a23 =   b3 ^((~b4)&  b0 );
          169  +    a34 =   b4 ^((~b0)&  b1 );
          170  +
          171  +    b1 = ROL64((a10^d0), 36);
          172  +    b2 = ROL64((a21^d1), 10);
          173  +    b3 = ROL64((a32^d2), 15);
          174  +    b4 = ROL64((a43^d3), 56);
          175  +    b0 = ROL64((a04^d4), 27);
          176  +    a10 =   b0 ^((~b1)&  b2 );
          177  +    a21 =   b1 ^((~b2)&  b3 );
          178  +    a32 =   b2 ^((~b3)&  b4 );
          179  +    a43 =   b3 ^((~b4)&  b0 );
          180  +    a04 =   b4 ^((~b0)&  b1 );
          181  +
          182  +    b3 = ROL64((a30^d0), 41);
          183  +    b4 = ROL64((a41^d1), 2);
          184  +    b0 = ROL64((a02^d2), 62);
          185  +    b1 = ROL64((a13^d3), 55);
          186  +    b2 = ROL64((a24^d4), 39);
          187  +    a30 =   b0 ^((~b1)&  b2 );
          188  +    a41 =   b1 ^((~b2)&  b3 );
          189  +    a02 =   b2 ^((~b3)&  b4 );
          190  +    a13 =   b3 ^((~b4)&  b0 );
          191  +    a24 =   b4 ^((~b0)&  b1 );
          192  +
          193  +    c0 = a00^a20^a40^a10^a30;
          194  +    c1 = a11^a31^a01^a21^a41;
          195  +    c2 = a22^a42^a12^a32^a02;
          196  +    c3 = a33^a03^a23^a43^a13;
          197  +    c4 = a44^a14^a34^a04^a24;
          198  +    d0 = c4^ROL64(c1, 1);
          199  +    d1 = c0^ROL64(c2, 1);
          200  +    d2 = c1^ROL64(c3, 1);
          201  +    d3 = c2^ROL64(c4, 1);
          202  +    d4 = c3^ROL64(c0, 1);
          203  +
          204  +    b0 = (a00^d0);
          205  +    b1 = ROL64((a31^d1), 44);
          206  +    b2 = ROL64((a12^d2), 43);
          207  +    b3 = ROL64((a43^d3), 21);
          208  +    b4 = ROL64((a24^d4), 14);
          209  +    a00 =   b0 ^((~b1)&  b2 );
          210  +    a00 ^= RC[i+1];
          211  +    a31 =   b1 ^((~b2)&  b3 );
          212  +    a12 =   b2 ^((~b3)&  b4 );
          213  +    a43 =   b3 ^((~b4)&  b0 );
          214  +    a24 =   b4 ^((~b0)&  b1 );
          215  +
          216  +    b2 = ROL64((a40^d0), 3);
          217  +    b3 = ROL64((a21^d1), 45);
          218  +    b4 = ROL64((a02^d2), 61);
          219  +    b0 = ROL64((a33^d3), 28);
          220  +    b1 = ROL64((a14^d4), 20);
          221  +    a40 =   b0 ^((~b1)&  b2 );
          222  +    a21 =   b1 ^((~b2)&  b3 );
          223  +    a02 =   b2 ^((~b3)&  b4 );
          224  +    a33 =   b3 ^((~b4)&  b0 );
          225  +    a14 =   b4 ^((~b0)&  b1 );
          226  +
          227  +    b4 = ROL64((a30^d0), 18);
          228  +    b0 = ROL64((a11^d1), 1);
          229  +    b1 = ROL64((a42^d2), 6);
          230  +    b2 = ROL64((a23^d3), 25);
          231  +    b3 = ROL64((a04^d4), 8);
          232  +    a30 =   b0 ^((~b1)&  b2 );
          233  +    a11 =   b1 ^((~b2)&  b3 );
          234  +    a42 =   b2 ^((~b3)&  b4 );
          235  +    a23 =   b3 ^((~b4)&  b0 );
          236  +    a04 =   b4 ^((~b0)&  b1 );
          237  +
          238  +    b1 = ROL64((a20^d0), 36);
          239  +    b2 = ROL64((a01^d1), 10);
          240  +    b3 = ROL64((a32^d2), 15);
          241  +    b4 = ROL64((a13^d3), 56);
          242  +    b0 = ROL64((a44^d4), 27);
          243  +    a20 =   b0 ^((~b1)&  b2 );
          244  +    a01 =   b1 ^((~b2)&  b3 );
          245  +    a32 =   b2 ^((~b3)&  b4 );
          246  +    a13 =   b3 ^((~b4)&  b0 );
          247  +    a44 =   b4 ^((~b0)&  b1 );
          248  +
          249  +    b3 = ROL64((a10^d0), 41);
          250  +    b4 = ROL64((a41^d1), 2);
          251  +    b0 = ROL64((a22^d2), 62);
          252  +    b1 = ROL64((a03^d3), 55);
          253  +    b2 = ROL64((a34^d4), 39);
          254  +    a10 =   b0 ^((~b1)&  b2 );
          255  +    a41 =   b1 ^((~b2)&  b3 );
          256  +    a22 =   b2 ^((~b3)&  b4 );
          257  +    a03 =   b3 ^((~b4)&  b0 );
          258  +    a34 =   b4 ^((~b0)&  b1 );
          259  +
          260  +    c0 = a00^a40^a30^a20^a10;
          261  +    c1 = a31^a21^a11^a01^a41;
          262  +    c2 = a12^a02^a42^a32^a22;
          263  +    c3 = a43^a33^a23^a13^a03;
          264  +    c4 = a24^a14^a04^a44^a34;
          265  +    d0 = c4^ROL64(c1, 1);
          266  +    d1 = c0^ROL64(c2, 1);
          267  +    d2 = c1^ROL64(c3, 1);
          268  +    d3 = c2^ROL64(c4, 1);
          269  +    d4 = c3^ROL64(c0, 1);
          270  +
          271  +    b0 = (a00^d0);
          272  +    b1 = ROL64((a21^d1), 44);
          273  +    b2 = ROL64((a42^d2), 43);
          274  +    b3 = ROL64((a13^d3), 21);
          275  +    b4 = ROL64((a34^d4), 14);
          276  +    a00 =   b0 ^((~b1)&  b2 );
          277  +    a00 ^= RC[i+2];
          278  +    a21 =   b1 ^((~b2)&  b3 );
          279  +    a42 =   b2 ^((~b3)&  b4 );
          280  +    a13 =   b3 ^((~b4)&  b0 );
          281  +    a34 =   b4 ^((~b0)&  b1 );
          282  +
          283  +    b2 = ROL64((a30^d0), 3);
          284  +    b3 = ROL64((a01^d1), 45);
          285  +    b4 = ROL64((a22^d2), 61);
          286  +    b0 = ROL64((a43^d3), 28);
          287  +    b1 = ROL64((a14^d4), 20);
          288  +    a30 =   b0 ^((~b1)&  b2 );
          289  +    a01 =   b1 ^((~b2)&  b3 );
          290  +    a22 =   b2 ^((~b3)&  b4 );
          291  +    a43 =   b3 ^((~b4)&  b0 );
          292  +    a14 =   b4 ^((~b0)&  b1 );
          293  +
          294  +    b4 = ROL64((a10^d0), 18);
          295  +    b0 = ROL64((a31^d1), 1);
          296  +    b1 = ROL64((a02^d2), 6);
          297  +    b2 = ROL64((a23^d3), 25);
          298  +    b3 = ROL64((a44^d4), 8);
          299  +    a10 =   b0 ^((~b1)&  b2 );
          300  +    a31 =   b1 ^((~b2)&  b3 );
          301  +    a02 =   b2 ^((~b3)&  b4 );
          302  +    a23 =   b3 ^((~b4)&  b0 );
          303  +    a44 =   b4 ^((~b0)&  b1 );
          304  +
          305  +    b1 = ROL64((a40^d0), 36);
          306  +    b2 = ROL64((a11^d1), 10);
          307  +    b3 = ROL64((a32^d2), 15);
          308  +    b4 = ROL64((a03^d3), 56);
          309  +    b0 = ROL64((a24^d4), 27);
          310  +    a40 =   b0 ^((~b1)&  b2 );
          311  +    a11 =   b1 ^((~b2)&  b3 );
          312  +    a32 =   b2 ^((~b3)&  b4 );
          313  +    a03 =   b3 ^((~b4)&  b0 );
          314  +    a24 =   b4 ^((~b0)&  b1 );
          315  +
          316  +    b3 = ROL64((a20^d0), 41);
          317  +    b4 = ROL64((a41^d1), 2);
          318  +    b0 = ROL64((a12^d2), 62);
          319  +    b1 = ROL64((a33^d3), 55);
          320  +    b2 = ROL64((a04^d4), 39);
          321  +    a20 =   b0 ^((~b1)&  b2 );
          322  +    a41 =   b1 ^((~b2)&  b3 );
          323  +    a12 =   b2 ^((~b3)&  b4 );
          324  +    a33 =   b3 ^((~b4)&  b0 );
          325  +    a04 =   b4 ^((~b0)&  b1 );
          326  +
          327  +    c0 = a00^a30^a10^a40^a20;
          328  +    c1 = a21^a01^a31^a11^a41;
          329  +    c2 = a42^a22^a02^a32^a12;
          330  +    c3 = a13^a43^a23^a03^a33;
          331  +    c4 = a34^a14^a44^a24^a04;
          332  +    d0 = c4^ROL64(c1, 1);
          333  +    d1 = c0^ROL64(c2, 1);
          334  +    d2 = c1^ROL64(c3, 1);
          335  +    d3 = c2^ROL64(c4, 1);
          336  +    d4 = c3^ROL64(c0, 1);
          337  +
          338  +    b0 = (a00^d0);
          339  +    b1 = ROL64((a01^d1), 44);
          340  +    b2 = ROL64((a02^d2), 43);
          341  +    b3 = ROL64((a03^d3), 21);
          342  +    b4 = ROL64((a04^d4), 14);
          343  +    a00 =   b0 ^((~b1)&  b2 );
          344  +    a00 ^= RC[i+3];
          345  +    a01 =   b1 ^((~b2)&  b3 );
          346  +    a02 =   b2 ^((~b3)&  b4 );
          347  +    a03 =   b3 ^((~b4)&  b0 );
          348  +    a04 =   b4 ^((~b0)&  b1 );
          349  +
          350  +    b2 = ROL64((a10^d0), 3);
          351  +    b3 = ROL64((a11^d1), 45);
          352  +    b4 = ROL64((a12^d2), 61);
          353  +    b0 = ROL64((a13^d3), 28);
          354  +    b1 = ROL64((a14^d4), 20);
          355  +    a10 =   b0 ^((~b1)&  b2 );
          356  +    a11 =   b1 ^((~b2)&  b3 );
          357  +    a12 =   b2 ^((~b3)&  b4 );
          358  +    a13 =   b3 ^((~b4)&  b0 );
          359  +    a14 =   b4 ^((~b0)&  b1 );
          360  +
          361  +    b4 = ROL64((a20^d0), 18);
          362  +    b0 = ROL64((a21^d1), 1);
          363  +    b1 = ROL64((a22^d2), 6);
          364  +    b2 = ROL64((a23^d3), 25);
          365  +    b3 = ROL64((a24^d4), 8);
          366  +    a20 =   b0 ^((~b1)&  b2 );
          367  +    a21 =   b1 ^((~b2)&  b3 );
          368  +    a22 =   b2 ^((~b3)&  b4 );
          369  +    a23 =   b3 ^((~b4)&  b0 );
          370  +    a24 =   b4 ^((~b0)&  b1 );
   192    371   
   193         -    C0 = A00^A20^A40^A10^A30;
   194         -    C1 = A11^A31^A01^A21^A41;
   195         -    C2 = A22^A42^A12^A32^A02;
   196         -    C3 = A33^A03^A23^A43^A13;
   197         -    C4 = A44^A14^A34^A04^A24;
   198         -    D0 = C4^ROL64(C1, 1);
   199         -    D1 = C0^ROL64(C2, 1);
   200         -    D2 = C1^ROL64(C3, 1);
   201         -    D3 = C2^ROL64(C4, 1);
   202         -    D4 = C3^ROL64(C0, 1);
   203         -
   204         -    B0 = (A00^D0);
   205         -    B1 = ROL64((A31^D1), 44);
   206         -    B2 = ROL64((A12^D2), 43);
   207         -    B3 = ROL64((A43^D3), 21);
   208         -    B4 = ROL64((A24^D4), 14);
   209         -    A00 =   B0 ^((~B1)&  B2 );
   210         -    A00 ^= RC[i+1];
   211         -    A31 =   B1 ^((~B2)&  B3 );
   212         -    A12 =   B2 ^((~B3)&  B4 );
   213         -    A43 =   B3 ^((~B4)&  B0 );
   214         -    A24 =   B4 ^((~B0)&  B1 );
   215         -
   216         -    B2 = ROL64((A40^D0), 3);
   217         -    B3 = ROL64((A21^D1), 45);
   218         -    B4 = ROL64((A02^D2), 61);
   219         -    B0 = ROL64((A33^D3), 28);
   220         -    B1 = ROL64((A14^D4), 20);
   221         -    A40 =   B0 ^((~B1)&  B2 );
   222         -    A21 =   B1 ^((~B2)&  B3 );
   223         -    A02 =   B2 ^((~B3)&  B4 );
   224         -    A33 =   B3 ^((~B4)&  B0 );
   225         -    A14 =   B4 ^((~B0)&  B1 );
   226         -
   227         -    B4 = ROL64((A30^D0), 18);
   228         -    B0 = ROL64((A11^D1), 1);
   229         -    B1 = ROL64((A42^D2), 6);
   230         -    B2 = ROL64((A23^D3), 25);
   231         -    B3 = ROL64((A04^D4), 8);
   232         -    A30 =   B0 ^((~B1)&  B2 );
   233         -    A11 =   B1 ^((~B2)&  B3 );
   234         -    A42 =   B2 ^((~B3)&  B4 );
   235         -    A23 =   B3 ^((~B4)&  B0 );
   236         -    A04 =   B4 ^((~B0)&  B1 );
   237         -
   238         -    B1 = ROL64((A20^D0), 36);
   239         -    B2 = ROL64((A01^D1), 10);
   240         -    B3 = ROL64((A32^D2), 15);
   241         -    B4 = ROL64((A13^D3), 56);
   242         -    B0 = ROL64((A44^D4), 27);
   243         -    A20 =   B0 ^((~B1)&  B2 );
   244         -    A01 =   B1 ^((~B2)&  B3 );
   245         -    A32 =   B2 ^((~B3)&  B4 );
   246         -    A13 =   B3 ^((~B4)&  B0 );
   247         -    A44 =   B4 ^((~B0)&  B1 );
   248         -
   249         -    B3 = ROL64((A10^D0), 41);
   250         -    B4 = ROL64((A41^D1), 2);
   251         -    B0 = ROL64((A22^D2), 62);
   252         -    B1 = ROL64((A03^D3), 55);
   253         -    B2 = ROL64((A34^D4), 39);
   254         -    A10 =   B0 ^((~B1)&  B2 );
   255         -    A41 =   B1 ^((~B2)&  B3 );
   256         -    A22 =   B2 ^((~B3)&  B4 );
   257         -    A03 =   B3 ^((~B4)&  B0 );
   258         -    A34 =   B4 ^((~B0)&  B1 );
          372  +    b1 = ROL64((a30^d0), 36);
          373  +    b2 = ROL64((a31^d1), 10);
          374  +    b3 = ROL64((a32^d2), 15);
          375  +    b4 = ROL64((a33^d3), 56);
          376  +    b0 = ROL64((a34^d4), 27);
          377  +    a30 =   b0 ^((~b1)&  b2 );
          378  +    a31 =   b1 ^((~b2)&  b3 );
          379  +    a32 =   b2 ^((~b3)&  b4 );
          380  +    a33 =   b3 ^((~b4)&  b0 );
          381  +    a34 =   b4 ^((~b0)&  b1 );
   259    382   
   260         -    C0 = A00^A40^A30^A20^A10;
   261         -    C1 = A31^A21^A11^A01^A41;
   262         -    C2 = A12^A02^A42^A32^A22;
   263         -    C3 = A43^A33^A23^A13^A03;
   264         -    C4 = A24^A14^A04^A44^A34;
   265         -    D0 = C4^ROL64(C1, 1);
   266         -    D1 = C0^ROL64(C2, 1);
   267         -    D2 = C1^ROL64(C3, 1);
   268         -    D3 = C2^ROL64(C4, 1);
   269         -    D4 = C3^ROL64(C0, 1);
   270         -
   271         -    B0 = (A00^D0);
   272         -    B1 = ROL64((A21^D1), 44);
   273         -    B2 = ROL64((A42^D2), 43);
   274         -    B3 = ROL64((A13^D3), 21);
   275         -    B4 = ROL64((A34^D4), 14);
   276         -    A00 =   B0 ^((~B1)&  B2 );
   277         -    A00 ^= RC[i+2];
   278         -    A21 =   B1 ^((~B2)&  B3 );
   279         -    A42 =   B2 ^((~B3)&  B4 );
   280         -    A13 =   B3 ^((~B4)&  B0 );
   281         -    A34 =   B4 ^((~B0)&  B1 );
   282         -
   283         -    B2 = ROL64((A30^D0), 3);
   284         -    B3 = ROL64((A01^D1), 45);
   285         -    B4 = ROL64((A22^D2), 61);
   286         -    B0 = ROL64((A43^D3), 28);
   287         -    B1 = ROL64((A14^D4), 20);
   288         -    A30 =   B0 ^((~B1)&  B2 );
   289         -    A01 =   B1 ^((~B2)&  B3 );
   290         -    A22 =   B2 ^((~B3)&  B4 );
   291         -    A43 =   B3 ^((~B4)&  B0 );
   292         -    A14 =   B4 ^((~B0)&  B1 );
   293         -
   294         -    B4 = ROL64((A10^D0), 18);
   295         -    B0 = ROL64((A31^D1), 1);
   296         -    B1 = ROL64((A02^D2), 6);
   297         -    B2 = ROL64((A23^D3), 25);
   298         -    B3 = ROL64((A44^D4), 8);
   299         -    A10 =   B0 ^((~B1)&  B2 );
   300         -    A31 =   B1 ^((~B2)&  B3 );
   301         -    A02 =   B2 ^((~B3)&  B4 );
   302         -    A23 =   B3 ^((~B4)&  B0 );
   303         -    A44 =   B4 ^((~B0)&  B1 );
   304         -
   305         -    B1 = ROL64((A40^D0), 36);
   306         -    B2 = ROL64((A11^D1), 10);
   307         -    B3 = ROL64((A32^D2), 15);
   308         -    B4 = ROL64((A03^D3), 56);
   309         -    B0 = ROL64((A24^D4), 27);
   310         -    A40 =   B0 ^((~B1)&  B2 );
   311         -    A11 =   B1 ^((~B2)&  B3 );
   312         -    A32 =   B2 ^((~B3)&  B4 );
   313         -    A03 =   B3 ^((~B4)&  B0 );
   314         -    A24 =   B4 ^((~B0)&  B1 );
   315         -
   316         -    B3 = ROL64((A20^D0), 41);
   317         -    B4 = ROL64((A41^D1), 2);
   318         -    B0 = ROL64((A12^D2), 62);
   319         -    B1 = ROL64((A33^D3), 55);
   320         -    B2 = ROL64((A04^D4), 39);
   321         -    A20 =   B0 ^((~B1)&  B2 );
   322         -    A41 =   B1 ^((~B2)&  B3 );
   323         -    A12 =   B2 ^((~B3)&  B4 );
   324         -    A33 =   B3 ^((~B4)&  B0 );
   325         -    A04 =   B4 ^((~B0)&  B1 );
   326         -
   327         -    C0 = A00^A30^A10^A40^A20;
   328         -    C1 = A21^A01^A31^A11^A41;
   329         -    C2 = A42^A22^A02^A32^A12;
   330         -    C3 = A13^A43^A23^A03^A33;
   331         -    C4 = A34^A14^A44^A24^A04;
   332         -    D0 = C4^ROL64(C1, 1);
   333         -    D1 = C0^ROL64(C2, 1);
   334         -    D2 = C1^ROL64(C3, 1);
   335         -    D3 = C2^ROL64(C4, 1);
   336         -    D4 = C3^ROL64(C0, 1);
   337         -
   338         -    B0 = (A00^D0);
   339         -    B1 = ROL64((A01^D1), 44);
   340         -    B2 = ROL64((A02^D2), 43);
   341         -    B3 = ROL64((A03^D3), 21);
   342         -    B4 = ROL64((A04^D4), 14);
   343         -    A00 =   B0 ^((~B1)&  B2 );
   344         -    A00 ^= RC[i+3];
   345         -    A01 =   B1 ^((~B2)&  B3 );
   346         -    A02 =   B2 ^((~B3)&  B4 );
   347         -    A03 =   B3 ^((~B4)&  B0 );
   348         -    A04 =   B4 ^((~B0)&  B1 );
   349         -
   350         -    B2 = ROL64((A10^D0), 3);
   351         -    B3 = ROL64((A11^D1), 45);
   352         -    B4 = ROL64((A12^D2), 61);
   353         -    B0 = ROL64((A13^D3), 28);
   354         -    B1 = ROL64((A14^D4), 20);
   355         -    A10 =   B0 ^((~B1)&  B2 );
   356         -    A11 =   B1 ^((~B2)&  B3 );
   357         -    A12 =   B2 ^((~B3)&  B4 );
   358         -    A13 =   B3 ^((~B4)&  B0 );
   359         -    A14 =   B4 ^((~B0)&  B1 );
   360         -
   361         -    B4 = ROL64((A20^D0), 18);
   362         -    B0 = ROL64((A21^D1), 1);
   363         -    B1 = ROL64((A22^D2), 6);
   364         -    B2 = ROL64((A23^D3), 25);
   365         -    B3 = ROL64((A24^D4), 8);
   366         -    A20 =   B0 ^((~B1)&  B2 );
   367         -    A21 =   B1 ^((~B2)&  B3 );
   368         -    A22 =   B2 ^((~B3)&  B4 );
   369         -    A23 =   B3 ^((~B4)&  B0 );
   370         -    A24 =   B4 ^((~B0)&  B1 );
   371         -
   372         -    B1 = ROL64((A30^D0), 36);
   373         -    B2 = ROL64((A31^D1), 10);
   374         -    B3 = ROL64((A32^D2), 15);
   375         -    B4 = ROL64((A33^D3), 56);
   376         -    B0 = ROL64((A34^D4), 27);
   377         -    A30 =   B0 ^((~B1)&  B2 );
   378         -    A31 =   B1 ^((~B2)&  B3 );
   379         -    A32 =   B2 ^((~B3)&  B4 );
   380         -    A33 =   B3 ^((~B4)&  B0 );
   381         -    A34 =   B4 ^((~B0)&  B1 );
   382         -
   383         -    B3 = ROL64((A40^D0), 41);
   384         -    B4 = ROL64((A41^D1), 2);
   385         -    B0 = ROL64((A42^D2), 62);
   386         -    B1 = ROL64((A43^D3), 55);
   387         -    B2 = ROL64((A44^D4), 39);
   388         -    A40 =   B0 ^((~B1)&  B2 );
   389         -    A41 =   B1 ^((~B2)&  B3 );
   390         -    A42 =   B2 ^((~B3)&  B4 );
   391         -    A43 =   B3 ^((~B4)&  B0 );
   392         -    A44 =   B4 ^((~B0)&  B1 );
          383  +    b3 = ROL64((a40^d0), 41);
          384  +    b4 = ROL64((a41^d1), 2);
          385  +    b0 = ROL64((a42^d2), 62);
          386  +    b1 = ROL64((a43^d3), 55);
          387  +    b2 = ROL64((a44^d4), 39);
          388  +    a40 =   b0 ^((~b1)&  b2 );
          389  +    a41 =   b1 ^((~b2)&  b3 );
          390  +    a42 =   b2 ^((~b3)&  b4 );
          391  +    a43 =   b3 ^((~b4)&  b0 );
          392  +    a44 =   b4 ^((~b0)&  b1 );
   393    393     }
   394    394   }
   395    395   
   396    396   /*
   397    397   ** Initialize a new hash.  iSize determines the size of the hash
   398    398   ** in bits and should be one of 224, 256, 384, or 512.  Or iSize
   399    399   ** can be zero to use the default hash size of 256 bits.