Skip to content

Commit 116b05f

Browse files
authored
Use Endianness utility over BitConverter
Signed-off-by: Xen <lordofxen@deskasoft.com>
1 parent d5844f0 commit 116b05f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

HashifyNet/Algorithms/Keccak/Keccak_Implementation.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private void Absorb(byte[] data, int offset)
136136
{
137137
if (byteIndex < _rateInBytes)
138138
{
139-
_state[x, y] ^= BitConverter.ToUInt64(data, offset + byteIndex);
139+
_state[x, y] ^= Endianness.ToUInt64LittleEndian(data, offset + byteIndex);
140140
byteIndex += 8;
141141
}
142142
else
@@ -168,7 +168,7 @@ private byte[] Squeeze(int lengthInBytes)
168168
{
169169
if (stateByteIndex < _rateInBytes)
170170
{
171-
byte[] laneBytes = BitConverter.GetBytes(_state[x, y]);
171+
byte[] laneBytes = Endianness.GetBytesLittleEndian(_state[x, y]);
172172
Buffer.BlockCopy(laneBytes, 0, stateBytes, stateByteIndex, 8);
173173
stateByteIndex += 8;
174174
}
@@ -261,5 +261,4 @@ private void KeccakF1600_Permute()
261261
#endregion
262262
}
263263
}
264-
265264
}

0 commit comments

Comments
 (0)