hash - Does Digest Init-Update-Final mechanism make a copy of input data? -


i compute hash using init-update-final mechanism i.e. initialize hash context, followed hash update various sizes of input data, , final digest calculation. can done using the evp_digestinit, evp_digestupdate , evp_digestfinal_ex functions of openssl or update , final methods of crypto++.

from can dig source code of openssl , crypto++, seems input data copied , stored. can confirm this? limitation of hashing process or standard procedure? , vary digest algorithm used?

i under impression hashing algorithm compute internal state based on chunk of input data, , final digest computed based on internal states collected on various update calls. not seem case. not understand mechanics of hashing algorithms enough.

from can dig source code of openssl , crypto++, seems input data copied , stored. can confirm this?

yes , no. input not stored. partial inputs buffered until full block available process.

the buffering part of state of hash. once consumed, storage partial block may used if additional partial blocks encountered. when hash object destroyed, data in partial blocks wiped or zeroized.

how data can potentially stored depends on hash's internals , block size. statement true iterative hashes md5, sha1 , sha512. don't know recursive hash functions sha3.

the strategy applies both openssl , crypto++.

in case of crypto++, hash's output buffered internally if no attachedtransformation present.


also see init-update-final on crypto++ wiki. recent addition, being added in january 2016.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -