Пример #1
0
        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();
            }
        }
Пример #2
0
        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();
            }
        }