Package org.apache.sshd.common.mac
Class Poly1305Mac
- java.lang.Object
-
- org.apache.sshd.common.mac.Poly1305Mac
-
- All Implemented Interfaces:
AlgorithmNameProvider,Mac,MacInformation
public class Poly1305Mac extends Object implements Mac
Poly1305 one-time message authentication code. This implementation is derived from the public domain C library poly1305-donna.
-
-
Field Summary
Fields Modifier and Type Field Description static intKEY_BYTES
-
Constructor Summary
Constructors Constructor Description Poly1305Mac()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoFinal(byte[] out, int offset)StringgetAlgorithm()intgetBlockSize()intgetDefaultBlockSize()voidinit(byte[] key)voidupdate(byte[] in, int offset, int length)voidupdateUInt(long value)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.mac.MacInformation
isEncryptThenMac
-
-
-
-
Field Detail
-
KEY_BYTES
public static final int KEY_BYTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithmin interfaceAlgorithmNameProvider
-
init
public void init(byte[] key) throws Exception
-
updateUInt
public void updateUInt(long value)
- Specified by:
updateUIntin interfaceMac
-
doFinal
public void doFinal(byte[] out, int offset) throws Exception
-
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
-
-