Skip to content

Commit 2d7e9c2

Browse files
authored
Cast back long to ulong internally (for arrays too)
Signed-off-by: Xen <lordofxen@deskasoft.com>
1 parent 9f711a1 commit 2d7e9c2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

HashifyNet/Algorithms/BuzHash/BuzHash_Implementation.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public BlockTransformer_8Bit()
118118
public BlockTransformer_8Bit(IBuzHashConfig config)
119119
: this()
120120
{
121-
_rtab = config.Rtab;
121+
_rtab = config.Rtab?.Select(u => unchecked((ulong)u)).ToArray();
122122
_shiftDirection = config.ShiftDirection;
123123

124124
_hashValue = (byte)config.Seed;
@@ -166,7 +166,7 @@ public BlockTransformer_16Bit()
166166
public BlockTransformer_16Bit(IBuzHashConfig config)
167167
: this()
168168
{
169-
_rtab = config.Rtab;
169+
_rtab = config.Rtab?.Select(u => unchecked((ulong)u)).ToArray();
170170
_shiftDirection = config.ShiftDirection;
171171

172172
_hashValue = (ushort)config.Seed;
@@ -214,7 +214,7 @@ public BlockTransformer_32Bit()
214214
public BlockTransformer_32Bit(IBuzHashConfig config)
215215
: this()
216216
{
217-
_rtab = config.Rtab;
217+
_rtab = config.Rtab?.Select(u => unchecked((ulong)u)).ToArray();
218218
_shiftDirection = config.ShiftDirection;
219219

220220
_hashValue = (uint)config.Seed;
@@ -264,10 +264,10 @@ public BlockTransformer_64Bit()
264264
public BlockTransformer_64Bit(IBuzHashConfig config)
265265
: this()
266266
{
267-
_rtab = config.Rtab;
267+
_rtab = config.Rtab?.Select(u => unchecked((ulong)u)).ToArray();
268268
_shiftDirection = config.ShiftDirection;
269269

270-
_hashValue = config.Seed;
270+
_hashValue = (ulong)config.Seed;
271271
}
272272

273273
protected override void CopyStateTo(BlockTransformer_64Bit other)
@@ -423,4 +423,3 @@ private static ulong RotateRight(ulong operand, int shiftCount)
423423
#endregion
424424
}
425425
}
426-

0 commit comments

Comments
 (0)