| | | 1 | | using Renci.SshNet.Abstractions; |
| | | 2 | | |
| | | 3 | | namespace Renci.SshNet.Security |
| | | 4 | | { |
| | | 5 | | /// <summary> |
| | | 6 | | /// Represents "diffie-hellman-group-exchange-sha256" algorithm implementation. |
| | | 7 | | /// </summary> |
| | | 8 | | internal sealed class KeyExchangeDiffieHellmanGroupExchangeSha256 : KeyExchangeDiffieHellmanGroupExchangeShaBase |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Gets algorithm name. |
| | | 12 | | /// </summary> |
| | | 13 | | public override string Name |
| | | 14 | | { |
| | 9 | 15 | | get { return "diffie-hellman-group-exchange-sha256"; } |
| | | 16 | | } |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Gets the size, in bits, of the computed hash code. |
| | | 20 | | /// </summary> |
| | | 21 | | /// <value> |
| | | 22 | | /// The size, in bits, of the computed hash code. |
| | | 23 | | /// </value> |
| | | 24 | | protected override int HashSize |
| | | 25 | | { |
| | 9 | 26 | | get { return 256; } |
| | | 27 | | } |
| | | 28 | | |
| | | 29 | | /// <summary> |
| | | 30 | | /// Hashes the specified data bytes. |
| | | 31 | | /// </summary> |
| | | 32 | | /// <param name="hashData">Data to hash.</param> |
| | | 33 | | /// <returns> |
| | | 34 | | /// The hash of the data. |
| | | 35 | | /// </returns> |
| | | 36 | | protected override byte[] Hash(byte[] hashData) |
| | 24 | 37 | | { |
| | 24 | 38 | | using (var sha256 = CryptoAbstraction.CreateSHA256()) |
| | 24 | 39 | | { |
| | 24 | 40 | | return sha256.ComputeHash(hashData); |
| | | 41 | | } |
| | 24 | 42 | | } |
| | | 43 | | } |
| | | 44 | | } |