torrentd

simple torrent daemon
git clone git@git.2f30.org/torrentd.git
Log | Files | Refs | LICENSE

sha1.h (575B)


      1 /* public domain sha1 implementation based on rfc3174 and libtomcrypt */
      2 #define SHA1_DIGEST_LENGTH 20
      3 
      4 struct sha1 {
      5 	uint64_t len;    /* processed message length */
      6 	uint32_t h[5];   /* hash state */
      7 	uint8_t buf[64]; /* message block buffer */
      8 };
      9 
     10 /* reset state */
     11 void sha1_init(void *);
     12 /* process message */
     13 void sha1_update(void *, const void *, unsigned long);
     14 /* get message digest */
     15 /* state is ruined after sum, keep a copy if multiple sum is needed */
     16 /* part of the message might be left in s, zero it if secrecy is needed */
     17 void sha1_sum(void *, uint8_t *);