unsigned long H[5] = {0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0}; // 初始链接变量
void creat_w(unsigned char input[64], unsigned long w[80]) // 获得W
{
int i, j;
unsigned long temp, temp1;
for (i = 0; i < 16; i++)
{
j = 4 * i;
w[i] = ((long)input[j]) << 24 | ((long)input[1 + j]) << 16 | ((long)input[2 + j]) << 8 | ((long)input[3 + j]) << 0;
}
for (i = 16; i < 80; i++)
{
w[i] = w[i - 16] ^ w[i - 14] ^ w[i - 8] ^ w[i - 3];
temp = w[i] << 1;
temp1 = w[i] >> 31;
w[i] = temp | temp1;
}
}
void SHA1_group(unsigned char input[64], unsigned long hash[5]) // 对512位的消息组进行加密
{
unsigned long w[80];
unsigned long A, B, C, D, E, temp, temp1, temp2, temp3, k, f;
int i, flag;
creat\_w(input, w);
A = hash[