In .NET Framework if we needed to create our own crypto algorithm we could create our own class like:
public class MyAlgorithm: System.Security.Cryptography.HashAlgorithm
{
}
But in .NET Core it seems very limited because of
public abstract class HashAlgorithm : IDisposable
{
protected HashAlgorithm();
public virtual int HashSize { get; }
public byte[] ComputeHash(byte[] buffer);
public byte[] ComputeHash(byte[] buffer, int offset, int count);
public byte[] ComputeHash(Stream inputStream);
public void Dispose();
public abstract void Initialize();
protected virtual void Dispose(bool disposing);
protected abstract void HashCore(byte[] array, int ibStart, int cbSize);
protected abstract byte[] HashFinal();
}
It doesn't have such things as HashSizeValue
or State
.
Should we still use HashAlgorithm
as base class for own algorithms in .NET Core?