public void SetLane_ShouldSetLaneBits() { var state = new SpongeState(new BitString("10101010101010101010101010101010101010101010101010"), 25); var lane = state.GetLane(0, 0); state.SetLane(lane, new[] { false, true }); Assert.AreEqual("01101010101010101010101010101010101010101010101010", state.ToBinString()); }
public void XorLane_ShouldPerformBitwiseXorWithBits() { var state = new SpongeState(new BitString("10101010101010101010101010101010101010101010101010"), 25); var lane = state.GetLane(0, 0); var bits = new[] { true, true }; state.XorLane(lane, bits); Assert.AreEqual("01101010101010101010101010101010101010101010101010", state.ToBinString()); }
public void GetLane_ShouldReturnExpectedLane() { var state = new SpongeState(new BitString("10101010101010101010101010101010101010101010101010"), 25); for (var y = 0; y < 5; y++) { for (var x = 0; x < 5; x++) { var lane = state.GetLane(x, y); var bits = lane.GetBits().ToArray(); Assert.AreEqual(2, bits.Length); Assert.IsTrue(bits[0]); Assert.IsFalse(bits[1]); } } }