The IPad
interface is used seperately from ciphers and modes. The
methods defined by padding schemes are:
Initializes this padding scheme for the specified block size. This method throws a
java.lang.IllegalStateException
if this instance has already been initialized but not reset, and will throw ajava.lang.IllegalArgumentException
if bs is not a supported block size.
Examines the bytes in input as the plaintext, starting at offset and considering length bytes, and returns the appropriate, possibly empty, byte array containing the padding.
Examines the bytes in input as the plaintext, starting at offset and considering length bytes, and returns the number of bytes that should be trimmed off the end of input to unpad the plaintext. Throws a
WrongPaddingException
if the padding bytes to not correspond to the bytes expected by this padding scheme.