Browse Source

Revert "Use uint16 in SHA256 in scrypt kernel."

This reverts commit 46592a24f4.
nfactor-troky
Con Kolivas 13 years ago
parent
commit
e17ee1e894
  1. 258
      scrypt120713.cl

258
scrypt120713.cl

@ -31,187 +31,187 @@ void SHA256(uint4*restrict state0,uint4*restrict state1, const uint4 block0, con
#define G S1.z #define G S1.z
#define H S1.w #define H S1.w
uint16 W; uint4 W[4];
W.s0 = block0.x; W[ 0].x = block0.x;
RND(A,B,C,D,E,F,G,H, W.s0+0x428a2f98U); RND(A,B,C,D,E,F,G,H, W[0].x+0x428a2f98U);
W.s1 = block0.y; W[ 0].y = block0.y;
RND(H,A,B,C,D,E,F,G, W.s1+0x71374491U); RND(H,A,B,C,D,E,F,G, W[0].y+0x71374491U);
W.s2 = block0.z; W[ 0].z = block0.z;
RND(G,H,A,B,C,D,E,F, W.s2+0xb5c0fbcfU); RND(G,H,A,B,C,D,E,F, W[0].z+0xb5c0fbcfU);
W.s3 = block0.w; W[ 0].w = block0.w;
RND(F,G,H,A,B,C,D,E, W.s3+0xe9b5dba5U); RND(F,G,H,A,B,C,D,E, W[0].w+0xe9b5dba5U);
W.s4 = block1.x; W[ 1].x = block1.x;
RND(E,F,G,H,A,B,C,D, W.s4+0x3956c25bU); RND(E,F,G,H,A,B,C,D, W[1].x+0x3956c25bU);
W.s5 = block1.y; W[ 1].y = block1.y;
RND(D,E,F,G,H,A,B,C, W.s5+0x59f111f1U); RND(D,E,F,G,H,A,B,C, W[1].y+0x59f111f1U);
W.s6 = block1.z; W[ 1].z = block1.z;
RND(C,D,E,F,G,H,A,B, W.s6+0x923f82a4U); RND(C,D,E,F,G,H,A,B, W[1].z+0x923f82a4U);
W.s7 = block1.w; W[ 1].w = block1.w;
RND(B,C,D,E,F,G,H,A, W.s7+0xab1c5ed5U); RND(B,C,D,E,F,G,H,A, W[1].w+0xab1c5ed5U);
W.s8 = block2.x; W[ 2].x = block2.x;
RND(A,B,C,D,E,F,G,H, W.s8+0xd807aa98U); RND(A,B,C,D,E,F,G,H, W[2].x+0xd807aa98U);
W.s9 = block2.y; W[ 2].y = block2.y;
RND(H,A,B,C,D,E,F,G, W.s9+0x12835b01U); RND(H,A,B,C,D,E,F,G, W[2].y+0x12835b01U);
W.sa = block2.z; W[ 2].z = block2.z;
RND(G,H,A,B,C,D,E,F, W.sa+0x243185beU); RND(G,H,A,B,C,D,E,F, W[2].z+0x243185beU);
W.sb = block2.w; W[ 2].w = block2.w;
RND(F,G,H,A,B,C,D,E, W.sb+0x550c7dc3U); RND(F,G,H,A,B,C,D,E, W[2].w+0x550c7dc3U);
W.sc = block3.x; W[ 3].x = block3.x;
RND(E,F,G,H,A,B,C,D, W.sc+0x72be5d74U); RND(E,F,G,H,A,B,C,D, W[3].x+0x72be5d74U);
W.sd = block3.y; W[ 3].y = block3.y;
RND(D,E,F,G,H,A,B,C, W.sd+0x80deb1feU); RND(D,E,F,G,H,A,B,C, W[3].y+0x80deb1feU);
W.se = block3.z; W[ 3].z = block3.z;
RND(C,D,E,F,G,H,A,B, W.se+0x9bdc06a7U); RND(C,D,E,F,G,H,A,B, W[3].z+0x9bdc06a7U);
W.sf = block3.w; W[ 3].w = block3.w;
RND(B,C,D,E,F,G,H,A, W.sf+0xc19bf174U); RND(B,C,D,E,F,G,H,A, W[3].w+0xc19bf174U);
W.s0 += Wr1(W.se) + W.s9 + Wr2(W.s1); W[ 0].x += Wr1(W[ 3].z) + W[ 2].y + Wr2(W[ 0].y);
RND(A,B,C,D,E,F,G,H, W.s0+0xe49b69c1U); RND(A,B,C,D,E,F,G,H, W[0].x+0xe49b69c1U);
W.s1 += Wr1(W.sf) + W.sa + Wr2(W.s2); W[ 0].y += Wr1(W[ 3].w) + W[ 2].z + Wr2(W[ 0].z);
RND(H,A,B,C,D,E,F,G, W.s1+0xefbe4786U); RND(H,A,B,C,D,E,F,G, W[0].y+0xefbe4786U);
W.s2 += Wr1(W.s0) + W.sb + Wr2(W.s3); W[ 0].z += Wr1(W[ 0].x) + W[ 2].w + Wr2(W[ 0].w);
RND(G,H,A,B,C,D,E,F, W.s2+0x0fc19dc6U); RND(G,H,A,B,C,D,E,F, W[0].z+0x0fc19dc6U);
W.s3 += Wr1(W.s1) + W.sc + Wr2(W.s4); W[ 0].w += Wr1(W[ 0].y) + W[ 3].x + Wr2(W[ 1].x);
RND(F,G,H,A,B,C,D,E, W.s3+0x240ca1ccU); RND(F,G,H,A,B,C,D,E, W[0].w+0x240ca1ccU);
W.s4 += Wr1(W.s2) + W.sd + Wr2(W.s5); W[ 1].x += Wr1(W[ 0].z) + W[ 3].y + Wr2(W[ 1].y);
RND(E,F,G,H,A,B,C,D, W.s4+0x2de92c6fU); RND(E,F,G,H,A,B,C,D, W[1].x+0x2de92c6fU);
W.s5 += Wr1(W.s3) + W.se + Wr2(W.s6); W[ 1].y += Wr1(W[ 0].w) + W[ 3].z + Wr2(W[ 1].z);
RND(D,E,F,G,H,A,B,C, W.s5+0x4a7484aaU); RND(D,E,F,G,H,A,B,C, W[1].y+0x4a7484aaU);
W.s6 += Wr1(W.s4) + W.sf + Wr2(W.s7); W[ 1].z += Wr1(W[ 1].x) + W[ 3].w + Wr2(W[ 1].w);
RND(C,D,E,F,G,H,A,B, W.s6+0x5cb0a9dcU); RND(C,D,E,F,G,H,A,B, W[1].z+0x5cb0a9dcU);
W.s7 += Wr1(W.s5) + W.s0 + Wr2(W.s8); W[ 1].w += Wr1(W[ 1].y) + W[ 0].x + Wr2(W[ 2].x);
RND(B,C,D,E,F,G,H,A, W.s7+0x76f988daU); RND(B,C,D,E,F,G,H,A, W[1].w+0x76f988daU);
W.s8 += Wr1(W.s6) + W.s1 + Wr2(W.s9); W[ 2].x += Wr1(W[ 1].z) + W[ 0].y + Wr2(W[ 2].y);
RND(A,B,C,D,E,F,G,H, W.s8+0x983e5152U); RND(A,B,C,D,E,F,G,H, W[2].x+0x983e5152U);
W.s9 += Wr1(W.s7) + W.s2 + Wr2(W.sa); W[ 2].y += Wr1(W[ 1].w) + W[ 0].z + Wr2(W[ 2].z);
RND(H,A,B,C,D,E,F,G, W.s9+0xa831c66dU); RND(H,A,B,C,D,E,F,G, W[2].y+0xa831c66dU);
W.sa += Wr1(W.s8) + W.s3 + Wr2(W.sb); W[ 2].z += Wr1(W[ 2].x) + W[ 0].w + Wr2(W[ 2].w);
RND(G,H,A,B,C,D,E,F, W.sa+0xb00327c8U); RND(G,H,A,B,C,D,E,F, W[2].z+0xb00327c8U);
W.sb += Wr1(W.s9) + W.s4 + Wr2(W.sc); W[ 2].w += Wr1(W[ 2].y) + W[ 1].x + Wr2(W[ 3].x);
RND(F,G,H,A,B,C,D,E, W.sb+0xbf597fc7U); RND(F,G,H,A,B,C,D,E, W[2].w+0xbf597fc7U);
W.sc += Wr1(W.sa) + W.s5 + Wr2(W.sd); W[ 3].x += Wr1(W[ 2].z) + W[ 1].y + Wr2(W[ 3].y);
RND(E,F,G,H,A,B,C,D, W.sc+0xc6e00bf3U); RND(E,F,G,H,A,B,C,D, W[3].x+0xc6e00bf3U);
W.sd += Wr1(W.sb) + W.s6 + Wr2(W.se); W[ 3].y += Wr1(W[ 2].w) + W[ 1].z + Wr2(W[ 3].z);
RND(D,E,F,G,H,A,B,C, W.sd+0xd5a79147U); RND(D,E,F,G,H,A,B,C, W[3].y+0xd5a79147U);
W.se += Wr1(W.sc) + W.s7 + Wr2(W.sf); W[ 3].z += Wr1(W[ 3].x) + W[ 1].w + Wr2(W[ 3].w);
RND(C,D,E,F,G,H,A,B, W.se+0x06ca6351U); RND(C,D,E,F,G,H,A,B, W[3].z+0x06ca6351U);
W.sf += Wr1(W.sd) + W.s8 + Wr2(W.s0); W[ 3].w += Wr1(W[ 3].y) + W[ 2].x + Wr2(W[ 0].x);
RND(B,C,D,E,F,G,H,A, W.sf+0x14292967U); RND(B,C,D,E,F,G,H,A, W[3].w+0x14292967U);
W.s0 += Wr1(W.se) + W.s9 + Wr2(W.s1); W[ 0].x += Wr1(W[ 3].z) + W[ 2].y + Wr2(W[ 0].y);
RND(A,B,C,D,E,F,G,H, W.s0+0x27b70a85U); RND(A,B,C,D,E,F,G,H, W[0].x+0x27b70a85U);
W.s1 += Wr1(W.sf) + W.sa + Wr2(W.s2); W[ 0].y += Wr1(W[ 3].w) + W[ 2].z + Wr2(W[ 0].z);
RND(H,A,B,C,D,E,F,G, W.s1+0x2e1b2138U); RND(H,A,B,C,D,E,F,G, W[0].y+0x2e1b2138U);
W.s2 += Wr1(W.s0) + W.sb + Wr2(W.s3); W[ 0].z += Wr1(W[ 0].x) + W[ 2].w + Wr2(W[ 0].w);
RND(G,H,A,B,C,D,E,F, W.s2+0x4d2c6dfcU); RND(G,H,A,B,C,D,E,F, W[0].z+0x4d2c6dfcU);
W.s3 += Wr1(W.s1) + W.sc + Wr2(W.s4); W[ 0].w += Wr1(W[ 0].y) + W[ 3].x + Wr2(W[ 1].x);
RND(F,G,H,A,B,C,D,E, W.s3+0x53380d13U); RND(F,G,H,A,B,C,D,E, W[0].w+0x53380d13U);
W.s4 += Wr1(W.s2) + W.sd + Wr2(W.s5); W[ 1].x += Wr1(W[ 0].z) + W[ 3].y + Wr2(W[ 1].y);
RND(E,F,G,H,A,B,C,D, W.s4+0x650a7354U); RND(E,F,G,H,A,B,C,D, W[1].x+0x650a7354U);
W.s5 += Wr1(W.s3) + W.se + Wr2(W.s6); W[ 1].y += Wr1(W[ 0].w) + W[ 3].z + Wr2(W[ 1].z);
RND(D,E,F,G,H,A,B,C, W.s5+0x766a0abbU); RND(D,E,F,G,H,A,B,C, W[1].y+0x766a0abbU);
W.s6 += Wr1(W.s4) + W.sf + Wr2(W.s7); W[ 1].z += Wr1(W[ 1].x) + W[ 3].w + Wr2(W[ 1].w);
RND(C,D,E,F,G,H,A,B, W.s6+0x81c2c92eU); RND(C,D,E,F,G,H,A,B, W[1].z+0x81c2c92eU);
W.s7 += Wr1(W.s5) + W.s0 + Wr2(W.s8); W[ 1].w += Wr1(W[ 1].y) + W[ 0].x + Wr2(W[ 2].x);
RND(B,C,D,E,F,G,H,A, W.s7+0x92722c85U); RND(B,C,D,E,F,G,H,A, W[1].w+0x92722c85U);
W.s8 += Wr1(W.s6) + W.s1 + Wr2(W.s9); W[ 2].x += Wr1(W[ 1].z) + W[ 0].y + Wr2(W[ 2].y);
RND(A,B,C,D,E,F,G,H, W.s8+0xa2bfe8a1U); RND(A,B,C,D,E,F,G,H, W[2].x+0xa2bfe8a1U);
W.s9 += Wr1(W.s7) + W.s2 + Wr2(W.sa); W[ 2].y += Wr1(W[ 1].w) + W[ 0].z + Wr2(W[ 2].z);
RND(H,A,B,C,D,E,F,G, W.s9+0xa81a664bU); RND(H,A,B,C,D,E,F,G, W[2].y+0xa81a664bU);
W.sa += Wr1(W.s8) + W.s3 + Wr2(W.sb); W[ 2].z += Wr1(W[ 2].x) + W[ 0].w + Wr2(W[ 2].w);
RND(G,H,A,B,C,D,E,F, W.sa+0xc24b8b70U); RND(G,H,A,B,C,D,E,F, W[2].z+0xc24b8b70U);
W.sb += Wr1(W.s9) + W.s4 + Wr2(W.sc); W[ 2].w += Wr1(W[ 2].y) + W[ 1].x + Wr2(W[ 3].x);
RND(F,G,H,A,B,C,D,E, W.sb+0xc76c51a3U); RND(F,G,H,A,B,C,D,E, W[2].w+0xc76c51a3U);
W.sc += Wr1(W.sa) + W.s5 + Wr2(W.sd); W[ 3].x += Wr1(W[ 2].z) + W[ 1].y + Wr2(W[ 3].y);
RND(E,F,G,H,A,B,C,D, W.sc+0xd192e819U); RND(E,F,G,H,A,B,C,D, W[3].x+0xd192e819U);
W.sd += Wr1(W.sb) + W.s6 + Wr2(W.se); W[ 3].y += Wr1(W[ 2].w) + W[ 1].z + Wr2(W[ 3].z);
RND(D,E,F,G,H,A,B,C, W.sd+0xd6990624U); RND(D,E,F,G,H,A,B,C, W[3].y+0xd6990624U);
W.se += Wr1(W.sc) + W.s7 + Wr2(W.sf); W[ 3].z += Wr1(W[ 3].x) + W[ 1].w + Wr2(W[ 3].w);
RND(C,D,E,F,G,H,A,B, W.se+0xf40e3585U); RND(C,D,E,F,G,H,A,B, W[3].z+0xf40e3585U);
W.sf += Wr1(W.sd) + W.s8 + Wr2(W.s0); W[ 3].w += Wr1(W[ 3].y) + W[ 2].x + Wr2(W[ 0].x);
RND(B,C,D,E,F,G,H,A, W.sf+0x106aa070U); RND(B,C,D,E,F,G,H,A, W[3].w+0x106aa070U);
W.s0 += Wr1(W.se) + W.s9 + Wr2(W.s1); W[ 0].x += Wr1(W[ 3].z) + W[ 2].y + Wr2(W[ 0].y);
RND(A,B,C,D,E,F,G,H, W.s0+0x19a4c116U); RND(A,B,C,D,E,F,G,H, W[0].x+0x19a4c116U);
W.s1 += Wr1(W.sf) + W.sa + Wr2(W.s2); W[ 0].y += Wr1(W[ 3].w) + W[ 2].z + Wr2(W[ 0].z);
RND(H,A,B,C,D,E,F,G, W.s1+0x1e376c08U); RND(H,A,B,C,D,E,F,G, W[0].y+0x1e376c08U);
W.s2 += Wr1(W.s0) + W.sb + Wr2(W.s3); W[ 0].z += Wr1(W[ 0].x) + W[ 2].w + Wr2(W[ 0].w);
RND(G,H,A,B,C,D,E,F, W.s2+0x2748774cU); RND(G,H,A,B,C,D,E,F, W[0].z+0x2748774cU);
W.s3 += Wr1(W.s1) + W.sc + Wr2(W.s4); W[ 0].w += Wr1(W[ 0].y) + W[ 3].x + Wr2(W[ 1].x);
RND(F,G,H,A,B,C,D,E, W.s3+0x34b0bcb5U); RND(F,G,H,A,B,C,D,E, W[0].w+0x34b0bcb5U);
W.s4 += Wr1(W.s2) + W.sd + Wr2(W.s5); W[ 1].x += Wr1(W[ 0].z) + W[ 3].y + Wr2(W[ 1].y);
RND(E,F,G,H,A,B,C,D, W.s4+0x391c0cb3U); RND(E,F,G,H,A,B,C,D, W[1].x+0x391c0cb3U);
W.s5 += Wr1(W.s3) + W.se + Wr2(W.s6); W[ 1].y += Wr1(W[ 0].w) + W[ 3].z + Wr2(W[ 1].z);
RND(D,E,F,G,H,A,B,C, W.s5+0x4ed8aa4aU); RND(D,E,F,G,H,A,B,C, W[1].y+0x4ed8aa4aU);
W.s6 += Wr1(W.s4) + W.sf + Wr2(W.s7); W[ 1].z += Wr1(W[ 1].x) + W[ 3].w + Wr2(W[ 1].w);
RND(C,D,E,F,G,H,A,B, W.s6+0x5b9cca4fU); RND(C,D,E,F,G,H,A,B, W[1].z+0x5b9cca4fU);
W.s7 += Wr1(W.s5) + W.s0 + Wr2(W.s8); W[ 1].w += Wr1(W[ 1].y) + W[ 0].x + Wr2(W[ 2].x);
RND(B,C,D,E,F,G,H,A, W.s7+0x682e6ff3U); RND(B,C,D,E,F,G,H,A, W[1].w+0x682e6ff3U);
W.s8 += Wr1(W.s6) + W.s1 + Wr2(W.s9); W[ 2].x += Wr1(W[ 1].z) + W[ 0].y + Wr2(W[ 2].y);
RND(A,B,C,D,E,F,G,H, W.s8+0x748f82eeU); RND(A,B,C,D,E,F,G,H, W[2].x+0x748f82eeU);
W.s9 += Wr1(W.s7) + W.s2 + Wr2(W.sa); W[ 2].y += Wr1(W[ 1].w) + W[ 0].z + Wr2(W[ 2].z);
RND(H,A,B,C,D,E,F,G, W.s9+0x78a5636fU); RND(H,A,B,C,D,E,F,G, W[2].y+0x78a5636fU);
W.sa += Wr1(W.s8) + W.s3 + Wr2(W.sb); W[ 2].z += Wr1(W[ 2].x) + W[ 0].w + Wr2(W[ 2].w);
RND(G,H,A,B,C,D,E,F, W.sa+0x84c87814U); RND(G,H,A,B,C,D,E,F, W[2].z+0x84c87814U);
W.sb += Wr1(W.s9) + W.s4 + Wr2(W.sc); W[ 2].w += Wr1(W[ 2].y) + W[ 1].x + Wr2(W[ 3].x);
RND(F,G,H,A,B,C,D,E, W.sb+0x8cc70208U); RND(F,G,H,A,B,C,D,E, W[2].w+0x8cc70208U);
W.sc += Wr1(W.sa) + W.s5 + Wr2(W.sd); W[ 3].x += Wr1(W[ 2].z) + W[ 1].y + Wr2(W[ 3].y);
RND(E,F,G,H,A,B,C,D, W.sc+0x90befffaU); RND(E,F,G,H,A,B,C,D, W[3].x+0x90befffaU);
W.sd += Wr1(W.sb) + W.s6 + Wr2(W.se); W[ 3].y += Wr1(W[ 2].w) + W[ 1].z + Wr2(W[ 3].z);
RND(D,E,F,G,H,A,B,C, W.sd+0xa4506cebU); RND(D,E,F,G,H,A,B,C, W[3].y+0xa4506cebU);
W.se += Wr1(W.sc) + W.s7 + Wr2(W.sf); W[ 3].z += Wr1(W[ 3].x) + W[ 1].w + Wr2(W[ 3].w);
RND(C,D,E,F,G,H,A,B, W.se+0xbef9a3f7U); RND(C,D,E,F,G,H,A,B, W[3].z+0xbef9a3f7U);
W.sf += Wr1(W.sd) + W.s8 + Wr2(W.s0); W[ 3].w += Wr1(W[ 3].y) + W[ 2].x + Wr2(W[ 0].x);
RND(B,C,D,E,F,G,H,A, W.sf+0xc67178f2U); RND(B,C,D,E,F,G,H,A, W[3].w+0xc67178f2U);
#undef A #undef A
#undef B #undef B

Loading…
Cancel
Save