Methods Summary |
---|
public java.lang.Object | clone()Clones this {@code MacSpi} instance.
return super.clone();
|
protected abstract byte[] | engineDoFinal()Computes the digest of this MAC based on the data previously specified in
{@link #engineUpdate} calls.
This {@code MacSpi} instance is reverted to its initial state and
can be used to start the next MAC computation with the same parameters or
initialized with different parameters.
|
protected abstract int | engineGetMacLength()Returns the length of this MAC (in bytes).
|
protected abstract void | engineInit(java.security.Key key, java.security.spec.AlgorithmParameterSpec params)Initializes this {@code MacSpi} instance with the specified key and
algorithm parameters.
|
protected abstract void | engineReset()Resets this {@code MacSpi} instance to its initial state.
This {@code MacSpi} instance is reverted to its initial state and can be
used to start the next MAC computation with the same parameters or
initialized with different parameters.
|
protected abstract void | engineUpdate(byte input)Updates this {@code MacSpi} instance with the specified byte.
|
protected abstract void | engineUpdate(byte[] input, int offset, int len)Updates this {@code MacSpi} instance with the data from the specified
buffer {@code input} from the specified {@code offset} and length {@code
len}.
|
protected void | engineUpdate(java.nio.ByteBuffer input)Updates this {@code MacSpi} instance with the data from the specified
buffer, starting at {@link ByteBuffer#position()}, including the next
{@link ByteBuffer#remaining()} bytes.
if (!input.hasRemaining()) {
return;
}
byte[] bInput;
if (input.hasArray()) {
bInput = input.array();
int offset = input.arrayOffset();
int position = input.position();
int limit = input.limit();
engineUpdate(bInput, offset + position, limit - position);
input.position(limit);
} else {
bInput = new byte[input.limit() - input.position()];
input.get(bInput);
engineUpdate(bInput, 0, bInput.length);
}
|