Ejemplo n.º 1
0
        public void IncrementTwice()
        {
            var cc = new CypherCounter(16);

            cc.Increment();
            cc.Increment();
            Assert.AreEqual("02000000000000000000000000000000", cc.GetCounter().ToHexString());
        }
Ejemplo n.º 2
0
        public void Overflow32ByteChunk2()
        {
            var cc = new CypherCounter(32, "ffffffffffffffffffffffffffffffff00000000000000000000000000000000".ParseFromHexString());

            cc.Increment();
            Assert.AreEqual("0000000000000000000000000000000001000000000000000000000000000000", cc.GetCounter().ToHexString());
        }
Ejemplo n.º 3
0
        public void OverflowSecondInt64()
        {
            var cc = new CypherCounter(16, "ffffffffffffffffffffffffffffffff".ParseFromHexString());

            cc.Increment();
            Assert.AreEqual("00000000000000000000000000000000", cc.GetCounter().ToHexString());
        }
Ejemplo n.º 4
0
        public void OverflowFirstInt32()
        {
            var cc = new CypherCounter(16, "ffffffff000000000000000000000000".ParseFromHexString());

            cc.Increment();
            Assert.AreEqual("00000000010000000000000000000000", cc.GetCounter().ToHexString());
        }
Ejemplo n.º 5
0
 public Task <byte[]> GetEntropyAsync(EntropyPriority priority)
 {
     // Increment the counter and return its value.
     _Counter.Increment();
     return(Task.FromResult(_Counter.GetCounter()));
 }