totp

Simple cli tool for storing TOTP secrets and generating tokens
git clone https://git.inz.fi/totp/
Log | Files | Refs | Submodules

sha1.h (414B)


      1 #ifndef SHA1_H
      2 #define SHA1_H
      3 
      4 #include <stdlib.h>
      5 #include <stdint.h>
      6 
      7 #define SHA1_HASHSIZE 20
      8 
      9 struct sha1 {
     10 	uint8_t buffer[64];
     11 	uint32_t h[5];
     12 	uint64_t len;
     13 };
     14 
     15 void sha1_init(struct sha1 *s);
     16 void sha1_update(struct sha1 *s, const void *data, size_t len);
     17 void sha1_finish(struct sha1 *s);
     18 
     19 void sha1_hmac(const void *key, size_t keylen,
     20 	       const void *data, size_t datalen,
     21 	       void *h);
     22 
     23 #endif