Package org.apache.sshd.common.mac
Class BaseMac
- java.lang.Object
-
- org.apache.sshd.common.mac.BaseMac
-
- All Implemented Interfaces:
AlgorithmNameProvider,Mac,MacInformation
public class BaseMac extends Object implements Mac
Base class forMacimplementations based on the JCE provider.- Author:
- Apache MINA SSHD Project
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoFinal(byte[] buf, int offset)StringgetAlgorithm()intgetBlockSize()intgetDefaultBlockSize()voidinit(byte[] key)booleanisEncryptThenMac()StringtoString()voidupdate(byte[] buf, int offset, int len)voidupdateUInt(long i)
-
-
-
Constructor Detail
-
BaseMac
public BaseMac(String algorithm, int bsize, int defbsize, boolean etmMode)
-
-
Method Detail
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithmin interfaceAlgorithmNameProvider
-
getBlockSize
public int getBlockSize()
- Specified by:
getBlockSizein interfaceMacInformation- Returns:
- MAC output block size in bytes - may be less than the default - e.g., MD5-96
-
getDefaultBlockSize
public int getDefaultBlockSize()
- Specified by:
getDefaultBlockSizein interfaceMacInformation- Returns:
- The "natural" MAC block size in bytes
-
isEncryptThenMac
public boolean isEncryptThenMac()
- Specified by:
isEncryptThenMacin interfaceMacInformation
-
init
public void init(byte[] key) throws Exception
-
updateUInt
public void updateUInt(long i)
- Specified by:
updateUIntin interfaceMac
-
doFinal
public void doFinal(byte[] buf, int offset) throws Exception
-
-