1// Copyright 2011 Google Inc. All Rights Reserved. 2// Author: mschilder@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 11extern "C" { 12#endif // __cplusplus 13 14typedef HASH_CTX SHA256_CTX; 15 16void SHA256_init(SHA256_CTX* ctx); 17void SHA256_update(SHA256_CTX* ctx, const void* data, int len); 18const uint8_t* SHA256_final(SHA256_CTX* ctx); 19 20// Convenience method. Returns digest address. 21const 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