Class type Padding.scheme
Generic interface of a padding scheme.
method pad : bytes -> int -> unitpad buf usedis called with a byte arraybufcontaining valid input data at positions0, ..., used-1. Thepadmethod must write padding characters in positionsusedtoBytes.length str - 1. It is guaranteed thatused < Bytes.length str, so that at least one character of padding must be added. The padding scheme must be unambiguous in the following sense: frombufafter padding, it must be possible to determineusedunambiguously. (This is what methodCryptokit.Padding.scheme.stripdoes.)
method strip : bytes -> intThis is the converse of the
padoperation: from a padded byte arraybufas built by methodpad,strip bufdetermines and returns the starting position of the padding data, or equivalently the length of valid, non-padded input data inbuf. This method must raiseError Bad_paddingifbufdoes not have the format of a padded block as produced bypad.