{ *********************************************************************************** } { * CryptoLib Library * } { * Copyright (c) 2018 - 20XX Ugochukwu Mmaduekwe * } { * Github Repository * } { * Distributed under the MIT software license, see the accompanying file LICENSE * } { * or visit http://www.opensource.org/licenses/mit-license.php. * } { * Acknowledgements: * } { * * } { * Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring * } { * development of this library * } { * ******************************************************************************* * } (* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *) unit ClpIBlockCipherPadding; {$I ..\Include\CryptoLib.inc} interface uses ClpISecureRandom, ClpCryptoLibTypes; type /// Block cipher padders are expected to conform to this interface. IBlockCipherPadding = interface(IInterface) ['{BF2886A5-1020-4270-B8E5-3BA9FDB9DA56}'] /// /// Initialise the padder. /// /// /// param parameters, if any required. /// procedure Init(const random: ISecureRandom); /// /// return the name of the algorithm the cipher implements. /// function GetPaddingName: String; /// /// Return the name of the algorithm the cipher implements. /// property PaddingName: String read GetPaddingName; /// /// add the pad bytes to the passed in block, returning the number of /// bytes added. /// /// /// input block to pad /// /// /// offset to start the padding from in the block /// /// /// returns number of bytes added /// function AddPadding(const input: TCryptoLibByteArray; inOff: Int32): Int32; /// /// return the number of pad bytes present in the block. /// /// /// block to count pad bytes in /// /// /// the number of pad bytes present in the block. /// /// /// if the padding is badly formed or invalid. /// function PadCount(const input: TCryptoLibByteArray): Int32; end; implementation end.