Class OpenSSLMac
java.lang.Object
javax.crypto.MacSpi
org.conscrypt.OpenSSLMac
- Direct Known Subclasses:
OpenSSLMac.AesCmac, OpenSSLMac.Hmac
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprivate final byte[]Holds a dummy buffer for writing single bytes to the digest.private final intHolds the output size of the message digest. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract byte[]doFinal()protected byte[]protected intprotected voidengineInit(Key key, AlgorithmParameterSpec params) protected voidprotected voidengineUpdate(byte input) protected voidengineUpdate(ByteBuffer input) protected abstract voidinitContext(byte[] keyBytes) Creates and initializes the relevant BoringSSL *MAC context.protected abstract voidResets the context for a new operation with the same key.protected abstract voidupdateDirect(long ptr, int len) Passes the contents of a direct ByteBuffer to the relevant BoringSSL *MAC function.Methods inherited from class MacSpi
clone, engineUpdate
-
Field Details
-
size
private final int sizeHolds the output size of the message digest. -
singleByte
private final byte[] singleByteHolds a dummy buffer for writing single bytes to the digest. -
initialized
protected boolean initialized
-
-
Constructor Details
-
OpenSSLMac
private OpenSSLMac(int size)
-
-
Method Details
-
initContext
protected abstract void initContext(byte[] keyBytes) Creates and initializes the relevant BoringSSL *MAC context. -
resetContext
protected abstract void resetContext()Resets the context for a new operation with the same key. -
updateDirect
protected abstract void updateDirect(long ptr, int len) Passes the contents of a direct ByteBuffer to the relevant BoringSSL *MAC function. -
engineGetMacLength
protected int engineGetMacLength()- Specified by:
engineGetMacLengthin classMacSpi
-
engineInit
protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException - Specified by:
engineInitin classMacSpi- Throws:
InvalidKeyExceptionInvalidAlgorithmParameterException
-
engineUpdate
protected void engineUpdate(byte input) - Specified by:
engineUpdatein classMacSpi
-
engineUpdate
- Overrides:
engineUpdatein classMacSpi
-
engineDoFinal
protected byte[] engineDoFinal()- Specified by:
engineDoFinalin classMacSpi
-
doFinal
protected abstract byte[] doFinal() -
engineReset
protected void engineReset()- Specified by:
engineResetin classMacSpi
-