- for (i=16; i<64; ++i){
- w[i] = SIGMA_b(w[i-2]) + w[i-7] + SIGMA_a(w[i-15]) + w[i-16];
- }
-
- /* init working variables */
- memcpy((void*)a,(void*)(state->h), 8*4);
-
- /* do the, fun stuff, */
- for (i=0; i<64; ++i){
- t1 = a[7] + SIGMA1(a[4]) + CH(a[4],a[5],a[6]) + k[i] + w[i];
- t2 = SIGMA0(a[0]) + MAJ(a[0],a[1],a[2]);
- memmove(&(a[1]), &(a[0]), 7*4); /* a[7]=a[6]; a[6]=a[5]; a[5]=a[4]; a[4]=a[3]; a[3]=a[2]; a[2]=a[1]; a[1]=a[0]; */
- a[4] += t1;
- a[0] = t1 + t2;
+/*
+ for (i=16; i<64; ++i){
+ w[i] = SIGMA_b(w[i-2]) + w[i-7] + SIGMA_a(w[i-15]) + w[i-16];
+ }
+*/
+/* init working variables */
+ memcpy((void*)a,(void*)(state->h), 8*4);
+
+/* do the, fun stuff, */
+ for (i=0; i<64; ++i){
+ if(i<16){
+ wx = w[i];
+ }else{
+ wx = SIGMA_b(w[14]) + w[9] + SIGMA_a(w[1]) + w[0];
+ memmove(&(w[0]), &(w[1]), 15*4);
+ w[15] = wx;