Duplicate the state when making copy
MODIFY
WalletWasabi.Tests/UnitTests/Crypto/StrobeTests.cs
WalletWasabi.Tests/UnitTests/Crypto/StrobeTests.cs
@@ -55,6 +55,10 @@ namespace WalletWasabi.Tests.UnitTests.Crypto
var strobe3 = strobe1.MakeCopy();
Assert.Equal(strobe1.ToString(), strobe3.ToString());
+
+ strobe1.AddData(ToBytes("Something"), false);
+
+ Assert.NotEqual(strobe1.ToString(), strobe3.ToString());
}
[Theory]

MODIFY
WalletWasabi/Crypto/Strobe.cs
WalletWasabi/Crypto/Strobe.cs
@@ -86,7 +86,7 @@ namespace WalletWasabi.Crypto
private Strobe128(byte[] state, StrobeFlags flags, byte beginPosition, byte position)
{
- _state = state;
+ Buffer.BlockCopy(state, 0, _state, 0, _state.Length);
_currentFlags = flags;
_beginPosition = beginPosition;
_position = position;

Duplicate the state when making copy