# < Summary

Information

Class: | Renci.SshNet.Messages.Transport.KeyExchangeDhGroupExchangeGroup
Assembly: | Renci.SshNet
File(s): | \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Transport\KeyExchangeDhGroupExchangeGroup.cs

Line coverage
42%

Covered lines: | 9
Uncovered lines: | 12
Coverable lines: | 21
Total lines: | 81
Line coverage: | 42.8%

Branch coverage
N/A

Covered branches: | 0
Total branches: | 0
Branch coverage: | N/A

Method coverage

Feature is only available for sponsors

Upgrade to PRO version

# Metrics

Method | Branch coverage | Cyclomatic complexity | Line coverage
--- | --- | --- | ---
get_SafePrime() | 100% | 1 | 100%
get_SubGroup() | 100% | 1 | 100%
get_BufferCapacity() | 100% | 1 | 0%
LoadData() | 100% | 1 | 100%
SaveData() | 100% | 1 | 0%
Process(...) | 100% | 1 | 100%

# File(s)

## \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Transport\KeyExchangeDhGroupExchangeGroup.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using Renci.SshNet.Common;`
|  | `2` |  | ``
|  | `3` |  | `namespace Renci.SshNet.Messages.Transport`
|  | `4` |  | `{`
|  | `5` |  | `/// <summary>`
|  | `6` |  | `/// Represents SSH_MSG_KEX_DH_GEX_GROUP message.`
|  | `7` |  | `/// </summary>`
|  | `8` |  | `[Message("SSH_MSG_KEX_DH_GEX_GROUP", MessageNumber)]`
|  | `9` |  | `public class KeyExchangeDhGroupExchangeGroup : Message`
|  | `10` |  | `{`
|  | `11` |  | `internal const byte MessageNumber = 31;`
|  | `12` |  | ``
|  | `13` |  | `private byte[] _safePrime;`
|  | `14` |  | `private byte[] _subGroup;`
|  | `15` |  | ``
|  | `16` |  | `/// <summary>`
|  | `17` |  | `/// Gets the safe prime.`
|  | `18` |  | `/// </summary>`
|  | `19` |  | `/// <value>`
|  | `20` |  | `/// The safe prime.`
|  | `21` |  | `/// </value>`
|  | `22` |  | `public BigInteger SafePrime`
|  | `23` |  | `{`
| 18 | `24` |  | `get { return _safePrime.ToBigInteger(); }`
|  | `25` |  | `}`
|  | `26` |  | ``
|  | `27` |  | `/// <summary>`
|  | `28` |  | `/// Gets the generator for subgroup in GF(p).`
|  | `29` |  | `/// </summary>`
|  | `30` |  | `/// <value>`
|  | `31` |  | `/// The sub group.`
|  | `32` |  | `/// </value>`
|  | `33` |  | `public BigInteger SubGroup`
|  | `34` |  | `{`
| 18 | `35` |  | `get { return _subGroup.ToBigInteger(); }`
|  | `36` |  | `}`
|  | `37` |  | ``
|  | `38` |  | `/// <summary>`
|  | `39` |  | `/// Gets the size of the message in bytes.`
|  | `40` |  | `/// </summary>`
|  | `41` |  | `/// <value>`
|  | `42` |  | `/// The size of the messages in bytes.`
|  | `43` |  | `/// </value>`
|  | `44` |  | `protected override int BufferCapacity`
|  | `45` |  | `{`
|  | `46` |  | `get`
| 0 | `47` |  | `{`
| 0 | `48` |  | `var capacity = base.BufferCapacity;`
| 0 | `49` |  | `capacity += 4; // SafePrime length`
| 0 | `50` |  | `capacity += _safePrime.Length; // SafePrime`
| 0 | `51` |  | `capacity += 4; // SubGroup length`
| 0 | `52` |  | `capacity += _subGroup.Length; // SubGroup`
|  | `53` |  | ``
| 0 | `54` |  | `return capacity;`
| 0 | `55` |  | `}`
|  | `56` |  | `}`
|  | `57` |  | ``
|  | `58` |  | `/// <summary>`
|  | `59` |  | `/// Called when type specific data need to be loaded.`
|  | `60` |  | `/// </summary>`
|  | `61` |  | `protected override void LoadData()`
| 6 | `62` |  | `{`
| 6 | `63` |  | `_safePrime = ReadBinary();`
| 6 | `64` |  | `_subGroup = ReadBinary();`
| 6 | `65` |  | `}`
|  | `66` |  | ``
|  | `67` |  | `/// <summary>`
|  | `68` |  | `/// Called when type specific data need to be saved.`
|  | `69` |  | `/// </summary>`
|  | `70` |  | `protected override void SaveData()`
| 0 | `71` |  | `{`
| 0 | `72` |  | `WriteBinaryString(_safePrime);`
| 0 | `73` |  | `WriteBinaryString(_subGroup);`
| 0 | `74` |  | `}`
|  | `75` |  | ``
|  | `76` |  | `internal override void Process(Session session)`
| 6 | `77` |  | `{`
| 6 | `78` |  | `session.OnKeyExchangeDhGroupExchangeGroupReceived(this);`
| 6 | `79` |  | `}`
|  | `80` |  | `}`
|  | `81` |  | `}`

# Methods/Properties

get_SafePrime()
get_SubGroup()
get_BufferCapacity()
LoadData()
SaveData()
Process(Renci.SshNet.Session)