blob: 120ddcb4ff450de6298bbde53162511e66e651da [file] [log] [blame]
Dees Troybb4c0cb2013-11-02 20:25:14 +00001// Copyright 2005 Google Inc. All Rights Reserved.
2// Author: mschilder@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
11extern "C" {
12#endif // __cplusplus
13
14typedef HASH_CTX SHA_CTX;
15
16void SHA_init(SHA_CTX* ctx);
17void SHA_update(SHA_CTX* ctx, const void* data, int len);
18const uint8_t* SHA_final(SHA_CTX* ctx);
19
20// Convenience method. Returns digest address.
21// NOTE: *digest needs to hold SHA_DIGEST_SIZE bytes.
22const 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__