/* Implemented from standard documentation at: http://www.itl.nist.gov/fipspubs/fip180-1.htm Function and variable names are from that documentation. Hooray for standards documents! Function sha1() parameters: char *digest: an output buffer for the binary message digest (20 bytes) char *message: a buffer containing the message data. int length: the length of the message, in bytes. No return value. It just does what it does and that's it. Written for a little-endian architecture. Big endian sucks! Released under the antivirial license. Basically, you can do anything you want with it as long as what you want doesn't involve the GNU GPL. See http://www.ecstaticlyrics.com/antiviral/ for more information. */ #include #define SWAP(X) ((((unsigned int) (X) & 0xFF) << 24) | (((unsigned int) (X) & 0xFF00) << 8) | (((unsigned int) (X) & 0xFF0000) >> 8) | (((unsigned int) (X) & 0xFF000000) >> 24)) static void process(char *); static unsigned int a, b, c, d, e; static unsigned int h[5]; static unsigned int w[80]; static unsigned int temp; // Buffer to store last two blocks, since they require // modification to add the padding and message length. static unsigned char buffer[128]; void sha1(char *digest, char *message, int length) { // To pad the message, copy its last partial block (if any) to a // zero-filled buffer, then add the padding and length to the buffer. int source_block_count = length >> 6; int buffer_block_count = (((length % 64) + 8) >> 6) + 1; memset(buffer, 0, 128); memmove(buffer, message + source_block_count * 64, length % 64); buffer[length % 64] = 0x80; // Then add the length, in bits, in big-endian format. *((unsigned int*) &buffer[buffer_block_count * 64 - 8]) = SWAP((unsigned int) length >> 29); *((unsigned int*) &buffer[buffer_block_count * 64 - 4]) = SWAP((unsigned int) length << 3); // Then just compute the digest! h[0] = 0x67452301; h[1] = 0xEFCDAB89; h[2] = 0x98BADCFE; h[3] = 0x10325476; h[4] = 0xC3D2E1F0; for (int i = 0; i < source_block_count; i++) { process(message + i * 64); }; for (int i = 0; i < buffer_block_count; i++) { process(buffer + i * 64); }; // Then make it big-endian. (stupid big-endian bullshit) *((int*) &digest[0]) = SWAP(h[0]); *((int*) &digest[4]) = SWAP(h[1]); *((int*) &digest[8]) = SWAP(h[2]); *((int*) &digest[12]) = SWAP(h[3]); *((int*) &digest[16]) = SWAP(h[4]); // That was so easy! }; static void process(char *pointer) { // This code was auto-generated by scripts/sha1.pl w[0] = SWAP(*((unsigned int*) &pointer[0])); w[1] = SWAP(*((unsigned int*) &pointer[4])); w[2] = SWAP(*((unsigned int*) &pointer[8])); w[3] = SWAP(*((unsigned int*) &pointer[12])); w[4] = SWAP(*((unsigned int*) &pointer[16])); w[5] = SWAP(*((unsigned int*) &pointer[20])); w[6] = SWAP(*((unsigned int*) &pointer[24])); w[7] = SWAP(*((unsigned int*) &pointer[28])); w[8] = SWAP(*((unsigned int*) &pointer[32])); w[9] = SWAP(*((unsigned int*) &pointer[36])); w[10] = SWAP(*((unsigned int*) &pointer[40])); w[11] = SWAP(*((unsigned int*) &pointer[44])); w[12] = SWAP(*((unsigned int*) &pointer[48])); w[13] = SWAP(*((unsigned int*) &pointer[52])); w[14] = SWAP(*((unsigned int*) &pointer[56])); w[15] = SWAP(*((unsigned int*) &pointer[60])); temp = w[13] ^ w[8] ^ w[2] ^ w[0]; w[16] = (temp << 1) | (temp >> 31); temp = w[14] ^ w[9] ^ w[3] ^ w[1]; w[17] = (temp << 1) | (temp >> 31); temp = w[15] ^ w[10] ^ w[4] ^ w[2]; w[18] = (temp << 1) | (temp >> 31); temp = w[16] ^ w[11] ^ w[5] ^ w[3]; w[19] = (temp << 1) | (temp >> 31); temp = w[17] ^ w[12] ^ w[6] ^ w[4]; w[20] = (temp << 1) | (temp >> 31); temp = w[18] ^ w[13] ^ w[7] ^ w[5]; w[21] = (temp << 1) | (temp >> 31); temp = w[19] ^ w[14] ^ w[8] ^ w[6]; w[22] = (temp << 1) | (temp >> 31); temp = w[20] ^ w[15] ^ w[9] ^ w[7]; w[23] = (temp << 1) | (temp >> 31); temp = w[21] ^ w[16] ^ w[10] ^ w[8]; w[24] = (temp << 1) | (temp >> 31); temp = w[22] ^ w[17] ^ w[11] ^ w[9]; w[25] = (temp << 1) | (temp >> 31); temp = w[23] ^ w[18] ^ w[12] ^ w[10]; w[26] = (temp << 1) | (temp >> 31); temp = w[24] ^ w[19] ^ w[13] ^ w[11]; w[27] = (temp << 1) | (temp >> 31); temp = w[25] ^ w[20] ^ w[14] ^ w[12]; w[28] = (temp << 1) | (temp >> 31); temp = w[26] ^ w[21] ^ w[15] ^ w[13]; w[29] = (temp << 1) | (temp >> 31); temp = w[27] ^ w[22] ^ w[16] ^ w[14]; w[30] = (temp << 1) | (temp >> 31); temp = w[28] ^ w[23] ^ w[17] ^ w[15]; w[31] = (temp << 1) | (temp >> 31); temp = w[29] ^ w[24] ^ w[18] ^ w[16]; w[32] = (temp << 1) | (temp >> 31); temp = w[30] ^ w[25] ^ w[19] ^ w[17]; w[33] = (temp << 1) | (temp >> 31); temp = w[31] ^ w[26] ^ w[20] ^ w[18]; w[34] = (temp << 1) | (temp >> 31); temp = w[32] ^ w[27] ^ w[21] ^ w[19]; w[35] = (temp << 1) | (temp >> 31); temp = w[33] ^ w[28] ^ w[22] ^ w[20]; w[36] = (temp << 1) | (temp >> 31); temp = w[34] ^ w[29] ^ w[23] ^ w[21]; w[37] = (temp << 1) | (temp >> 31); temp = w[35] ^ w[30] ^ w[24] ^ w[22]; w[38] = (temp << 1) | (temp >> 31); temp = w[36] ^ w[31] ^ w[25] ^ w[23]; w[39] = (temp << 1) | (temp >> 31); temp = w[37] ^ w[32] ^ w[26] ^ w[24]; w[40] = (temp << 1) | (temp >> 31); temp = w[38] ^ w[33] ^ w[27] ^ w[25]; w[41] = (temp << 1) | (temp >> 31); temp = w[39] ^ w[34] ^ w[28] ^ w[26]; w[42] = (temp << 1) | (temp >> 31); temp = w[40] ^ w[35] ^ w[29] ^ w[27]; w[43] = (temp << 1) | (temp >> 31); temp = w[41] ^ w[36] ^ w[30] ^ w[28]; w[44] = (temp << 1) | (temp >> 31); temp = w[42] ^ w[37] ^ w[31] ^ w[29]; w[45] = (temp << 1) | (temp >> 31); temp = w[43] ^ w[38] ^ w[32] ^ w[30]; w[46] = (temp << 1) | (temp >> 31); temp = w[44] ^ w[39] ^ w[33] ^ w[31]; w[47] = (temp << 1) | (temp >> 31); temp = w[45] ^ w[40] ^ w[34] ^ w[32]; w[48] = (temp << 1) | (temp >> 31); temp = w[46] ^ w[41] ^ w[35] ^ w[33]; w[49] = (temp << 1) | (temp >> 31); temp = w[47] ^ w[42] ^ w[36] ^ w[34]; w[50] = (temp << 1) | (temp >> 31); temp = w[48] ^ w[43] ^ w[37] ^ w[35]; w[51] = (temp << 1) | (temp >> 31); temp = w[49] ^ w[44] ^ w[38] ^ w[36]; w[52] = (temp << 1) | (temp >> 31); temp = w[50] ^ w[45] ^ w[39] ^ w[37]; w[53] = (temp << 1) | (temp >> 31); temp = w[51] ^ w[46] ^ w[40] ^ w[38]; w[54] = (temp << 1) | (temp >> 31); temp = w[52] ^ w[47] ^ w[41] ^ w[39]; w[55] = (temp << 1) | (temp >> 31); temp = w[53] ^ w[48] ^ w[42] ^ w[40]; w[56] = (temp << 1) | (temp >> 31); temp = w[54] ^ w[49] ^ w[43] ^ w[41]; w[57] = (temp << 1) | (temp >> 31); temp = w[55] ^ w[50] ^ w[44] ^ w[42]; w[58] = (temp << 1) | (temp >> 31); temp = w[56] ^ w[51] ^ w[45] ^ w[43]; w[59] = (temp << 1) | (temp >> 31); temp = w[57] ^ w[52] ^ w[46] ^ w[44]; w[60] = (temp << 1) | (temp >> 31); temp = w[58] ^ w[53] ^ w[47] ^ w[45]; w[61] = (temp << 1) | (temp >> 31); temp = w[59] ^ w[54] ^ w[48] ^ w[46]; w[62] = (temp << 1) | (temp >> 31); temp = w[60] ^ w[55] ^ w[49] ^ w[47]; w[63] = (temp << 1) | (temp >> 31); temp = w[61] ^ w[56] ^ w[50] ^ w[48]; w[64] = (temp << 1) | (temp >> 31); temp = w[62] ^ w[57] ^ w[51] ^ w[49]; w[65] = (temp << 1) | (temp >> 31); temp = w[63] ^ w[58] ^ w[52] ^ w[50]; w[66] = (temp << 1) | (temp >> 31); temp = w[64] ^ w[59] ^ w[53] ^ w[51]; w[67] = (temp << 1) | (temp >> 31); temp = w[65] ^ w[60] ^ w[54] ^ w[52]; w[68] = (temp << 1) | (temp >> 31); temp = w[66] ^ w[61] ^ w[55] ^ w[53]; w[69] = (temp << 1) | (temp >> 31); temp = w[67] ^ w[62] ^ w[56] ^ w[54]; w[70] = (temp << 1) | (temp >> 31); temp = w[68] ^ w[63] ^ w[57] ^ w[55]; w[71] = (temp << 1) | (temp >> 31); temp = w[69] ^ w[64] ^ w[58] ^ w[56]; w[72] = (temp << 1) | (temp >> 31); temp = w[70] ^ w[65] ^ w[59] ^ w[57]; w[73] = (temp << 1) | (temp >> 31); temp = w[71] ^ w[66] ^ w[60] ^ w[58]; w[74] = (temp << 1) | (temp >> 31); temp = w[72] ^ w[67] ^ w[61] ^ w[59]; w[75] = (temp << 1) | (temp >> 31); temp = w[73] ^ w[68] ^ w[62] ^ w[60]; w[76] = (temp << 1) | (temp >> 31); temp = w[74] ^ w[69] ^ w[63] ^ w[61]; w[77] = (temp << 1) | (temp >> 31); temp = w[75] ^ w[70] ^ w[64] ^ w[62]; w[78] = (temp << 1) | (temp >> 31); temp = w[76] ^ w[71] ^ w[65] ^ w[63]; w[79] = (temp << 1) | (temp >> 31); a = h[0]; b = h[1]; c = h[2]; d = h[3]; e = h[4]; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[0] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[1] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[2] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[3] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[4] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[5] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[6] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[7] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[8] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[9] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[10] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[11] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[12] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[13] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[14] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[15] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[16] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[17] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[18] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | ((~b) & d)) + e + w[19] + 0x5A827999; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[20] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[21] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[22] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[23] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[24] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[25] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[26] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[27] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[28] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[29] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[30] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[31] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[32] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[33] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[34] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[35] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[36] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[37] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[38] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[39] + 0x6ED9EBA1; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[40] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[41] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[42] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[43] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[44] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[45] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[46] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[47] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[48] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[49] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[50] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[51] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[52] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[53] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[54] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[55] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[56] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[57] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[58] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + e + w[59] + 0x8F1BBCDC; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[60] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[61] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[62] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[63] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[64] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[65] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[66] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[67] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[68] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[69] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[70] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[71] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[72] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[73] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[74] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[75] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[76] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[77] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[78] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; temp = ((a << 5) | (a >> 27)) + (b ^ c ^ d) + e + w[79] + 0xCA62C1D6; e = d; d = c; c = (b << 30) | (b >> 2); b = a; a = temp; h[0] += a; h[1] += b; h[2] += c; h[3] += d; h[4] += e; };