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 java.lang.Object implements Mac
Base class forMac
implementations based on the JCE provider.
-
-
Constructor Summary
Constructors Constructor Description BaseMac(java.lang.String algorithm, int bsize, int defbsize, boolean etmMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doFinal(byte[] buf, int offset)
java.lang.String
getAlgorithm()
int
getBlockSize()
int
getDefaultBlockSize()
void
init(byte[] key)
boolean
isEncryptThenMac()
java.lang.String
toString()
void
update(byte[] buf, int offset, int len)
void
updateUInt(long i)
-
-
-
Method Detail
-
getAlgorithm
public java.lang.String getAlgorithm()
- Specified by:
getAlgorithm
in interfaceAlgorithmNameProvider
-
getBlockSize
public int getBlockSize()
- Specified by:
getBlockSize
in interfaceMacInformation
- Returns:
- MAC output block size in bytes - may be less than the default - e.g., MD5-96
-
getDefaultBlockSize
public int getDefaultBlockSize()
- Specified by:
getDefaultBlockSize
in interfaceMacInformation
- Returns:
- The "natural" MAC block size in bytes
-
isEncryptThenMac
public boolean isEncryptThenMac()
- Specified by:
isEncryptThenMac
in interfaceMacInformation
-
init
public void init(byte[] key) throws java.lang.Exception
-
updateUInt
public void updateUInt(long i)
- Specified by:
updateUInt
in interfaceMac
-
doFinal
public void doFinal(byte[] buf, int offset) throws java.lang.Exception
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-