public void TestUIntEncryptionMin() { uint plain = uint.MinValue + 1; var enc = FPEWrapper.EncryptUInt(key, tweak, plain); var dec = FPEWrapper.DecryptUInt(key, tweak, enc); Assert.AreEqual(plain, dec); }
public void TestUIntEncryptionZero() { uint plain = 0; var enc = FPEWrapper.EncryptUInt(key, tweak, plain); var dec = FPEWrapper.DecryptUInt(key, tweak, enc); Assert.AreEqual(plain, dec); }
public void TestUIntEncryptionRandom() { Random r = new Random(); int times = 1000; for (int i = 0; i < times; i++) { uint plain = (uint)r.Next(0, int.MaxValue); var enc = FPEWrapper.EncryptUInt(key, tweak, plain); var dec = FPEWrapper.DecryptUInt(key, tweak, enc); Assert.AreEqual(plain, dec); } }