Table of Contents

Class ISO7816d4Padding

Namespace
Org.BouncyCastle.Crypto.Paddings
Assembly
BouncyCastle.Cryptography.dll

A padder that adds the padding according to the scheme referenced in ISO 7814-4 - scheme 2 from ISO 9797-1. The first byte is 0x80, rest is 0x00

public class ISO7816d4Padding : IBlockCipherPadding
Inheritance
ISO7816d4Padding
Implements
Inherited Members

Properties

PaddingName

The name of the algorithm this padder implements.

public string PaddingName { get; }

Property Value

string

Methods

AddPadding(byte[], int)

Add padding to the passed in block.

public int AddPadding(byte[] input, int inOff)

Parameters

input byte[]

the block to add padding to.

inOff int

the 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

block Span<byte>

the block to add padding to.

position int

the 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

random SecureRandom

A 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

input byte[]

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

block ReadOnlySpan<byte>

the block to check padding for.

Returns

int

the number of bytes of padding present.