c - Call EVP_Digest() or directly call MD4? Openssl - different timing -


i measured how many times can call md4 in 3 seconds. used md4 openssl. noticed interesting issue. when called md4(array, size, digest); directly, app said 5438501 md4's within 3 seconds. when used evp_digest(array, size, digest, null, evp_md4(), null); said did 4787370 md4's in 3 seconds.

so direct call faster using evp api? why that?

i don't see why evp_digest should faster method uses :-)

using evp_digest delegating "him" (it) use hash algorithm. there overhead in this. or perhaps think evp_digest use "magically faster" md4 algorithm "default" md4 algorithm?

from md4/md5 (emphasis added)

applications should use higher level functions evp_digestinit(3) etc. instead of calling hash functions directly.

and evp_digestinit

the evp digest routines high level interface message digests.

where high level == slower :-)

so why should use evp_digest? it's explained in same page before:

the evp interface message digests should used in preference low level interfaces. because code becomes transparent digest used , more flexible.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -