1 // Copyright 2011 Google Inc. All Rights Reserved. 2 // Author: mschilder (at) google.com (Marius Schilder) 3 4 #ifndef SECURITY_UTIL_LITE_SHA256_H__ 5 #define SECURITY_UTIL_LITE_SHA256_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 SHA256_CTX; 15 16 void SHA256_init(SHA256_CTX* ctx); 17 void SHA256_update(SHA256_CTX* ctx, const void* data, int len); 18 const uint8_t* SHA256_final(SHA256_CTX* ctx); 19 20 // Convenience method. Returns digest address. 21 const uint8_t* SHA256_hash(const void* data, int len, uint8_t* digest); 22 23 #define SHA256_DIGEST_SIZE 32 24 25 #ifdef __cplusplus 26 } 27 #endif // __cplusplus 28 29 #endif // SECURITY_UTIL_LITE_SHA256_H__ 30