Home | History | Annotate | Download | only in src
      1 /* public api for steve reid's public domain SHA-1 implementation */
      2 /* this file is in the public domain */
      3 
      4 #pragma once
      5 
      6 #include "Platform.h"
      7 
      8 struct SHA1_CTX
      9 {
     10     uint32_t state[5];
     11     uint32_t count[2];
     12     uint8_t  buffer[64];
     13 };
     14 
     15 #define SHA1_DIGEST_SIZE 20
     16 
     17 void SHA1_Init(SHA1_CTX* context);
     18 void SHA1_Update(SHA1_CTX* context, const uint8_t* data, const size_t len);
     19 void SHA1_Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE]);
     20 
     21 void sha1_32a ( const void * key, int len, uint32_t seed, void * out );