public void IncrementTwice() { var cc = new CypherCounter(16); cc.Increment(); cc.Increment(); Assert.AreEqual("02000000000000000000000000000000", cc.GetCounter().ToHexString()); }
public void Overflow32ByteChunk2() { var cc = new CypherCounter(32, "ffffffffffffffffffffffffffffffff00000000000000000000000000000000".ParseFromHexString()); cc.Increment(); Assert.AreEqual("0000000000000000000000000000000001000000000000000000000000000000", cc.GetCounter().ToHexString()); }
public void OverflowSecondInt64() { var cc = new CypherCounter(16, "ffffffffffffffffffffffffffffffff".ParseFromHexString()); cc.Increment(); Assert.AreEqual("00000000000000000000000000000000", cc.GetCounter().ToHexString()); }
public void OverflowFirstInt32() { var cc = new CypherCounter(16, "ffffffff000000000000000000000000".ParseFromHexString()); cc.Increment(); Assert.AreEqual("00000000010000000000000000000000", cc.GetCounter().ToHexString()); }
public Task <byte[]> GetEntropyAsync(EntropyPriority priority) { // Increment the counter and return its value. _Counter.Increment(); return(Task.FromResult(_Counter.GetCounter())); }