public void TestULongEncryptionZero() { ulong plain = 0; var enc = FPEWrapper.EncryptULong(key, tweak, plain); var dec = FPEWrapper.DecryptULong(key, tweak, enc); Assert.AreEqual(plain, dec); }
public void TestULongEncryptionMin() { ulong plain = ulong.MinValue + 1; var enc = FPEWrapper.EncryptULong(key, tweak, plain); var dec = FPEWrapper.DecryptULong(key, tweak, enc); Assert.AreEqual(plain, dec); }
public void TestULongEncryptionRandom() { Random r = new Random(); int times = 1000; for (int i = 0; i < times; i++) { ulong plain = (ulong)r.Next(0, int.MaxValue); var enc = FPEWrapper.EncryptULong(key, tweak, plain); var dec = FPEWrapper.DecryptULong(key, tweak, enc); Assert.AreEqual(plain, dec); } }