KeyExchangeDiffieHellmanGroupSha512.cs 968 B

123456789101112131415161718192021222324252627282930313233
  1. using Renci.SshNet.Abstractions;
  2. namespace Renci.SshNet.Security
  3. {
  4. /// <summary>
  5. /// Base class for "diffie-hellman" SHA-512 group algorithm implementations.
  6. /// </summary>
  7. internal abstract class KeyExchangeDiffieHellmanGroupSha512 : KeyExchangeDiffieHellmanGroupShaBase
  8. {
  9. /// <summary>
  10. /// Gets the size, in bits, of the computed hash code.
  11. /// </summary>
  12. /// <value>
  13. /// The size, in bits, of the computed hash code.
  14. /// </value>
  15. protected override int HashSize
  16. {
  17. get { return 512; }
  18. }
  19. /// <summary>
  20. /// Hashes the specified data bytes.
  21. /// </summary>
  22. /// <param name="hashData">The hash data.</param>
  23. /// <returns>
  24. /// The hash of the data.
  25. /// </returns>
  26. protected override byte[] Hash(byte[] hashData)
  27. {
  28. return CryptoAbstraction.HashSHA512(hashData);
  29. }
  30. }
  31. }