This is Webservice SDK for mbed. LPCXpresso1769/LPC1768/FRDM-K64F/LPC4088
Fork of libMiMic by
core/utils/sha1/sha1.h@57:bc4330dfa62f, 2013-09-13 (annotated)
- Committer:
- nyatla
- Date:
- Fri Sep 13 06:38:16 2013 +0000
- Revision:
- 57:bc4330dfa62f
update mimic core r329;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nyatla | 57:bc4330dfa62f | 1 | /* sha1.h */ |
nyatla | 57:bc4330dfa62f | 2 | #include "NyLPC_stdlib.h" |
nyatla | 57:bc4330dfa62f | 3 | /* If OpenSSL is in use, then use that version of SHA-1 */ |
nyatla | 57:bc4330dfa62f | 4 | #ifdef OPENSSL |
nyatla | 57:bc4330dfa62f | 5 | #include <t_sha.h> |
nyatla | 57:bc4330dfa62f | 6 | #define __SHA1_INCLUDE_ |
nyatla | 57:bc4330dfa62f | 7 | #endif |
nyatla | 57:bc4330dfa62f | 8 | |
nyatla | 57:bc4330dfa62f | 9 | #ifdef __cplusplus |
nyatla | 57:bc4330dfa62f | 10 | extern "C" { |
nyatla | 57:bc4330dfa62f | 11 | #endif /* __cplusplus */ |
nyatla | 57:bc4330dfa62f | 12 | |
nyatla | 57:bc4330dfa62f | 13 | #ifndef __SHA1_INCLUDE_ |
nyatla | 57:bc4330dfa62f | 14 | |
nyatla | 57:bc4330dfa62f | 15 | #ifndef SHA1_SIGNATURE_SIZE |
nyatla | 57:bc4330dfa62f | 16 | #ifdef SHA_DIGESTSIZE |
nyatla | 57:bc4330dfa62f | 17 | #define SHA1_SIGNATURE_SIZE SHA_DIGESTSIZE |
nyatla | 57:bc4330dfa62f | 18 | #else |
nyatla | 57:bc4330dfa62f | 19 | #define SHA1_SIGNATURE_SIZE 20 |
nyatla | 57:bc4330dfa62f | 20 | #endif |
nyatla | 57:bc4330dfa62f | 21 | #endif |
nyatla | 57:bc4330dfa62f | 22 | |
nyatla | 57:bc4330dfa62f | 23 | |
nyatla | 57:bc4330dfa62f | 24 | typedef struct { |
nyatla | 57:bc4330dfa62f | 25 | NyLPC_TUInt32 state[5]; |
nyatla | 57:bc4330dfa62f | 26 | NyLPC_TUInt32 count[2]; |
nyatla | 57:bc4330dfa62f | 27 | unsigned char buffer[64]; |
nyatla | 57:bc4330dfa62f | 28 | }SHA1_CTX; |
nyatla | 57:bc4330dfa62f | 29 | |
nyatla | 57:bc4330dfa62f | 30 | void SHA1Init(SHA1_CTX* context); |
nyatla | 57:bc4330dfa62f | 31 | void SHA1Update(SHA1_CTX* context,const void* data, unsigned int len); |
nyatla | 57:bc4330dfa62f | 32 | void SHA1Final(unsigned char digest[20], SHA1_CTX* context); |
nyatla | 57:bc4330dfa62f | 33 | |
nyatla | 57:bc4330dfa62f | 34 | #ifdef __cplusplus |
nyatla | 57:bc4330dfa62f | 35 | } |
nyatla | 57:bc4330dfa62f | 36 | #endif /* __cplusplus */ |
nyatla | 57:bc4330dfa62f | 37 | |
nyatla | 57:bc4330dfa62f | 38 | #define __SHA1_INCLUDE_ |
nyatla | 57:bc4330dfa62f | 39 | #endif /* __SHA1_INCLUDE_ */ |
nyatla | 57:bc4330dfa62f | 40 |