Class Poly1305
- java.lang.Object
-
- com.google.crypto.tink.aead.internal.Poly1305
-
public class Poly1305 extends java.lang.ObjectPoly1305 one-time MAC based on RFC 7539.This is not an implementation of the MAC interface on purpose and it is not equivalent to HMAC.
The implementation is based on poly1305 implementation by Andrew Moon (https://github.com/floodyberry/poly1305-donna) and released as public domain.
-
-
Field Summary
Fields Modifier and Type Field Description static intMAC_KEY_SIZE_IN_BYTESstatic intMAC_TAG_SIZE_IN_BYTES
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]computeMac(byte[] key, byte[] data)Computes Poly1305 MAC overdatausingkey.static voidverifyMac(byte[] key, byte[] data, byte[] mac)Verifies Poly1305 {@ mac} overdatausingkey.
-
-
-
Field Detail
-
MAC_TAG_SIZE_IN_BYTES
public static final int MAC_TAG_SIZE_IN_BYTES
- See Also:
- Constant Field Values
-
MAC_KEY_SIZE_IN_BYTES
public static final int MAC_KEY_SIZE_IN_BYTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
computeMac
public static byte[] computeMac(byte[] key, byte[] data)Computes Poly1305 MAC overdatausingkey.
-
verifyMac
public static void verifyMac(byte[] key, byte[] data, byte[] mac) throws java.security.GeneralSecurityExceptionVerifies Poly1305 {@ mac} overdatausingkey.- Throws:
java.security.GeneralSecurityException
-
-