public override void Initialize(RandomGenerator random) { Operation = (CryptoNumOps)(random.NextInt32(4)); switch (Operation) { case CryptoNumOps.Add: case CryptoNumOps.Xor: Key = InverseKey = random.NextUInt32(); break; case CryptoNumOps.Mul: Key = random.NextUInt32() | 1; InverseKey = MathsUtils.modInv(Key); break; case CryptoNumOps.Xnor: Key = random.NextUInt32(); InverseKey = ~Key; break; } }
public override void Initialize(RandomGenerator random) { Operation = (CryptoNumOps)random.NextInt32(4); switch (Operation) { case CryptoNumOps.Add: case CryptoNumOps.Xor: Key = InverseKey = random.NextUInt32(); break; case CryptoNumOps.Mul: Key = random.NextUInt32() | 1; InverseKey = MathsUtils.modInv(Key); break; case CryptoNumOps.Xnor: Key = random.NextUInt32(); InverseKey = ~Key; break; } }