GetHashFinalBlock() static private method

static private GetHashFinalBlock ( byte input, int ibStart, int cbSize, ABCDStruct, ABCD, Int64 len ) : byte[]
input byte
ibStart int
cbSize int
ABCD ABCDStruct,
len Int64
return byte[]
コード例 #1
0
    public static byte[] GetHash(byte[] input)
    {
        if (null == input)
        {
            throw new System.ArgumentNullException("input", "Unable to calculate hash over null input data");
        }

        //Intitial values defined in RFC 1321
        var abcd = new ABCDStruct();

        abcd.A = 0x67452301;
        abcd.B = 0xefcdab89;
        abcd.C = 0x98badcfe;
        abcd.D = 0x10325476;

        //We pass in the input array by block, the final block of data must be handled specialy for padding & length embeding
        int startIndex = 0;

        while (startIndex <= input.Length - 64)
        {
            MD5Core.GetHashBlock(input, ref abcd, startIndex);
            startIndex += 64;
        }
        // The final data block.
        return(MD5Core.GetHashFinalBlock(input, startIndex, input.Length - startIndex, abcd, (Int64)input.Length * 8));
    }
コード例 #2
0
ファイル: FipsEncryptor.cs プロジェクト: Danielle9897/ravendb
            public byte[] TransformFinalBlock()
            {
                ThrowNotSupportedExceptionForNonThreadSafeMethod();

                totalLength += remainingCount;
                return(MD5Core.GetHashFinalBlock(remainingBuffer, 0, remainingCount, abcdStruct, (Int64)totalLength * 8));
            }
コード例 #3
0
ファイル: MD5Core.cs プロジェクト: Makzz90/VKClient_re
    public static byte[] GetHash(byte[] input)
    {
        if (input == null)
        {
            throw new ArgumentNullException("input", "Unable to calculate hash over null input data");
        }
        ABCDStruct ABCDValue = new ABCDStruct();

        ABCDValue.A = 1732584193U;
        ABCDValue.B = 4023233417U;
        ABCDValue.C = 2562383102U;
        ABCDValue.D = 271733878U;
        int ibStart = 0;

        while (ibStart <= input.Length - 64)
        {
            MD5Core.GetHashBlock(input, ref ABCDValue, ibStart);
            ibStart += 64;
        }
        return(MD5Core.GetHashFinalBlock(input, ibStart, input.Length - ibStart, ABCDValue, (long)input.Length * 8L));
    }
コード例 #4
0
 protected override byte[] HashFinal()
 {
     this.m_hashValue = MD5Core.GetHashFinalBlock(_data, 0, _dataSize, _abcd, _totalLength * 8);
     return(this.m_hashValue);
 }
コード例 #5
0
 protected override byte[] HashFinal()
 {
     base.HashValue = MD5Core.GetHashFinalBlock(_data, 0, _dataSize, _abcd, _totalLength * 8);
     return base.HashValue;
 }
コード例 #6
0
ファイル: FipsEncryptor.cs プロジェクト: stvoidmain/ravendb
 public byte[] TransformFinalBlock()
 {
     totalLength += remainingCount;
     return(MD5Core.GetHashFinalBlock(remainingBuffer, 0, remainingCount, abcdStruct, (Int64)totalLength * 8));
 }