private byte[] AdjustHashSizeIfNecessary(byte[] hash)
{
Debug.Assert(hash != null);
int qLength = ComputeQLength();
// Note to review (from steve harter) -- code commented out because SHA1 encodes in 20 bytes
// but default for v2 struct is 32 (SHA256) bytes so qLength (32) can be > hash.Length (20)
// so v2 would not support SHA1. Also remove this code in .net desktop?
// Sample code that will fail in .net desktop:
// new DSACng(2048).SignData(new ASCIIEncoding().GetBytes("Hello"), new HashAlgorithmName("SHA1"));
//if (qLength > hash.Length)
// throw new PlatformNotSupportedException("todo:SR.Cryptography_DSA_HashTooShort");
Array.Resize(ref hash, qLength);
return hash;
}