@Override
    protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException,
            InvalidAlgorithmParameterException {
        if (!(key instanceof SecretKey)) {
            throw new InvalidKeyException("key must be a SecretKey");
        }

        if (params != null) {
            throw new InvalidAlgorithmParameterException("unknown parameter type");
        }

        byte[] keyBytes = key.getEncoded();
        if (keyBytes == null) {
            throw new InvalidKeyException("key cannot be encoded");
        }

        try {
            initContext(keyBytes);
        } catch (RuntimeException e) {
            throw new InvalidKeyException("invalid key", e);
        }
        initialized = true;
    }
Passes the contents of a direct ByteBuffer to the relevant BoringSSL *MAC function.
common/src/main/java/org/conscrypt/OpenSSLMac.java