public void describe_AsAction() { it["Func<TR>"] = () => ((Action)(() => FE0.AsAction()())).ShouldThrow(); it["Func<T1, TR>"] = () => ((Action)(() => FE1.AsAction()(T1))).ShouldThrow(); it["Func<T1, T2, TR>"] = () => ((Action)(() => FE2.AsAction()(T1, T2))).ShouldThrow(); it["Func<T1, T2, T3, TR>"] = () => ((Action)(() => FE3.AsAction()(T1, T2, T3))).ShouldThrow(); it["Func<T1, T2, T3, T4, TR>"] = () => ((Action)(() => FE4.AsAction()(T1, T2, T3, T4))).ShouldThrow(); }
public void TestNumericEncryption() { int range = 1000; BigInteger modulus = new BigInteger(range); BigInteger plain = new BigInteger(0); BigInteger enc = FE1.Encrypt(modulus, plain, key, tweak); BigInteger dec = FE1.Decrypt(modulus, enc, key, tweak); Assert.AreEqual(plain, dec); }
public void StressTestNumericEncryption() { int range = 10000; BigInteger modulus = new BigInteger(range); Random r = new Random(); int times = 10000; for (int i = 0; i < times; i++) { BigInteger plain = new BigInteger(r.Next(0, range)); BigInteger enc = FE1.Encrypt(modulus, plain, key, tweak); BigInteger dec = FE1.Decrypt(modulus, enc, key, tweak); Assert.AreEqual(plain, dec); } }