ssl - how find function in source -


in researching how best utilize openssh, looked sha hashing , found a post discussing sha2 functions in openssl. accepted answer states

sha-224 , sha-256 same function, save internal parameter

i'm sure true but, i'd take look-see myself. know how looks. specifically, i'd @ function sha-224 , sha-256 hashing.

as aside, question important me because i've taken few intro programming (c , perl) courses , these have left me feeling "ok, what? how useful". perhaps poking around bit i'll see useful code looks like, learn bit how open source software organized, , take small step toward contributing useful myself.

so downloaded the openssl source code (openssl-1.0.2e.tar.gz), unpacked , thought "wow, start?"

so, um, start? there lots of files , lots of directories. there convention things put? there development environment should install see bigger picture? me started in right direction appreciated.

google start. useful keywords:

openssl sha256 

second result brings header file openssl/sha.h, find how functions called in code:

 int sha224_init(sha256_ctx *c);  int sha224_update(sha256_ctx *c, const void *data, size_t len);  int sha224_final(unsigned char *md, sha256_ctx *c);  unsigned char *sha224(const unsigned char *d, size_t n,       unsigned char *md);   int sha256_init(sha256_ctx *c);  int sha256_update(sha256_ctx *c, const void *data, size_t len);  int sha256_final(unsigned char *md, sha256_ctx *c);  unsigned char *sha256(const unsigned char *d, size_t n,       unsigned char *md); 

and nothing easier clone openssl git , grep through it, example github should enough. now, keyword sha256_init. , hooray, implementation here in

openssl/crypto/sha/sha256.c 

Comments