@Override
    protected synchronized byte[] engineDigest() {
        ensureDigestInitializedInContext();
        final byte[] result = new byte[size];
        NativeCrypto.EVP_DigestFinal_ex(ctx, result, 0);

        // Optimized reset path:
        // 1. No need to wipe EVP_MD_CTX because EVP_DigestFinal_ex has already cleansed any
        //    sensitive state from it.
        // 2. Require EVP_DigestInit_ex to be invoked before this MessageDigestSpi starts computing
        //    a new digest.
        digestInitializedInContext = false;

        return result;
    }
Creates a new OpenSSLMessageDigest instance for the given algorithm name.
common/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java