Twitter with OAuth Example.\\ see also http://www.soramimi.jp/twicpp/index.html

Dependencies:   mbed HTTPClient NTPClient_NetServices EthernetNetIf

Committer:
soramimi
Date:
Wed Mar 23 19:53:42 2011 +0000
Revision:
0:7ddb56bfde0c

    

Who changed what in which revision?

UserRevisionLine numberNew contents of line
soramimi0:7ddb56bfde0c 1/*
soramimi0:7ddb56bfde0c 2 * sha1.h
soramimi0:7ddb56bfde0c 3 *
soramimi0:7ddb56bfde0c 4 * Description:
soramimi0:7ddb56bfde0c 5 * This is the header file for code which implements the Secure
soramimi0:7ddb56bfde0c 6 * Hashing Algorithm 1 as defined in FIPS PUB 180-1 published
soramimi0:7ddb56bfde0c 7 * April 17, 1995.
soramimi0:7ddb56bfde0c 8 *
soramimi0:7ddb56bfde0c 9 * Many of the variable names in this code, especially the
soramimi0:7ddb56bfde0c 10 * single character names, were used because those were the names
soramimi0:7ddb56bfde0c 11 * used in the publication.
soramimi0:7ddb56bfde0c 12 *
soramimi0:7ddb56bfde0c 13 * Please read the file sha1.c for more information.
soramimi0:7ddb56bfde0c 14 *
soramimi0:7ddb56bfde0c 15 */
soramimi0:7ddb56bfde0c 16
soramimi0:7ddb56bfde0c 17#ifndef _SHA1_H_
soramimi0:7ddb56bfde0c 18#define _SHA1_H_
soramimi0:7ddb56bfde0c 19
soramimi0:7ddb56bfde0c 20#ifdef __cplusplus
soramimi0:7ddb56bfde0c 21extern "C" {
soramimi0:7ddb56bfde0c 22#endif
soramimi0:7ddb56bfde0c 23
soramimi0:7ddb56bfde0c 24//#include <stdint.h>
soramimi0:7ddb56bfde0c 25typedef unsigned long uint32_t;
soramimi0:7ddb56bfde0c 26typedef int int_least16_t;
soramimi0:7ddb56bfde0c 27typedef unsigned char uint8_t;
soramimi0:7ddb56bfde0c 28
soramimi0:7ddb56bfde0c 29/*
soramimi0:7ddb56bfde0c 30 * If you do not have the ISO standard stdint.h header file, then you
soramimi0:7ddb56bfde0c 31 * must typdef the following:
soramimi0:7ddb56bfde0c 32 * name meaning
soramimi0:7ddb56bfde0c 33 * uint32_t unsigned 32 bit integer
soramimi0:7ddb56bfde0c 34 * uint8_t unsigned 8 bit integer (i.e., unsigned char)
soramimi0:7ddb56bfde0c 35 * int_least16_t integer of >= 16 bits
soramimi0:7ddb56bfde0c 36 *
soramimi0:7ddb56bfde0c 37 */
soramimi0:7ddb56bfde0c 38
soramimi0:7ddb56bfde0c 39#ifndef _SHA_enum_
soramimi0:7ddb56bfde0c 40#define _SHA_enum_
soramimi0:7ddb56bfde0c 41enum
soramimi0:7ddb56bfde0c 42{
soramimi0:7ddb56bfde0c 43 shaSuccess = 0,
soramimi0:7ddb56bfde0c 44 shaNull, /* Null pointer parameter */
soramimi0:7ddb56bfde0c 45 shaInputTooLong, /* input data too long */
soramimi0:7ddb56bfde0c 46 shaStateError /* called Input after Result */
soramimi0:7ddb56bfde0c 47};
soramimi0:7ddb56bfde0c 48#endif
soramimi0:7ddb56bfde0c 49#define SHA1HashSize 20
soramimi0:7ddb56bfde0c 50
soramimi0:7ddb56bfde0c 51/*
soramimi0:7ddb56bfde0c 52 * This structure will hold context information for the SHA-1
soramimi0:7ddb56bfde0c 53 * hashing operation
soramimi0:7ddb56bfde0c 54 */
soramimi0:7ddb56bfde0c 55typedef struct SHA1Context
soramimi0:7ddb56bfde0c 56{
soramimi0:7ddb56bfde0c 57 uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest */
soramimi0:7ddb56bfde0c 58
soramimi0:7ddb56bfde0c 59 uint32_t Length_Low; /* Message length in bits */
soramimi0:7ddb56bfde0c 60 uint32_t Length_High; /* Message length in bits */
soramimi0:7ddb56bfde0c 61
soramimi0:7ddb56bfde0c 62 /* Index into message block array */
soramimi0:7ddb56bfde0c 63 int_least16_t Message_Block_Index;
soramimi0:7ddb56bfde0c 64 uint8_t Message_Block[64]; /* 512-bit message blocks */
soramimi0:7ddb56bfde0c 65
soramimi0:7ddb56bfde0c 66 int Computed; /* Is the digest computed? */
soramimi0:7ddb56bfde0c 67 int Corrupted; /* Is the message digest corrupted? */
soramimi0:7ddb56bfde0c 68} SHA1Context;
soramimi0:7ddb56bfde0c 69
soramimi0:7ddb56bfde0c 70/*
soramimi0:7ddb56bfde0c 71 * Function Prototypes
soramimi0:7ddb56bfde0c 72 */
soramimi0:7ddb56bfde0c 73
soramimi0:7ddb56bfde0c 74int SHA1Reset( SHA1Context *);
soramimi0:7ddb56bfde0c 75int SHA1Input( SHA1Context *,
soramimi0:7ddb56bfde0c 76 const uint8_t *,
soramimi0:7ddb56bfde0c 77 unsigned int);
soramimi0:7ddb56bfde0c 78int SHA1Result( SHA1Context *,
soramimi0:7ddb56bfde0c 79 uint8_t Message_Digest[SHA1HashSize]);
soramimi0:7ddb56bfde0c 80
soramimi0:7ddb56bfde0c 81#ifdef __cplusplus
soramimi0:7ddb56bfde0c 82}
soramimi0:7ddb56bfde0c 83#endif
soramimi0:7ddb56bfde0c 84
soramimi0:7ddb56bfde0c 85#endif