public void ShouldTranslateNameToAsciiEncodedNullTerminatedOID(HashAlgorithmName name, string oid) { Span <byte> expectedBytes = stackalloc byte[oid.Length + 1]; expectedBytes.Fill(0); Encoding.ASCII.GetBytes(oid, expectedBytes); var actualBytes = AlgorithmTranslator.HashAlgorithmToOidAsciiTerminated(name); Assert.True(expectedBytes.SequenceEqual(actualBytes), "ExpectedBytes do not equal actual bytes."); }
public void ShouldTranslateNameToCAPIAlgId(HashAlgorithmName name, uint algId) { Assert.Equal(algId, AlgorithmTranslator.HashAlgorithmToAlgId(name)); }