internal static void AssertHashValueIsEqualsToDotNetImplementation(Core.CryptoSystems.HashAlgorithm algorithmUnderTest, Core.CryptoSystems.HashAlgorithm verificationAlgorithm, string input) { // arrange byte[] inputAsByteArray = Core.Miscellaneous.Utilities.StringToByteArray(input); byte[] expectedResult = verificationAlgorithm.Hash(inputAsByteArray); // act byte[] actualResult = algorithmUnderTest.Hash(inputAsByteArray); // assert Assert.IsTrue(expectedResult.SequenceEqual(actualResult)); }
internal static void AssertSHA256ValueIsEqualsToDotNetImplementation(Core.CryptoSystems.HashAlgorithm algorithmUnderTest, string input) { AssertHashValueIsEqualsToDotNetImplementation(algorithmUnderTest, new Core.CryptoSystems.ConcreteHashAlgorithms.SHA256(), input); }