I compute a hash using init-update-final mechanism i.e. initialize the hash context, followed by hash update with various sizes of input data, and a final digest calculation. This can be done using the EVP_DigestInit, EVP_DigestUpdate and EVP_DigestFinal_Ex functions of OpenSSL or the Update and Final methods of Crypto++.
From what I can dig up from the source code of OpenSSL and Crypto++, it seems like the input data actually get copied and stored. Can anyone confirm this? Is this a limitation of the hashing process or is it a standard procedure? And does this vary with the digest algorithm used?
I was under the impression that the hashing algorithm would compute some internal state based on the chunk of input data, and the final digest will be computed based on the internal states collected over all the various update calls. This does not seem to be the case. Obviously I do not understand the mechanics of hashing algorithms enough.