Doug Zongker | 8e5b63d | 2013-04-10 09:22:02 -0700 | [diff] [blame] | 1 | // Copyright 2005 Google Inc. All Rights Reserved. |
| 2 | // Author: mschilder@google.com (Marius Schilder) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 3 | |
Doug Zongker | 8e5b63d | 2013-04-10 09:22:02 -0700 | [diff] [blame] | 4 | #ifndef SECURITY_UTIL_LITE_SHA1_H__ |
| 5 | #define SECURITY_UTIL_LITE_SHA1_H__ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 6 | |
Doug Zongker | 8e5b63d | 2013-04-10 09:22:02 -0700 | [diff] [blame] | 7 | #include <stdint.h> |
| 8 | #include "hash-internal.h" |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 9 | |
| 10 | #ifdef __cplusplus |
| 11 | extern "C" { |
Doug Zongker | 8e5b63d | 2013-04-10 09:22:02 -0700 | [diff] [blame] | 12 | #endif // __cplusplus |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 13 | |
Doug Zongker | 8e5b63d | 2013-04-10 09:22:02 -0700 | [diff] [blame] | 14 | typedef HASH_CTX SHA_CTX; |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 15 | |
Doug Zongker | a6de77d | 2009-08-17 15:38:31 -0700 | [diff] [blame] | 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); |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 19 | |
Doug Zongker | 8e5b63d | 2013-04-10 09:22:02 -0700 | [diff] [blame] | 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); |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 23 | |
| 24 | #define SHA_DIGEST_SIZE 20 |
| 25 | |
| 26 | #ifdef __cplusplus |
| 27 | } |
Doug Zongker | 8e5b63d | 2013-04-10 09:22:02 -0700 | [diff] [blame] | 28 | #endif // __cplusplus |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 29 | |
Doug Zongker | 8e5b63d | 2013-04-10 09:22:02 -0700 | [diff] [blame] | 30 | #endif // SECURITY_UTIL_LITE_SHA1_H__ |