Class AesUtil
- java.lang.Object
-
- com.google.crypto.tink.mac.internal.AesUtil
-
public final class AesUtil extends java.lang.ObjectA collection of byte-manipulation functions, and some more specific functions for AES-CMAC / AES-SIV.Beware: some of the functions here are specific to the representation used for AES-CMAC and SIV, as described in their RFCs. These might not work if used in other contexts.
-
-
Field Summary
Fields Modifier and Type Field Description static intBLOCK_SIZE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]cmacPad(byte[] x)Pad by adding a 1 bit, then pad with 0 bits to the next block limit.static byte[]dbl(byte[] value)Multiplies value by x in the finite field GF(2^128) represented using the primitive polynomial x^128 + x^7 + x^2 + x + 1.
-
-
-
Field Detail
-
BLOCK_SIZE
public static final int BLOCK_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
dbl
public static byte[] dbl(byte[] value)
Multiplies value by x in the finite field GF(2^128) represented using the primitive polynomial x^128 + x^7 + x^2 + x + 1.- Parameters:
value- an arrays of 16 bytes representing an element of GF(2^128) using bigendian byte order.
-
cmacPad
public static byte[] cmacPad(byte[] x)
Pad by adding a 1 bit, then pad with 0 bits to the next block limit. This is the standard for both CMAC and AES-SIV. - https://tools.ietf.org/html/rfc4493#section-2.4 - https://tools.ietf.org/html/rfc5297#section-2.1- Parameters:
x- The array to pad (will be copied)- Returns:
- The padded array.
-
-