Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where is SHA1_Init implementation in openssl

Tags:

openssl

sha

I would like to find the implementation of SHA1_Init in openssl source code.

http://osxr.org:8080/openssl/source/crypto/sha/sha1.c#0108

0108     SHA1_Init(&c);

but only definition found in http://osxr.org:8080/openssl/source/crypto/sha/sha.h#0122

Where is it? Thanks,

=SG=

like image 774
smoking gun Avatar asked Sep 10 '26 16:09

smoking gun


1 Answers

So SHA1_Init is defined in the header of sha_locl.h as HASH_INIT. sha1dgst.c includes sha_locl.h which includes ../md32_common.h which does the expansion of HASH_UPDATE, HASH_TRANFORM, and HASH_FINAL which is defined as SHA1_Init in sha.h. I believe the actual implementation though of SHA1_Init is ultimately here: http://osxr.org:8080/openssl/source/crypto/sha/sha_locl.h#0125 or here on github: https://github.com/openssl/openssl/blob/master/crypto/sha/sha_locl.h#L101.

like image 52
winhowes Avatar answered Sep 13 '26 12:09

winhowes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!