Package org.apache.sshd.common.mac
Class Poly1305Mac
java.lang.Object
org.apache.sshd.common.mac.Poly1305Mac
- All Implemented Interfaces:
AlgorithmNameProvider,Mac,MacInformation
Poly1305 one-time message authentication code. This implementation is derived from the public domain C library
poly1305-donna.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoFinal(byte[] out, int offset) intintvoidinit(byte[] key) static voidpackIntLE(int value, byte[] dst, int off) static intunpackIntLE(byte[] buf, int off) 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, waitMethods inherited from interface org.apache.sshd.common.mac.MacInformation
isEncryptThenMac
-
Field Details
-
KEY_BYTES
public static final int KEY_BYTES- See Also:
-
-
Constructor Details
-
Poly1305Mac
public Poly1305Mac()
-
-
Method Details
-
getAlgorithm
- Specified by:
getAlgorithmin interfaceAlgorithmNameProvider
-
init
-
update
public void update(byte[] in, int offset, int length) -
updateUInt
public void updateUInt(long value) - 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
-
unpackIntLE
public static int unpackIntLE(byte[] buf, int off) -
packIntLE
public static void packIntLE(int value, byte[] dst, int off)
-