< Summary

Information
Class: Renci.SshNet.Security.Cryptography.Ciphers.CipherPadding
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\Cryptography\Ciphers\CipherPadding.cs
Line coverage
50%
Covered lines: 3
Uncovered lines: 3
Coverable lines: 6
Total lines: 58
Line coverage: 50%
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

MethodBranch coverage Cyclomatic complexity Line coverage
Pad(...)100%1100%
Pad(...)100%10%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\Cryptography\Ciphers\CipherPadding.cs

#LineLine coverage
 1namespace Renci.SshNet.Security.Cryptography.Ciphers
 2{
 3    /// <summary>
 4    /// Base class for cipher padding implementations.
 5    /// </summary>
 6    public abstract class CipherPadding
 7    {
 8        /// <summary>
 9        /// Pads the specified input to match the block size.
 10        /// </summary>
 11        /// <param name="blockSize">Size of the block.</param>
 12        /// <param name="input">The input.</param>
 13        /// <returns>
 14        /// Padded data array.
 15        /// </returns>
 16        public byte[] Pad(int blockSize, byte[] input)
 1217        {
 1218            return Pad(blockSize, input, 0, input.Length);
 1219        }
 20
 21        /// <summary>
 22        /// Pads the specified input to match the block size.
 23        /// </summary>
 24        /// <param name="blockSize">Size of the block.</param>
 25        /// <param name="input">The input.</param>
 26        /// <param name="offset">The zero-based offset in <paramref name="input"/> at which the data to pad starts.</par
 27        /// <param name="length">The number of bytes in <paramref name="input"/> to take into account.</param>
 28        /// <returns>
 29        /// The padded data array.
 30        /// </returns>
 31        public abstract byte[] Pad(int blockSize, byte[] input, int offset, int length);
 32
 33        /// <summary>
 34        /// Pads the specified input with a given number of bytes.
 35        /// </summary>
 36        /// <param name="input">The input.</param>
 37        /// <param name="paddinglength">The number of bytes to pad the input with.</param>
 38        /// <returns>
 39        /// The padded data array.
 40        /// </returns>
 41        public byte[] Pad(byte[] input, int paddinglength)
 042        {
 043            return Pad(input, 0, input.Length, paddinglength);
 044        }
 45
 46        /// <summary>
 47        /// Pads the specified input with a given number of bytes.
 48        /// </summary>
 49        /// <param name="input">The input.</param>
 50        /// <param name="offset">The zero-based offset in <paramref name="input"/> at which the data to pad starts.</par
 51        /// <param name="length">The number of bytes in <paramref name="input"/> to take into account.</param>
 52        /// <param name="paddinglength">The number of bytes to pad the input with.</param>
 53        /// <returns>
 54        /// The padded data array.
 55        /// </returns>
 56        public abstract byte[] Pad(byte[] input, int offset, int length, int paddinglength);
 57    }
 58}