|
@@ -9,7 +9,7 @@ namespace Renci.SshNet.Security.Cryptography
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
///
|
|
///
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
- public class RIPEMD160Hash : HashAlgorithm
|
|
|
|
|
|
|
+ public sealed class RIPEMD160Hash : HashAlgorithm
|
|
|
{
|
|
{
|
|
|
private const int DIGEST_SIZE = 20;
|
|
private const int DIGEST_SIZE = 20;
|
|
|
|
|
|
|
@@ -85,7 +85,7 @@ namespace Renci.SshNet.Security.Cryptography
|
|
|
//
|
|
//
|
|
|
// fill the current word
|
|
// fill the current word
|
|
|
//
|
|
//
|
|
|
- while ((_bufferOffset != 0) && (cbSize > 0))
|
|
|
|
|
|
|
+ while ((this._bufferOffset != 0) && (cbSize > 0))
|
|
|
{
|
|
{
|
|
|
this.Update(array[ibStart]);
|
|
this.Update(array[ibStart]);
|
|
|
ibStart++;
|
|
ibStart++;
|
|
@@ -95,13 +95,13 @@ namespace Renci.SshNet.Security.Cryptography
|
|
|
//
|
|
//
|
|
|
// process whole words.
|
|
// process whole words.
|
|
|
//
|
|
//
|
|
|
- while (cbSize > _buffer.Length)
|
|
|
|
|
|
|
+ while (cbSize > this._buffer.Length)
|
|
|
{
|
|
{
|
|
|
this.ProcessWord(array, ibStart);
|
|
this.ProcessWord(array, ibStart);
|
|
|
|
|
|
|
|
- ibStart += _buffer.Length;
|
|
|
|
|
- cbSize -= _buffer.Length;
|
|
|
|
|
- _byteCount += _buffer.Length;
|
|
|
|
|
|
|
+ ibStart += this._buffer.Length;
|
|
|
|
|
+ cbSize -= this._buffer.Length;
|
|
|
|
|
+ this._byteCount += this._buffer.Length;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//
|
|
//
|
|
@@ -119,7 +119,7 @@ namespace Renci.SshNet.Security.Cryptography
|
|
|
protected override byte[] HashFinal()
|
|
protected override byte[] HashFinal()
|
|
|
{
|
|
{
|
|
|
var output = new byte[DIGEST_SIZE];
|
|
var output = new byte[DIGEST_SIZE];
|
|
|
- long bitLength = (_byteCount << 3);
|
|
|
|
|
|
|
+ long bitLength = (this._byteCount << 3);
|
|
|
|
|
|
|
|
//
|
|
//
|
|
|
// add the pad bytes.
|
|
// add the pad bytes.
|
|
@@ -142,11 +142,17 @@ namespace Renci.SshNet.Security.Cryptography
|
|
|
return output;
|
|
return output;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Initializes an implementation of the <see cref="T:System.Security.Cryptography.HashAlgorithm" /> class.
|
|
|
|
|
+ /// </summary>
|
|
|
public override void Initialize()
|
|
public override void Initialize()
|
|
|
{
|
|
{
|
|
|
this.InternalInitialize();
|
|
this.InternalInitialize();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Initializes a new instance of the <see cref="RIPEMD160Hash" /> class.
|
|
|
|
|
+ /// </summary>
|
|
|
public RIPEMD160Hash()
|
|
public RIPEMD160Hash()
|
|
|
{
|
|
{
|
|
|
this._buffer = new byte[4];
|
|
this._buffer = new byte[4];
|
|
@@ -155,10 +161,10 @@ namespace Renci.SshNet.Security.Cryptography
|
|
|
|
|
|
|
|
private void ProcessWord(byte[] input, int inOff)
|
|
private void ProcessWord(byte[] input, int inOff)
|
|
|
{
|
|
{
|
|
|
- X[_offset++] = (input[inOff] & 0xff) | ((input[inOff + 1] & 0xff) << 8)
|
|
|
|
|
|
|
+ this.X[this._offset++] = (input[inOff] & 0xff) | ((input[inOff + 1] & 0xff) << 8)
|
|
|
| ((input[inOff + 2] & 0xff) << 16) | ((input[inOff + 3] & 0xff) << 24);
|
|
| ((input[inOff + 2] & 0xff) << 16) | ((input[inOff + 3] & 0xff) << 24);
|
|
|
|
|
|
|
|
- if (_offset == 16)
|
|
|
|
|
|
|
+ if (this._offset == 16)
|
|
|
{
|
|
{
|
|
|
ProcessBlock();
|
|
ProcessBlock();
|
|
|
}
|
|
}
|
|
@@ -166,13 +172,13 @@ namespace Renci.SshNet.Security.Cryptography
|
|
|
|
|
|
|
|
private void ProcessLength(long bitLength)
|
|
private void ProcessLength(long bitLength)
|
|
|
{
|
|
{
|
|
|
- if (_offset > 14)
|
|
|
|
|
|
|
+ if (this._offset > 14)
|
|
|
{
|
|
{
|
|
|
ProcessBlock();
|
|
ProcessBlock();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- X[14] = (int)(bitLength & 0xffffffff);
|
|
|
|
|
- X[15] = (int)((ulong)bitLength >> 32);
|
|
|
|
|
|
|
+ this.X[14] = (int)(bitLength & 0xffffffff);
|
|
|
|
|
+ this.X[15] = (int)((ulong)bitLength >> 32);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void UnpackWord(int word, byte[] outBytes, int outOff)
|
|
private void UnpackWord(int word, byte[] outBytes, int outOff)
|
|
@@ -185,15 +191,15 @@ namespace Renci.SshNet.Security.Cryptography
|
|
|
|
|
|
|
|
private void Update(byte input)
|
|
private void Update(byte input)
|
|
|
{
|
|
{
|
|
|
- _buffer[_bufferOffset++] = input;
|
|
|
|
|
|
|
+ this._buffer[this._bufferOffset++] = input;
|
|
|
|
|
|
|
|
- if (_bufferOffset == _buffer.Length)
|
|
|
|
|
|
|
+ if (this._bufferOffset == this._buffer.Length)
|
|
|
{
|
|
{
|
|
|
- ProcessWord(_buffer, 0);
|
|
|
|
|
- _bufferOffset = 0;
|
|
|
|
|
|
|
+ ProcessWord(this._buffer, 0);
|
|
|
|
|
+ this._bufferOffset = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- _byteCount++;
|
|
|
|
|
|
|
+ this._byteCount++;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -201,9 +207,12 @@ namespace Renci.SshNet.Security.Cryptography
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
private void InternalInitialize()
|
|
private void InternalInitialize()
|
|
|
{
|
|
{
|
|
|
- _byteCount = 0;
|
|
|
|
|
- _bufferOffset = 0;
|
|
|
|
|
- Array.Clear(_buffer, 0, _buffer.Length);
|
|
|
|
|
|
|
+ this._byteCount = 0;
|
|
|
|
|
+ this._bufferOffset = 0;
|
|
|
|
|
+ for (int i = 0; i < _buffer.Length; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ this._buffer[i] = 0;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
H0 = unchecked((int)0x67452301);
|
|
H0 = unchecked((int)0x67452301);
|
|
|
H1 = unchecked((int)0xefcdab89);
|
|
H1 = unchecked((int)0xefcdab89);
|
|
@@ -211,11 +220,11 @@ namespace Renci.SshNet.Security.Cryptography
|
|
|
H3 = unchecked((int)0x10325476);
|
|
H3 = unchecked((int)0x10325476);
|
|
|
H4 = unchecked((int)0xc3d2e1f0);
|
|
H4 = unchecked((int)0xc3d2e1f0);
|
|
|
|
|
|
|
|
- _offset = 0;
|
|
|
|
|
|
|
+ this._offset = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i != X.Length; i++)
|
|
for (int i = 0; i != X.Length; i++)
|
|
|
{
|
|
{
|
|
|
- X[i] = 0;
|
|
|
|
|
|
|
+ this.X[i] = 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -302,196 +311,196 @@ namespace Renci.SshNet.Security.Cryptography
|
|
|
// Rounds 1 - 16
|
|
// Rounds 1 - 16
|
|
|
//
|
|
//
|
|
|
// left
|
|
// left
|
|
|
- a = RL(a + F1(b, c, d) + X[0], 11) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F1(a, b, c) + X[1], 14) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F1(e, a, b) + X[2], 15) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F1(d, e, a) + X[3], 12) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F1(c, d, e) + X[4], 5) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F1(b, c, d) + X[5], 8) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F1(a, b, c) + X[6], 7) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F1(e, a, b) + X[7], 9) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F1(d, e, a) + X[8], 11) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F1(c, d, e) + X[9], 13) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F1(b, c, d) + X[10], 14) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F1(a, b, c) + X[11], 15) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F1(e, a, b) + X[12], 6) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F1(d, e, a) + X[13], 7) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F1(c, d, e) + X[14], 9) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F1(b, c, d) + X[15], 8) + e; c = RL(c, 10);
|
|
|
|
|
|
|
+ a = RL(a + F1(b, c, d) + this.X[0], 11) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F1(a, b, c) + this.X[1], 14) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F1(e, a, b) + this.X[2], 15) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F1(d, e, a) + this.X[3], 12) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F1(c, d, e) + this.X[4], 5) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F1(b, c, d) + this.X[5], 8) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F1(a, b, c) + this.X[6], 7) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F1(e, a, b) + this.X[7], 9) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F1(d, e, a) + this.X[8], 11) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F1(c, d, e) + this.X[9], 13) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F1(b, c, d) + this.X[10], 14) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F1(a, b, c) + this.X[11], 15) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F1(e, a, b) + this.X[12], 6) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F1(d, e, a) + this.X[13], 7) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F1(c, d, e) + this.X[14], 9) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F1(b, c, d) + this.X[15], 8) + e; c = RL(c, 10);
|
|
|
|
|
|
|
|
// right
|
|
// right
|
|
|
- aa = RL(aa + F5(bb, cc, dd) + X[5] + unchecked((int)0x50a28be6), 8) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F5(aa, bb, cc) + X[14] + unchecked((int)0x50a28be6), 9) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F5(ee, aa, bb) + X[7] + unchecked((int)0x50a28be6), 9) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F5(dd, ee, aa) + X[0] + unchecked((int)0x50a28be6), 11) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F5(cc, dd, ee) + X[9] + unchecked((int)0x50a28be6), 13) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F5(bb, cc, dd) + X[2] + unchecked((int)0x50a28be6), 15) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F5(aa, bb, cc) + X[11] + unchecked((int)0x50a28be6), 15) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F5(ee, aa, bb) + X[4] + unchecked((int)0x50a28be6), 5) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F5(dd, ee, aa) + X[13] + unchecked((int)0x50a28be6), 7) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F5(cc, dd, ee) + X[6] + unchecked((int)0x50a28be6), 7) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F5(bb, cc, dd) + X[15] + unchecked((int)0x50a28be6), 8) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F5(aa, bb, cc) + X[8] + unchecked((int)0x50a28be6), 11) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F5(ee, aa, bb) + X[1] + unchecked((int)0x50a28be6), 14) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F5(dd, ee, aa) + X[10] + unchecked((int)0x50a28be6), 14) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F5(cc, dd, ee) + X[3] + unchecked((int)0x50a28be6), 12) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F5(bb, cc, dd) + X[12] + unchecked((int)0x50a28be6), 6) + ee; cc = RL(cc, 10);
|
|
|
|
|
|
|
+ aa = RL(aa + F5(bb, cc, dd) + this.X[5] + unchecked((int)0x50a28be6), 8) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F5(aa, bb, cc) + this.X[14] + unchecked((int)0x50a28be6), 9) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F5(ee, aa, bb) + this.X[7] + unchecked((int)0x50a28be6), 9) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F5(dd, ee, aa) + this.X[0] + unchecked((int)0x50a28be6), 11) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F5(cc, dd, ee) + this.X[9] + unchecked((int)0x50a28be6), 13) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F5(bb, cc, dd) + this.X[2] + unchecked((int)0x50a28be6), 15) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F5(aa, bb, cc) + this.X[11] + unchecked((int)0x50a28be6), 15) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F5(ee, aa, bb) + this.X[4] + unchecked((int)0x50a28be6), 5) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F5(dd, ee, aa) + this.X[13] + unchecked((int)0x50a28be6), 7) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F5(cc, dd, ee) + this.X[6] + unchecked((int)0x50a28be6), 7) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F5(bb, cc, dd) + this.X[15] + unchecked((int)0x50a28be6), 8) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F5(aa, bb, cc) + this.X[8] + unchecked((int)0x50a28be6), 11) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F5(ee, aa, bb) + this.X[1] + unchecked((int)0x50a28be6), 14) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F5(dd, ee, aa) + this.X[10] + unchecked((int)0x50a28be6), 14) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F5(cc, dd, ee) + this.X[3] + unchecked((int)0x50a28be6), 12) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F5(bb, cc, dd) + this.X[12] + unchecked((int)0x50a28be6), 6) + ee; cc = RL(cc, 10);
|
|
|
|
|
|
|
|
//
|
|
//
|
|
|
// Rounds 16-31
|
|
// Rounds 16-31
|
|
|
//
|
|
//
|
|
|
// left
|
|
// left
|
|
|
- e = RL(e + F2(a, b, c) + X[7] + unchecked((int)0x5a827999), 7) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F2(e, a, b) + X[4] + unchecked((int)0x5a827999), 6) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F2(d, e, a) + X[13] + unchecked((int)0x5a827999), 8) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F2(c, d, e) + X[1] + unchecked((int)0x5a827999), 13) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F2(b, c, d) + X[10] + unchecked((int)0x5a827999), 11) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F2(a, b, c) + X[6] + unchecked((int)0x5a827999), 9) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F2(e, a, b) + X[15] + unchecked((int)0x5a827999), 7) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F2(d, e, a) + X[3] + unchecked((int)0x5a827999), 15) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F2(c, d, e) + X[12] + unchecked((int)0x5a827999), 7) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F2(b, c, d) + X[0] + unchecked((int)0x5a827999), 12) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F2(a, b, c) + X[9] + unchecked((int)0x5a827999), 15) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F2(e, a, b) + X[5] + unchecked((int)0x5a827999), 9) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F2(d, e, a) + X[2] + unchecked((int)0x5a827999), 11) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F2(c, d, e) + X[14] + unchecked((int)0x5a827999), 7) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F2(b, c, d) + X[11] + unchecked((int)0x5a827999), 13) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F2(a, b, c) + X[8] + unchecked((int)0x5a827999), 12) + d; b = RL(b, 10);
|
|
|
|
|
|
|
+ e = RL(e + F2(a, b, c) + this.X[7] + unchecked((int)0x5a827999), 7) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F2(e, a, b) + this.X[4] + unchecked((int)0x5a827999), 6) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F2(d, e, a) + this.X[13] + unchecked((int)0x5a827999), 8) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F2(c, d, e) + this.X[1] + unchecked((int)0x5a827999), 13) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F2(b, c, d) + this.X[10] + unchecked((int)0x5a827999), 11) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F2(a, b, c) + this.X[6] + unchecked((int)0x5a827999), 9) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F2(e, a, b) + this.X[15] + unchecked((int)0x5a827999), 7) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F2(d, e, a) + this.X[3] + unchecked((int)0x5a827999), 15) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F2(c, d, e) + this.X[12] + unchecked((int)0x5a827999), 7) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F2(b, c, d) + this.X[0] + unchecked((int)0x5a827999), 12) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F2(a, b, c) + this.X[9] + unchecked((int)0x5a827999), 15) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F2(e, a, b) + this.X[5] + unchecked((int)0x5a827999), 9) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F2(d, e, a) + this.X[2] + unchecked((int)0x5a827999), 11) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F2(c, d, e) + this.X[14] + unchecked((int)0x5a827999), 7) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F2(b, c, d) + this.X[11] + unchecked((int)0x5a827999), 13) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F2(a, b, c) + this.X[8] + unchecked((int)0x5a827999), 12) + d; b = RL(b, 10);
|
|
|
|
|
|
|
|
// right
|
|
// right
|
|
|
- ee = RL(ee + F4(aa, bb, cc) + X[6] + unchecked((int)0x5c4dd124), 9) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F4(ee, aa, bb) + X[11] + unchecked((int)0x5c4dd124), 13) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F4(dd, ee, aa) + X[3] + unchecked((int)0x5c4dd124), 15) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F4(cc, dd, ee) + X[7] + unchecked((int)0x5c4dd124), 7) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F4(bb, cc, dd) + X[0] + unchecked((int)0x5c4dd124), 12) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F4(aa, bb, cc) + X[13] + unchecked((int)0x5c4dd124), 8) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F4(ee, aa, bb) + X[5] + unchecked((int)0x5c4dd124), 9) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F4(dd, ee, aa) + X[10] + unchecked((int)0x5c4dd124), 11) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F4(cc, dd, ee) + X[14] + unchecked((int)0x5c4dd124), 7) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F4(bb, cc, dd) + X[15] + unchecked((int)0x5c4dd124), 7) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F4(aa, bb, cc) + X[8] + unchecked((int)0x5c4dd124), 12) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F4(ee, aa, bb) + X[12] + unchecked((int)0x5c4dd124), 7) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F4(dd, ee, aa) + X[4] + unchecked((int)0x5c4dd124), 6) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F4(cc, dd, ee) + X[9] + unchecked((int)0x5c4dd124), 15) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F4(bb, cc, dd) + X[1] + unchecked((int)0x5c4dd124), 13) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F4(aa, bb, cc) + X[2] + unchecked((int)0x5c4dd124), 11) + dd; bb = RL(bb, 10);
|
|
|
|
|
|
|
+ ee = RL(ee + F4(aa, bb, cc) + this.X[6] + unchecked((int)0x5c4dd124), 9) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F4(ee, aa, bb) + this.X[11] + unchecked((int)0x5c4dd124), 13) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F4(dd, ee, aa) + this.X[3] + unchecked((int)0x5c4dd124), 15) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F4(cc, dd, ee) + this.X[7] + unchecked((int)0x5c4dd124), 7) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F4(bb, cc, dd) + this.X[0] + unchecked((int)0x5c4dd124), 12) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F4(aa, bb, cc) + this.X[13] + unchecked((int)0x5c4dd124), 8) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F4(ee, aa, bb) + this.X[5] + unchecked((int)0x5c4dd124), 9) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F4(dd, ee, aa) + this.X[10] + unchecked((int)0x5c4dd124), 11) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F4(cc, dd, ee) + this.X[14] + unchecked((int)0x5c4dd124), 7) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F4(bb, cc, dd) + this.X[15] + unchecked((int)0x5c4dd124), 7) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F4(aa, bb, cc) + this.X[8] + unchecked((int)0x5c4dd124), 12) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F4(ee, aa, bb) + this.X[12] + unchecked((int)0x5c4dd124), 7) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F4(dd, ee, aa) + this.X[4] + unchecked((int)0x5c4dd124), 6) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F4(cc, dd, ee) + this.X[9] + unchecked((int)0x5c4dd124), 15) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F4(bb, cc, dd) + this.X[1] + unchecked((int)0x5c4dd124), 13) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F4(aa, bb, cc) + this.X[2] + unchecked((int)0x5c4dd124), 11) + dd; bb = RL(bb, 10);
|
|
|
|
|
|
|
|
//
|
|
//
|
|
|
// Rounds 32-47
|
|
// Rounds 32-47
|
|
|
//
|
|
//
|
|
|
// left
|
|
// left
|
|
|
- d = RL(d + F3(e, a, b) + X[3] + unchecked((int)0x6ed9eba1), 11) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F3(d, e, a) + X[10] + unchecked((int)0x6ed9eba1), 13) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F3(c, d, e) + X[14] + unchecked((int)0x6ed9eba1), 6) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F3(b, c, d) + X[4] + unchecked((int)0x6ed9eba1), 7) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F3(a, b, c) + X[9] + unchecked((int)0x6ed9eba1), 14) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F3(e, a, b) + X[15] + unchecked((int)0x6ed9eba1), 9) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F3(d, e, a) + X[8] + unchecked((int)0x6ed9eba1), 13) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F3(c, d, e) + X[1] + unchecked((int)0x6ed9eba1), 15) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F3(b, c, d) + X[2] + unchecked((int)0x6ed9eba1), 14) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F3(a, b, c) + X[7] + unchecked((int)0x6ed9eba1), 8) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F3(e, a, b) + X[0] + unchecked((int)0x6ed9eba1), 13) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F3(d, e, a) + X[6] + unchecked((int)0x6ed9eba1), 6) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F3(c, d, e) + X[13] + unchecked((int)0x6ed9eba1), 5) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F3(b, c, d) + X[11] + unchecked((int)0x6ed9eba1), 12) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F3(a, b, c) + X[5] + unchecked((int)0x6ed9eba1), 7) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F3(e, a, b) + X[12] + unchecked((int)0x6ed9eba1), 5) + c; a = RL(a, 10);
|
|
|
|
|
|
|
+ d = RL(d + F3(e, a, b) + this.X[3] + unchecked((int)0x6ed9eba1), 11) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F3(d, e, a) + this.X[10] + unchecked((int)0x6ed9eba1), 13) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F3(c, d, e) + this.X[14] + unchecked((int)0x6ed9eba1), 6) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F3(b, c, d) + this.X[4] + unchecked((int)0x6ed9eba1), 7) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F3(a, b, c) + this.X[9] + unchecked((int)0x6ed9eba1), 14) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F3(e, a, b) + this.X[15] + unchecked((int)0x6ed9eba1), 9) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F3(d, e, a) + this.X[8] + unchecked((int)0x6ed9eba1), 13) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F3(c, d, e) + this.X[1] + unchecked((int)0x6ed9eba1), 15) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F3(b, c, d) + this.X[2] + unchecked((int)0x6ed9eba1), 14) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F3(a, b, c) + this.X[7] + unchecked((int)0x6ed9eba1), 8) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F3(e, a, b) + this.X[0] + unchecked((int)0x6ed9eba1), 13) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F3(d, e, a) + this.X[6] + unchecked((int)0x6ed9eba1), 6) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F3(c, d, e) + this.X[13] + unchecked((int)0x6ed9eba1), 5) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F3(b, c, d) + this.X[11] + unchecked((int)0x6ed9eba1), 12) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F3(a, b, c) + this.X[5] + unchecked((int)0x6ed9eba1), 7) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F3(e, a, b) + this.X[12] + unchecked((int)0x6ed9eba1), 5) + c; a = RL(a, 10);
|
|
|
|
|
|
|
|
// right
|
|
// right
|
|
|
- dd = RL(dd + F3(ee, aa, bb) + X[15] + unchecked((int)0x6d703ef3), 9) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F3(dd, ee, aa) + X[5] + unchecked((int)0x6d703ef3), 7) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F3(cc, dd, ee) + X[1] + unchecked((int)0x6d703ef3), 15) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F3(bb, cc, dd) + X[3] + unchecked((int)0x6d703ef3), 11) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F3(aa, bb, cc) + X[7] + unchecked((int)0x6d703ef3), 8) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F3(ee, aa, bb) + X[14] + unchecked((int)0x6d703ef3), 6) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F3(dd, ee, aa) + X[6] + unchecked((int)0x6d703ef3), 6) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F3(cc, dd, ee) + X[9] + unchecked((int)0x6d703ef3), 14) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F3(bb, cc, dd) + X[11] + unchecked((int)0x6d703ef3), 12) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F3(aa, bb, cc) + X[8] + unchecked((int)0x6d703ef3), 13) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F3(ee, aa, bb) + X[12] + unchecked((int)0x6d703ef3), 5) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F3(dd, ee, aa) + X[2] + unchecked((int)0x6d703ef3), 14) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F3(cc, dd, ee) + X[10] + unchecked((int)0x6d703ef3), 13) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F3(bb, cc, dd) + X[0] + unchecked((int)0x6d703ef3), 13) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F3(aa, bb, cc) + X[4] + unchecked((int)0x6d703ef3), 7) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F3(ee, aa, bb) + X[13] + unchecked((int)0x6d703ef3), 5) + cc; aa = RL(aa, 10);
|
|
|
|
|
|
|
+ dd = RL(dd + F3(ee, aa, bb) + this.X[15] + unchecked((int)0x6d703ef3), 9) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F3(dd, ee, aa) + this.X[5] + unchecked((int)0x6d703ef3), 7) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F3(cc, dd, ee) + this.X[1] + unchecked((int)0x6d703ef3), 15) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F3(bb, cc, dd) + this.X[3] + unchecked((int)0x6d703ef3), 11) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F3(aa, bb, cc) + this.X[7] + unchecked((int)0x6d703ef3), 8) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F3(ee, aa, bb) + this.X[14] + unchecked((int)0x6d703ef3), 6) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F3(dd, ee, aa) + this.X[6] + unchecked((int)0x6d703ef3), 6) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F3(cc, dd, ee) + this.X[9] + unchecked((int)0x6d703ef3), 14) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F3(bb, cc, dd) + this.X[11] + unchecked((int)0x6d703ef3), 12) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F3(aa, bb, cc) + this.X[8] + unchecked((int)0x6d703ef3), 13) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F3(ee, aa, bb) + this.X[12] + unchecked((int)0x6d703ef3), 5) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F3(dd, ee, aa) + this.X[2] + unchecked((int)0x6d703ef3), 14) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F3(cc, dd, ee) + this.X[10] + unchecked((int)0x6d703ef3), 13) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F3(bb, cc, dd) + this.X[0] + unchecked((int)0x6d703ef3), 13) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F3(aa, bb, cc) + this.X[4] + unchecked((int)0x6d703ef3), 7) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F3(ee, aa, bb) + this.X[13] + unchecked((int)0x6d703ef3), 5) + cc; aa = RL(aa, 10);
|
|
|
|
|
|
|
|
//
|
|
//
|
|
|
// Rounds 48-63
|
|
// Rounds 48-63
|
|
|
//
|
|
//
|
|
|
// left
|
|
// left
|
|
|
- c = RL(c + F4(d, e, a) + X[1] + unchecked((int)0x8f1bbcdc), 11) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F4(c, d, e) + X[9] + unchecked((int)0x8f1bbcdc), 12) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F4(b, c, d) + X[11] + unchecked((int)0x8f1bbcdc), 14) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F4(a, b, c) + X[10] + unchecked((int)0x8f1bbcdc), 15) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F4(e, a, b) + X[0] + unchecked((int)0x8f1bbcdc), 14) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F4(d, e, a) + X[8] + unchecked((int)0x8f1bbcdc), 15) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F4(c, d, e) + X[12] + unchecked((int)0x8f1bbcdc), 9) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F4(b, c, d) + X[4] + unchecked((int)0x8f1bbcdc), 8) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F4(a, b, c) + X[13] + unchecked((int)0x8f1bbcdc), 9) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F4(e, a, b) + X[3] + unchecked((int)0x8f1bbcdc), 14) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F4(d, e, a) + X[7] + unchecked((int)0x8f1bbcdc), 5) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F4(c, d, e) + X[15] + unchecked((int)0x8f1bbcdc), 6) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F4(b, c, d) + X[14] + unchecked((int)0x8f1bbcdc), 8) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F4(a, b, c) + X[5] + unchecked((int)0x8f1bbcdc), 6) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F4(e, a, b) + X[6] + unchecked((int)0x8f1bbcdc), 5) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F4(d, e, a) + X[2] + unchecked((int)0x8f1bbcdc), 12) + b; e = RL(e, 10);
|
|
|
|
|
|
|
+ c = RL(c + F4(d, e, a) + this.X[1] + unchecked((int)0x8f1bbcdc), 11) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F4(c, d, e) + this.X[9] + unchecked((int)0x8f1bbcdc), 12) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F4(b, c, d) + this.X[11] + unchecked((int)0x8f1bbcdc), 14) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F4(a, b, c) + this.X[10] + unchecked((int)0x8f1bbcdc), 15) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F4(e, a, b) + this.X[0] + unchecked((int)0x8f1bbcdc), 14) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F4(d, e, a) + this.X[8] + unchecked((int)0x8f1bbcdc), 15) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F4(c, d, e) + this.X[12] + unchecked((int)0x8f1bbcdc), 9) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F4(b, c, d) + this.X[4] + unchecked((int)0x8f1bbcdc), 8) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F4(a, b, c) + this.X[13] + unchecked((int)0x8f1bbcdc), 9) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F4(e, a, b) + this.X[3] + unchecked((int)0x8f1bbcdc), 14) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F4(d, e, a) + this.X[7] + unchecked((int)0x8f1bbcdc), 5) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F4(c, d, e) + this.X[15] + unchecked((int)0x8f1bbcdc), 6) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F4(b, c, d) + this.X[14] + unchecked((int)0x8f1bbcdc), 8) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F4(a, b, c) + this.X[5] + unchecked((int)0x8f1bbcdc), 6) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F4(e, a, b) + this.X[6] + unchecked((int)0x8f1bbcdc), 5) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F4(d, e, a) + this.X[2] + unchecked((int)0x8f1bbcdc), 12) + b; e = RL(e, 10);
|
|
|
|
|
|
|
|
// right
|
|
// right
|
|
|
- cc = RL(cc + F2(dd, ee, aa) + X[8] + unchecked((int)0x7a6d76e9), 15) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F2(cc, dd, ee) + X[6] + unchecked((int)0x7a6d76e9), 5) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F2(bb, cc, dd) + X[4] + unchecked((int)0x7a6d76e9), 8) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F2(aa, bb, cc) + X[1] + unchecked((int)0x7a6d76e9), 11) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F2(ee, aa, bb) + X[3] + unchecked((int)0x7a6d76e9), 14) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F2(dd, ee, aa) + X[11] + unchecked((int)0x7a6d76e9), 14) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F2(cc, dd, ee) + X[15] + unchecked((int)0x7a6d76e9), 6) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F2(bb, cc, dd) + X[0] + unchecked((int)0x7a6d76e9), 14) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F2(aa, bb, cc) + X[5] + unchecked((int)0x7a6d76e9), 6) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F2(ee, aa, bb) + X[12] + unchecked((int)0x7a6d76e9), 9) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F2(dd, ee, aa) + X[2] + unchecked((int)0x7a6d76e9), 12) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F2(cc, dd, ee) + X[13] + unchecked((int)0x7a6d76e9), 9) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F2(bb, cc, dd) + X[9] + unchecked((int)0x7a6d76e9), 12) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F2(aa, bb, cc) + X[7] + unchecked((int)0x7a6d76e9), 5) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F2(ee, aa, bb) + X[10] + unchecked((int)0x7a6d76e9), 15) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F2(dd, ee, aa) + X[14] + unchecked((int)0x7a6d76e9), 8) + bb; ee = RL(ee, 10);
|
|
|
|
|
|
|
+ cc = RL(cc + F2(dd, ee, aa) + this.X[8] + unchecked((int)0x7a6d76e9), 15) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F2(cc, dd, ee) + this.X[6] + unchecked((int)0x7a6d76e9), 5) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F2(bb, cc, dd) + this.X[4] + unchecked((int)0x7a6d76e9), 8) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F2(aa, bb, cc) + this.X[1] + unchecked((int)0x7a6d76e9), 11) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F2(ee, aa, bb) + this.X[3] + unchecked((int)0x7a6d76e9), 14) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F2(dd, ee, aa) + this.X[11] + unchecked((int)0x7a6d76e9), 14) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F2(cc, dd, ee) + this.X[15] + unchecked((int)0x7a6d76e9), 6) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F2(bb, cc, dd) + this.X[0] + unchecked((int)0x7a6d76e9), 14) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F2(aa, bb, cc) + this.X[5] + unchecked((int)0x7a6d76e9), 6) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F2(ee, aa, bb) + this.X[12] + unchecked((int)0x7a6d76e9), 9) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F2(dd, ee, aa) + this.X[2] + unchecked((int)0x7a6d76e9), 12) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F2(cc, dd, ee) + this.X[13] + unchecked((int)0x7a6d76e9), 9) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F2(bb, cc, dd) + this.X[9] + unchecked((int)0x7a6d76e9), 12) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F2(aa, bb, cc) + this.X[7] + unchecked((int)0x7a6d76e9), 5) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F2(ee, aa, bb) + this.X[10] + unchecked((int)0x7a6d76e9), 15) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F2(dd, ee, aa) + this.X[14] + unchecked((int)0x7a6d76e9), 8) + bb; ee = RL(ee, 10);
|
|
|
|
|
|
|
|
//
|
|
//
|
|
|
// Rounds 64-79
|
|
// Rounds 64-79
|
|
|
//
|
|
//
|
|
|
// left
|
|
// left
|
|
|
- b = RL(b + F5(c, d, e) + X[4] + unchecked((int)0xa953fd4e), 9) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F5(b, c, d) + X[0] + unchecked((int)0xa953fd4e), 15) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F5(a, b, c) + X[5] + unchecked((int)0xa953fd4e), 5) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F5(e, a, b) + X[9] + unchecked((int)0xa953fd4e), 11) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F5(d, e, a) + X[7] + unchecked((int)0xa953fd4e), 6) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F5(c, d, e) + X[12] + unchecked((int)0xa953fd4e), 8) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F5(b, c, d) + X[2] + unchecked((int)0xa953fd4e), 13) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F5(a, b, c) + X[10] + unchecked((int)0xa953fd4e), 12) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F5(e, a, b) + X[14] + unchecked((int)0xa953fd4e), 5) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F5(d, e, a) + X[1] + unchecked((int)0xa953fd4e), 12) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F5(c, d, e) + X[3] + unchecked((int)0xa953fd4e), 13) + a; d = RL(d, 10);
|
|
|
|
|
- a = RL(a + F5(b, c, d) + X[8] + unchecked((int)0xa953fd4e), 14) + e; c = RL(c, 10);
|
|
|
|
|
- e = RL(e + F5(a, b, c) + X[11] + unchecked((int)0xa953fd4e), 11) + d; b = RL(b, 10);
|
|
|
|
|
- d = RL(d + F5(e, a, b) + X[6] + unchecked((int)0xa953fd4e), 8) + c; a = RL(a, 10);
|
|
|
|
|
- c = RL(c + F5(d, e, a) + X[15] + unchecked((int)0xa953fd4e), 5) + b; e = RL(e, 10);
|
|
|
|
|
- b = RL(b + F5(c, d, e) + X[13] + unchecked((int)0xa953fd4e), 6) + a; d = RL(d, 10);
|
|
|
|
|
|
|
+ b = RL(b + F5(c, d, e) + this.X[4] + unchecked((int)0xa953fd4e), 9) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F5(b, c, d) + this.X[0] + unchecked((int)0xa953fd4e), 15) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F5(a, b, c) + this.X[5] + unchecked((int)0xa953fd4e), 5) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F5(e, a, b) + this.X[9] + unchecked((int)0xa953fd4e), 11) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F5(d, e, a) + this.X[7] + unchecked((int)0xa953fd4e), 6) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F5(c, d, e) + this.X[12] + unchecked((int)0xa953fd4e), 8) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F5(b, c, d) + this.X[2] + unchecked((int)0xa953fd4e), 13) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F5(a, b, c) + this.X[10] + unchecked((int)0xa953fd4e), 12) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F5(e, a, b) + this.X[14] + unchecked((int)0xa953fd4e), 5) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F5(d, e, a) + this.X[1] + unchecked((int)0xa953fd4e), 12) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F5(c, d, e) + this.X[3] + unchecked((int)0xa953fd4e), 13) + a; d = RL(d, 10);
|
|
|
|
|
+ a = RL(a + F5(b, c, d) + this.X[8] + unchecked((int)0xa953fd4e), 14) + e; c = RL(c, 10);
|
|
|
|
|
+ e = RL(e + F5(a, b, c) + this.X[11] + unchecked((int)0xa953fd4e), 11) + d; b = RL(b, 10);
|
|
|
|
|
+ d = RL(d + F5(e, a, b) + this.X[6] + unchecked((int)0xa953fd4e), 8) + c; a = RL(a, 10);
|
|
|
|
|
+ c = RL(c + F5(d, e, a) + this.X[15] + unchecked((int)0xa953fd4e), 5) + b; e = RL(e, 10);
|
|
|
|
|
+ b = RL(b + F5(c, d, e) + this.X[13] + unchecked((int)0xa953fd4e), 6) + a; d = RL(d, 10);
|
|
|
|
|
|
|
|
// right
|
|
// right
|
|
|
- bb = RL(bb + F1(cc, dd, ee) + X[12], 8) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F1(bb, cc, dd) + X[15], 5) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F1(aa, bb, cc) + X[10], 12) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F1(ee, aa, bb) + X[4], 9) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F1(dd, ee, aa) + X[1], 12) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F1(cc, dd, ee) + X[5], 5) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F1(bb, cc, dd) + X[8], 14) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F1(aa, bb, cc) + X[7], 6) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F1(ee, aa, bb) + X[6], 8) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F1(dd, ee, aa) + X[2], 13) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F1(cc, dd, ee) + X[13], 6) + aa; dd = RL(dd, 10);
|
|
|
|
|
- aa = RL(aa + F1(bb, cc, dd) + X[14], 5) + ee; cc = RL(cc, 10);
|
|
|
|
|
- ee = RL(ee + F1(aa, bb, cc) + X[0], 15) + dd; bb = RL(bb, 10);
|
|
|
|
|
- dd = RL(dd + F1(ee, aa, bb) + X[3], 13) + cc; aa = RL(aa, 10);
|
|
|
|
|
- cc = RL(cc + F1(dd, ee, aa) + X[9], 11) + bb; ee = RL(ee, 10);
|
|
|
|
|
- bb = RL(bb + F1(cc, dd, ee) + X[11], 11) + aa; dd = RL(dd, 10);
|
|
|
|
|
|
|
+ bb = RL(bb + F1(cc, dd, ee) + this.X[12], 8) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F1(bb, cc, dd) + this.X[15], 5) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F1(aa, bb, cc) + this.X[10], 12) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F1(ee, aa, bb) + this.X[4], 9) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F1(dd, ee, aa) + this.X[1], 12) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F1(cc, dd, ee) + this.X[5], 5) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F1(bb, cc, dd) + this.X[8], 14) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F1(aa, bb, cc) + this.X[7], 6) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F1(ee, aa, bb) + this.X[6], 8) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F1(dd, ee, aa) + this.X[2], 13) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F1(cc, dd, ee) + this.X[13], 6) + aa; dd = RL(dd, 10);
|
|
|
|
|
+ aa = RL(aa + F1(bb, cc, dd) + this.X[14], 5) + ee; cc = RL(cc, 10);
|
|
|
|
|
+ ee = RL(ee + F1(aa, bb, cc) + this.X[0], 15) + dd; bb = RL(bb, 10);
|
|
|
|
|
+ dd = RL(dd + F1(ee, aa, bb) + this.X[3], 13) + cc; aa = RL(aa, 10);
|
|
|
|
|
+ cc = RL(cc + F1(dd, ee, aa) + this.X[9], 11) + bb; ee = RL(ee, 10);
|
|
|
|
|
+ bb = RL(bb + F1(cc, dd, ee) + this.X[11], 11) + aa; dd = RL(dd, 10);
|
|
|
|
|
|
|
|
dd += c + H1;
|
|
dd += c + H1;
|
|
|
H1 = H2 + d + ee;
|
|
H1 = H2 + d + ee;
|
|
@@ -503,10 +512,10 @@ namespace Renci.SshNet.Security.Cryptography
|
|
|
//
|
|
//
|
|
|
// reset the offset and clean out the word buffer.
|
|
// reset the offset and clean out the word buffer.
|
|
|
//
|
|
//
|
|
|
- _offset = 0;
|
|
|
|
|
- for (int i = 0; i != X.Length; i++)
|
|
|
|
|
|
|
+ this._offset = 0;
|
|
|
|
|
+ for (int i = 0; i < X.Length; i++)
|
|
|
{
|
|
{
|
|
|
- X[i] = 0;
|
|
|
|
|
|
|
+ this.X[i] = 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|