Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /* public api for steve reid's public domain SHA-1 implementation */
  2. /* this file is in the public domain */
  3.  
  4. #ifndef __SHA1_H
  5. #define __SHA1_H
  6.  
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10.  
  11. typedef struct {
  12.     uint32_t state[5];
  13.     uint32_t count[2];
  14.     uint8_t  buffer[64];
  15. } SHA1_CTX;
  16.  
  17. #define SHA1_DIGEST_SIZE 20
  18.  
  19. void SHA1_Init(SHA1_CTX* context);
  20. void SHA1_Update(SHA1_CTX* context, const uint8_t* data, const size_t len);
  21. void SHA1_Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE]);
  22.  
  23. #ifdef __cplusplus
  24. }
  25. #endif
  26.  
  27. #endif /* __SHA1_H */
  28.