1122
MD5_FF d, a, b, c, x(k + 13), S12, &HFD987193
MD5_FF c, d, a, b, x(k + 14), S13, &HA679438E
MD5_FF b, c, d, a, x(k + 15), S14, &H49B40821
MD5_GG a, b, c, d, x(k + 1), S21, &HF61E2562
MD5_GG d, a, b, c, x(k + 6), S22, &HC040B340
MD5_GG c, d, a, b, x(k + 11), S23, &H265E5A51
MD5_GG b, c, d, a, x(k + 0), S24, &HE9B6C7AA
MD5_GG a, b, c, d, x(k + 5), S21, &HD62F105D
MD5_GG d, a, b, c, x(k + 10), S22, &H2441453
MD5_GG c, d, a, b, x(k + 15), S23, &HD8A1E681
MD5_GG b, c, d, a, x(k + 4), S24, &HE7D3FBC8
MD5_GG a, b, c, d, x(k + 9), S21, &H21E1CDE6
MD5_GG d, a, b, c, x(k + 14), S22, &HC33707D6
MD5_GG c, d, a, b, x(k + 3), S23, &HF4D50D87
MD5_GG b, c, d, a, x(k + 8), S24, &H455A14ED
MD5_GG a, b, c, d, x(k + 13), S21, &HA9E3E905
MD5_GG d, a, b, c, x(k + 2), S22, &HFCEFA3F8
MD5_GG c, d, a, b, x(k + 7), S23, &H676F02D9
MD5_GG b, c, d, a, x(k + 12), S24, &H8D2A4C8A
MD5_HH a, b, c, d, x(k + 5), S31, &HFFFA3942
MD5_HH d, a, b, c, x(k + 8), S32, &H8771F681
MD5_HH c, d, a, b, x(k + 11), S33, &H6D9D6122
MD5_HH b, c, d, a, x(k + 14), S34, &HFDE5380C
MD5_HH a, b, c, d, x(k + 1), S31, &HA4BEEA44
MD5_HH d, a, b, c, x(k + 4), S32, &H4BDECFA9
MD5_HH c, d, a, b, x(k + 7), S33, &HF6BB4B60
MD5_HH b, c, d, a, x(k + 10), S34, &HBEBFBC70
MD5_HH a, b, c, d, x(k + 13), S31, &H289B7EC6
MD5_HH d, a, b, c, x(k + 0), S32, &HEAA127FA
MD5_HH c, d, a, b, x(k + 3), S33, &HD4EF3085
MD5_HH b, c, d, a, x(k + 6), S34, &H4881D05
MD5_HH a, b, c, d, x(k + 9), S31, &HD9D4D039
MD5_HH d, a, b, c, x(k + 12), S32, &HE6DB99E5
MD5_HH c, d, a, b, x(k + 15), S33, &H1FA27CF8
MD5_HH b, c, d, a, x(k + 2), S34, &HC4AC5665
MD5_II a, b, c, d, x(k + 0), S41, &HF4292244
MD5_II d, a, b, c, x(k + 7), S42, &H432AFF97
MD5_II c, d, a, b, x(k + 14), S43, &HAB9423A7
MD5_II b, c, d, a, x(k + 5), S44, &HFC93A039
MD5_II a, b, c, d, x(k + 12), S41, &H655B59C3
MD5_II d, a, b, c, x(k + 3), S42, &H8F0CCC92
MD5_II c, d, a, b, x(k + 10), S43, &HFFEFF47D
MD5_II b, c, d, a, x(k + 1), S44, &H85845DD1
MD5_II a, b, c, d, x(k + 8), S41, &H6FA87E4F
MD5_II d, a, b, c, x(k + 15), S42, &HFE2CE6E0
MD5_II c, d, a, b, x(k + 6), S43, &HA3014314
MD5_II b, c, d, a, x(k + 13), S44, &H4E0811A1
MD5_II a, b, c, d, x(k + 4), S41, &HF7537E82
MD5_II d, a, b, c, x(k + 11), S42, &HBD3AF235
MD5_II c, d, a, b, x(k + 2), S43, &H2AD7D2BB
MD5_II b, c, d, a, x(k + 9), S44, &HEB86D391
''加密步骤3:追加无符号转换
a = AddUnsigned(a, AA)
b = AddUnsigned(b, BB)
c = AddUnsigned(c, CC)
d = AddUnsigned(d, DD)
Next
If sType = 32 Then
''加密步骤4:分割合并各8位16进制转换
MD5 = LCase(WordToHex(a) & WordToHex(b) & WordToHex(c) & WordToHex(d))
Else
MD5 = LCase(WordToHex(b) & WordToHex(c))
End If
End Function
Private Function SHA256_LShift(byVal lValue, byVal iShiftBits)
If iShiftBits = 0 Then
SHA256_LShift = lValue
Exit Function
ElseIf iShiftBits = 31 Then
If lValue And 1 Then
SHA256_LShift = &H80000000
Else
SHA256_LShift = 0
End If
Exit Function
ElseIf iShiftBits < 0 or iShiftBits > 31 Then
Err.Raise 6
End If
If (lValue And SHA256_m_l2Power(31 - iShiftBits))