Class OpenSSLMac.Hmac
java.lang.Object
javax.crypto.MacSpi
org.conscrypt.OpenSSLMac
org.conscrypt.OpenSSLMac.Hmac
- Direct Known Subclasses:
OpenSSLMac.HmacMD5, OpenSSLMac.HmacSHA1, OpenSSLMac.HmacSHA224, OpenSSLMac.HmacSHA256, OpenSSLMac.HmacSHA384, OpenSSLMac.HmacSHA512
- Enclosing class:
OpenSSLMac
-
Nested Class Summary
Nested classes/interfaces inherited from class OpenSSLMac
OpenSSLMac.AesCmac, OpenSSLMac.Hmac, OpenSSLMac.HmacMD5, OpenSSLMac.HmacSHA1, OpenSSLMac.HmacSHA224, OpenSSLMac.HmacSHA256, OpenSSLMac.HmacSHA384, OpenSSLMac.HmacSHA512 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate NativeRef.HMAC_CTXprivate final longHolds the EVP_MD for the hashing algorithm, e.g.Fields inherited from class OpenSSLMac
initialized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]doFinal()protected voidengineUpdate(byte[] input, int offset, int len) protected voidinitContext(byte[] keyBytes) Creates and initializes the relevant BoringSSL *MAC context.protected voidResets the context for a new operation with the same key.protected voidupdateDirect(long ptr, int len) Passes the contents of a direct ByteBuffer to the relevant BoringSSL *MAC function.Methods inherited from class OpenSSLMac
engineDoFinal, engineGetMacLength, engineInit, engineReset, engineUpdate, engineUpdate
-
Field Details
-
ctx
-
evpMd
private final long evpMdHolds the EVP_MD for the hashing algorithm, e.g. EVP_get_digestbyname("sha1");
-
-
Constructor Details
-
Hmac
public Hmac(long evpMd, int size)
-
-
Method Details
-
initContext
protected void initContext(byte[] keyBytes) Description copied from class:OpenSSLMacCreates and initializes the relevant BoringSSL *MAC context.- Specified by:
initContextin classOpenSSLMac
-
resetContext
protected void resetContext()Description copied from class:OpenSSLMacResets the context for a new operation with the same key.- Specified by:
resetContextin classOpenSSLMac
-
engineUpdate
protected void engineUpdate(byte[] input, int offset, int len) - Specified by:
engineUpdatein classMacSpi
-
updateDirect
protected void updateDirect(long ptr, int len) Description copied from class:OpenSSLMacPasses the contents of a direct ByteBuffer to the relevant BoringSSL *MAC function.- Specified by:
updateDirectin classOpenSSLMac
-
doFinal
protected byte[] doFinal()- Specified by:
doFinalin classOpenSSLMac
-