Class HMac
java.lang.Object
org.gudy.bouncycastle.crypto.macs.HMac
- All Implemented Interfaces:
Mac
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate Digestprivate intprivate byte[]private static final byteprivate static final byteprivate byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdoFinal(byte[] out, int outOff) Compute the final statge of the MAC writing the output to the out parameter.Return the name of the algorithm the MAC implements.intReturn the block size for this cipher (in bytes).voidinit(CipherParameters params) Initialise the MAC.voidreset()Reset the mac generator.voidupdate(byte in) add a single byte to the mac for processing.voidupdate(byte[] in, int inOff, int len)
-
Field Details
-
BLOCK_LENGTH
private static final int BLOCK_LENGTH- See Also:
-
IPAD
private static final byte IPAD- See Also:
-
OPAD
private static final byte OPAD- See Also:
-
digest
-
digestSize
private int digestSize -
inputPad
private byte[] inputPad -
outputPad
private byte[] outputPad
-
-
Constructor Details
-
HMac
-
-
Method Details
-
getAlgorithmName
Description copied from interface:MacReturn the name of the algorithm the MAC implements.- Specified by:
getAlgorithmNamein interfaceMac- Returns:
- the name of the algorithm the MAC implements.
-
getUnderlyingDigest
-
init
Description copied from interface:MacInitialise the MAC. -
getMacSize
public int getMacSize()Description copied from interface:MacReturn the block size for this cipher (in bytes).- Specified by:
getMacSizein interfaceMac- Returns:
- the block size for this cipher in bytes.
-
update
-
update
-
doFinal
public int doFinal(byte[] out, int outOff) Description copied from interface:MacCompute the final statge of the MAC writing the output to the out parameter.doFinal leaves the MAC in the same state it was after the last init.
-
reset
-