gnu.crypto.pad

Class BasePad

public abstract class BasePad extends Object implements IPad

An abstract class to facilitate implementing padding algorithms.

Version: $Revision: 1.6 $

Field Summary
protected intblockSize
The block size, in bytes, for this instance.
protected Stringname
The canonical name prefix of the padding algorithm.
Constructor Summary
protected BasePad(String name)
Trivial constructor for use by concrete subclasses.
Method Summary
voidinit(int bs)
Stringname()
abstract byte[]pad(byte[] in, int off, int len)
voidreset()
booleanselfTest()
abstract voidsetup()

If any additional checks or resource setup must be done by the subclass, then this is the hook for it.

abstract intunpad(byte[] in, int off, int len)

Field Detail

blockSize

protected int blockSize
The block size, in bytes, for this instance.

name

protected String name
The canonical name prefix of the padding algorithm.

Constructor Detail

BasePad

protected BasePad(String name)
Trivial constructor for use by concrete subclasses.

Method Detail

init

public void init(int bs)

name

public String name()

pad

public abstract byte[] pad(byte[] in, int off, int len)

reset

public void reset()

selfTest

public boolean selfTest()

setup

public abstract void setup()

If any additional checks or resource setup must be done by the subclass, then this is the hook for it. This method will be called before the BasePad method returns.

unpad

public abstract int unpad(byte[] in, int off, int len)
Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.