/**
* Internal SHA1 state.
- * You can consider it an opaque handle, if you want just hash
- * functions.
+ * You should use it just as an opaque handle only.
*/
typedef struct {
u32 h0,h1,h2,h3,h4;
* Push another @inlen bytes of data pointed to by @inbuf onto the
* SHA1 hash currently in @hd. You can call this any times you want on
* the same hash (and you do not need to reinitialize it by
- * sha1_init()). It has the same effect as concatenating all the data
+ * @sha1_init()). It has the same effect as concatenating all the data
* together and passing them at once.
*/
void sha1_update(sha1_context *hd, const byte *inbuf, uns inlen);
/**
- * No more sha1_update() calls will be done. This terminates the hash
- * and returns pointer to it.
+ * No more @sha1_update() calls will be done. This terminates the hash
+ * and returns a pointer to it.
*
- * Note the pointer points into data in the @hd context. If it ceases
+ * Note that the pointer points into data in the @hd context. If it ceases
* to exist, the pointer becomes invalid.
+ *
+ * To convert the hash to its usual hexadecimal representation, see
+ * <<string:mem_to_hex()>>.
*/
byte *sha1_final(sha1_context *hd);
/**
- * Convenience one-shot function for SHA1 hash.
+ * A convenience one-shot function for SHA1 hash.
* It is equivalent to this snippet of code:
*
* sha1_context hd;
* sha1_init(&hd);
* sha1_update(&hd, buffer, length);
- * memcpy(outbuf, sha1_final(&hd), 20);
+ * memcpy(outbuf, sha1_final(&hd), SHA1_SIZE);
*/
void sha1_hash_buffer(byte *outbuf, const byte *buffer, uns length);