Class X923Padding
- Namespace
- Org.BouncyCastle.Crypto.Paddings
- Assembly
- BouncyCastle.Cryptography.dll
A padder that adds X9.23 padding to a block - if a SecureRandom is passed in random padding is assumed, otherwise padding with zeros is used.
public class X923Padding : IBlockCipherPadding
- Inheritance
-
X923Padding
- Implements
- Inherited Members
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 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 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 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 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 int PadCount(ReadOnlySpan<byte> block)
Parameters
blockReadOnlySpan<byte>the block to check padding for.
Returns
- int
the number of bytes of padding present.