diff --git a/src/Registry/HashingAlgorithm.cs b/src/Registry/HashingAlgorithm.cs index 3e3be63..efb5d45 100644 --- a/src/Registry/HashingAlgorithm.cs +++ b/src/Registry/HashingAlgorithm.cs @@ -56,6 +56,8 @@ static HashingAlgorithm() Register("blake2s-256", 0xb260, 256 / 8, () => new BouncyDigest(new BC.Blake2sDigest(256))); Register("murmur3-32", 0x23, 32 / 8); Register("murmur3-128", 0x22, 128 / 8); + Register("md4", 0xd4, 128 / 8, () => new BouncyDigest(new BC.MD4Digest())); + Register("md5", 0xd5, 128 / 8, () => MD5.Create()); } /// diff --git a/test/Cryptography/HashingTest.cs b/test/Cryptography/HashingTest.cs index 2aedb06..5c08af4 100644 --- a/test/Cryptography/HashingTest.cs +++ b/test/Cryptography/HashingTest.cs @@ -75,6 +75,22 @@ class TestVector Input = "fd6dd3b63dc7b9664895c51fc17c57d59c349621dd3c5694a3cc404c660c2cc47d83d2f0e3d2a28a3aa2f0a710db54", Digest = "c8db32bf81bf75621db30264750954f8" }, + + // From https://en.wikipedia.org/wiki/MD4 + new TestVector + { + Algorithm = "md4", + Input = Encoding.UTF8.GetBytes("The quick brown fox jumps over the lazy dog").ToHexString(), + Digest = "1bee69a46ba811185c194762abaeae90", + }, + + // From https://en.wikipedia.org/wiki/MD5 + new TestVector + { + Algorithm = "md5", + Input = Encoding.UTF8.GetBytes("The quick brown fox jumps over the lazy dog").ToHexString(), + Digest = "9e107d9d372bb6826bd81d3542a419d6", + }, }; ///