#include
unsigned char *SHA1(const unsigned char *d, unsigned long n, unsigned char *md);
int SHA1_Init(SHA_CTX *c); int SHA1_Update(SHA_CTX *c, const void *data, unsigned long len); int SHA1_Final(unsigned char *md, SHA_CTX *c);
_S_H_A_1_(_) computes the SHA-1 message digest of the nn bytes at dd and places it in mmdd (which must have space for SHA_DIGEST_LENGTH == 20 bytes of output). If mmdd is NULL, the digest is placed in a static array.
The following functions may be used if the message is not completely stored in memory:
_S_H_A_1___I_n_i_t_(_) initializes a SSHHAA__CCTTXX structure.
_S_H_A_1___U_p_d_a_t_e_(_) can be called repeatedly with chunks of the message to be hashed (lleenn bytes at ddaattaa).
_S_H_A_1___F_i_n_a_l_(_) places the message digest in mmdd, which must have space for SHA_DIGEST_LENGTH == 20 bytes of output, and erases the SSHHAA__CCTTXX.
Applications should use the higher level functions _E_V_P___D_i_g_e_s_t_I_n_i_t(3) etc. instead of calling the hash functions directly.
The predecessor of SHA-1, SHA, is also implemented, but it should be used only when backward compatibility is required.
_S_H_A_1___I_n_i_t_(_), _S_H_A_1___U_p_d_a_t_e_(_) and _S_H_A_1___F_i_n_a_l_(_) return 1 for success, 0 otherwise.