Class TbcPadding
- Namespace
- Org.BouncyCastle.Crypto.Paddings
- Assembly
- BouncyCastle.Cryptography.dll
A padder that adds Trailing-Bit-Compliment padding to a block.
public class TbcPadding : IBlockCipherPadding
- Inheritance
-
TbcPadding
- Implements
- Inherited Members
Remarks
This padding pads the block out compliment of the last bit of the plain text.
Properties
PaddingName
The name of the algorithm this padder implements.
public string PaddingName { get; }
Property Value
Methods
AddPadding(byte[], int)
Add padding to the passed in block.
public virtual int AddPadding(byte[] input, int inOff)
Parameters
inputbyte[]the block to add padding to.
inOffintthe offset into the block the padding is to start at.
Returns
- int
the number of bytes of padding added.
AddPadding(Span<byte>, int)
Add padding to the passed in block.
public virtual int AddPadding(Span<byte> block, int position)
Parameters
blockSpan<byte>the block to add padding to.
positionintthe offset into the block the padding is to start at.
Returns
- int
the number of bytes of padding added.
Init(SecureRandom)
Initialise the padder.
public virtual void Init(SecureRandom random)
Parameters
randomSecureRandomA source of randomness, if any required.
PadCount(byte[])
Determine the length of padding present in the passed in block.
public virtual int PadCount(byte[] input)
Parameters
inputbyte[]the block to check padding for.
Returns
- int
the number of bytes of padding present.
PadCount(ReadOnlySpan<byte>)
Determine the length of padding present in the passed in block.
public virtual int PadCount(ReadOnlySpan<byte> block)
Parameters
blockReadOnlySpan<byte>the block to check padding for.
Returns
- int
the number of bytes of padding present.