namespace Renci.SshNet.Security.Cryptography.Ciphers { /// /// Base class for cipher padding implementations /// public abstract class CipherPadding { /// /// Pads the specified input to match the block size. /// /// Size of the block. /// The input. /// /// Padded data array. /// public byte[] Pad(int blockSize, byte[] input) { return Pad(blockSize, input, 0, input.Length); } /// /// Pads the specified input to match the block size. /// /// Size of the block. /// The input. /// The zero-based offset in at which the data to pad starts. /// The number of bytes in to take into account. /// /// The padded data array. /// public abstract byte[] Pad(int blockSize, byte[] input, int offset, int length); /// /// Pads the specified input with a given number of bytes. /// /// The input. /// The number of bytes to pad the input with. /// /// The padded data array. /// public byte[] Pad(byte[] input, int paddinglength) { return Pad(input, 0, input.Length, paddinglength); } /// /// Pads the specified input with a given number of bytes. /// /// The input. /// The zero-based offset in at which the data to pad starts. /// The number of bytes in to take into account. /// The number of bytes to pad the input with. /// /// The padded data array. /// public abstract byte[] Pad(byte[] input, int offset, int length, int paddinglength); } }