Package org.apache.sshd.common.mac
Class CMAC
java.lang.Object
org.apache.sshd.common.mac.CMAC
- All Implemented Interfaces:
AlgorithmNameProvider,Mac,MacInformation
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoFinal(byte[] buf, int offset) intintvoidinit(byte[] key) voidupdate(byte[] buf, int start, int len) voidupdateUInt(long foo) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.common.mac.MacInformation
isEncryptThenMac
-
Field Details
-
engine
private org.bouncycastle.crypto.engines.SM4Engine engine -
mac
private org.bouncycastle.crypto.macs.CBCBlockCipherMac mac -
params
private org.bouncycastle.crypto.CipherParameters params -
KEY_LENGTH
private static final int KEY_LENGTH- See Also:
-
initkey
private byte[] initkey -
iv
private byte[] iv
-
-
Constructor Details
-
CMAC
public CMAC()
-
-
Method Details
-
init
-
update
public void update(byte[] buf, int start, int len) -
updateUInt
public void updateUInt(long foo) - Specified by:
updateUIntin interfaceMac
-
doFinal
-
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
-
getAlgorithm
- Specified by:
getAlgorithmin interfaceAlgorithmNameProvider
-