<PackageReference Include="BouncyCastle.Cryptography" Version="2.3.1" />

IBlockCipherPadding

public interface IBlockCipherPadding
Block cipher padders are expected to conform to this interface.
using Org.BouncyCastle.Security; using System; namespace Org.BouncyCastle.Crypto.Paddings { public interface IBlockCipherPadding { string PaddingName { get; } void Init(SecureRandom random); int AddPadding(byte[] input, int inOff); int AddPadding(Span<byte> block, int position); int PadCount(byte[] input); int PadCount(ReadOnlySpan<byte> block); } }