1 // Copyright 2005 Google Inc. All Rights Reserved. 2 // Author: mschilder (at) google.com (Marius Schilder) 3 4 #ifndef SECURITY_UTIL_LITE_SHA1_H__ 5 #define SECURITY_UTIL_LITE_SHA1_H__ 6 7 #include <stdint.h> 8 #include "hash-internal.h" 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif // __cplusplus 13 14 typedef HASH_CTX SHA_CTX; 15 16 void SHA_init(SHA_CTX* ctx); 17 void SHA_update(SHA_CTX* ctx, const void* data, int len); 18 const uint8_t* SHA_final(SHA_CTX* ctx); 19 20 // Convenience method. Returns digest address. 21 // NOTE: *digest needs to hold SHA_DIGEST_SIZE bytes. 22 const uint8_t* SHA_hash(const void* data, int len, uint8_t* digest); 23 24 #define SHA_DIGEST_SIZE 20 25 26 #ifdef __cplusplus 27 } 28 #endif // __cplusplus 29 30 #endif // SECURITY_UTIL_LITE_SHA1_H__ 31