void CreateBlake3KeyedUsingUints(int size, bool succeeds) { var uints = new uint[size]; var bytes = MemoryMarshal.Cast <uint, byte>(uints); var random = new Random(); random.NextBytes(bytes); Action action = delegate { var hash = new Blake3Keyed(uints); }; if (!succeeds) { Assert.Throws <ArgumentException>(action); } else { action(); } }
void CreateBlake3KeyedUsingBytes(int size, bool succeeds) { var bytes = new byte[size]; var random = new Random(); random.NextBytes(bytes); Action action = delegate { var hash = new Blake3Keyed(bytes); }; if (!succeeds) { Assert.Throws <ArgumentException>(action); } else { action(); } }