Example #1
0
//        [TestCase("ffffffff48c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000001", "fc59093aafa9ab43daae0e914c57635c5402d8e3d2130eb9b3cc181de7f0ecf9b22bf99a7815ce16419e200e01846e6b5df8cc7703041bbceb571de6631d2615")]
        public void compression_function_should_return_valid_output(string input, string output)
        {
            var blake2 = new Blake2();
            var result = blake2.Compress(Bytes.FromHexString(input)).ToHexString();

            result.Should().BeEquivalentTo(output);
        }
        public (byte[], bool) Run(byte[] inputData)
        {
            if (inputData.Length != RequiredInputLength)
            {
                return(Bytes.Empty, false);
            }

            var finalByte = inputData[212];

            if (finalByte != 0 && finalByte != 1)
            {
                return(Bytes.Empty, false);
            }

            var blake  = new Blake2();
            var result = blake.Compress(inputData);

            return(result, true);
        }