CyaSSL 3.0.0
Dependents: HTTPClient-SSL HTTPClient HTTPClient-SSL http_access ... more
cyassl/openssl/sha.h@0:1239e9b70ca2, 2014-07-12 (annotated)
- Committer:
- wolfSSL
- Date:
- Sat Jul 12 07:18:23 2014 +0000
- Revision:
- 0:1239e9b70ca2
CyaSSL 3.0.0;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wolfSSL | 0:1239e9b70ca2 | 1 | /* sha.h for openssl */ |
wolfSSL | 0:1239e9b70ca2 | 2 | |
wolfSSL | 0:1239e9b70ca2 | 3 | |
wolfSSL | 0:1239e9b70ca2 | 4 | #ifndef CYASSL_SHA_H_ |
wolfSSL | 0:1239e9b70ca2 | 5 | #define CYASSL_SHA_H_ |
wolfSSL | 0:1239e9b70ca2 | 6 | |
wolfSSL | 0:1239e9b70ca2 | 7 | #include <cyassl/ctaocrypt/settings.h> |
wolfSSL | 0:1239e9b70ca2 | 8 | |
wolfSSL | 0:1239e9b70ca2 | 9 | #ifdef YASSL_PREFIX |
wolfSSL | 0:1239e9b70ca2 | 10 | #include "prefix_sha.h" |
wolfSSL | 0:1239e9b70ca2 | 11 | #endif |
wolfSSL | 0:1239e9b70ca2 | 12 | |
wolfSSL | 0:1239e9b70ca2 | 13 | #ifdef __cplusplus |
wolfSSL | 0:1239e9b70ca2 | 14 | extern "C" { |
wolfSSL | 0:1239e9b70ca2 | 15 | #endif |
wolfSSL | 0:1239e9b70ca2 | 16 | |
wolfSSL | 0:1239e9b70ca2 | 17 | |
wolfSSL | 0:1239e9b70ca2 | 18 | typedef struct CYASSL_SHA_CTX { |
wolfSSL | 0:1239e9b70ca2 | 19 | int holder[24]; /* big enough to hold ctaocrypt sha, but check on init */ |
wolfSSL | 0:1239e9b70ca2 | 20 | } CYASSL_SHA_CTX; |
wolfSSL | 0:1239e9b70ca2 | 21 | |
wolfSSL | 0:1239e9b70ca2 | 22 | CYASSL_API void CyaSSL_SHA_Init(CYASSL_SHA_CTX*); |
wolfSSL | 0:1239e9b70ca2 | 23 | CYASSL_API void CyaSSL_SHA_Update(CYASSL_SHA_CTX*, const void*, unsigned long); |
wolfSSL | 0:1239e9b70ca2 | 24 | CYASSL_API void CyaSSL_SHA_Final(unsigned char*, CYASSL_SHA_CTX*); |
wolfSSL | 0:1239e9b70ca2 | 25 | |
wolfSSL | 0:1239e9b70ca2 | 26 | /* SHA1 points to above, shouldn't use SHA0 ever */ |
wolfSSL | 0:1239e9b70ca2 | 27 | CYASSL_API void CyaSSL_SHA1_Init(CYASSL_SHA_CTX*); |
wolfSSL | 0:1239e9b70ca2 | 28 | CYASSL_API void CyaSSL_SHA1_Update(CYASSL_SHA_CTX*, const void*, unsigned long); |
wolfSSL | 0:1239e9b70ca2 | 29 | CYASSL_API void CyaSSL_SHA1_Final(unsigned char*, CYASSL_SHA_CTX*); |
wolfSSL | 0:1239e9b70ca2 | 30 | |
wolfSSL | 0:1239e9b70ca2 | 31 | enum { |
wolfSSL | 0:1239e9b70ca2 | 32 | SHA_DIGEST_LENGTH = 20 |
wolfSSL | 0:1239e9b70ca2 | 33 | }; |
wolfSSL | 0:1239e9b70ca2 | 34 | |
wolfSSL | 0:1239e9b70ca2 | 35 | |
wolfSSL | 0:1239e9b70ca2 | 36 | typedef CYASSL_SHA_CTX SHA_CTX; |
wolfSSL | 0:1239e9b70ca2 | 37 | |
wolfSSL | 0:1239e9b70ca2 | 38 | #define SHA_Init CyaSSL_SHA_Init |
wolfSSL | 0:1239e9b70ca2 | 39 | #define SHA_Update CyaSSL_SHA_Update |
wolfSSL | 0:1239e9b70ca2 | 40 | #define SHA_Final CyaSSL_SHA_Final |
wolfSSL | 0:1239e9b70ca2 | 41 | |
wolfSSL | 0:1239e9b70ca2 | 42 | #define SHA1_Init CyaSSL_SHA1_Init |
wolfSSL | 0:1239e9b70ca2 | 43 | #define SHA1_Update CyaSSL_SHA1_Update |
wolfSSL | 0:1239e9b70ca2 | 44 | #define SHA1_Final CyaSSL_SHA1_Final |
wolfSSL | 0:1239e9b70ca2 | 45 | |
wolfSSL | 0:1239e9b70ca2 | 46 | |
wolfSSL | 0:1239e9b70ca2 | 47 | typedef struct CYASSL_SHA256_CTX { |
wolfSSL | 0:1239e9b70ca2 | 48 | int holder[28]; /* big enough to hold ctaocrypt sha, but check on init */ |
wolfSSL | 0:1239e9b70ca2 | 49 | } CYASSL_SHA256_CTX; |
wolfSSL | 0:1239e9b70ca2 | 50 | |
wolfSSL | 0:1239e9b70ca2 | 51 | CYASSL_API void CyaSSL_SHA256_Init(CYASSL_SHA256_CTX*); |
wolfSSL | 0:1239e9b70ca2 | 52 | CYASSL_API void CyaSSL_SHA256_Update(CYASSL_SHA256_CTX*, const void*, |
wolfSSL | 0:1239e9b70ca2 | 53 | unsigned long); |
wolfSSL | 0:1239e9b70ca2 | 54 | CYASSL_API void CyaSSL_SHA256_Final(unsigned char*, CYASSL_SHA256_CTX*); |
wolfSSL | 0:1239e9b70ca2 | 55 | |
wolfSSL | 0:1239e9b70ca2 | 56 | enum { |
wolfSSL | 0:1239e9b70ca2 | 57 | SHA256_DIGEST_LENGTH = 32 |
wolfSSL | 0:1239e9b70ca2 | 58 | }; |
wolfSSL | 0:1239e9b70ca2 | 59 | |
wolfSSL | 0:1239e9b70ca2 | 60 | |
wolfSSL | 0:1239e9b70ca2 | 61 | typedef CYASSL_SHA256_CTX SHA256_CTX; |
wolfSSL | 0:1239e9b70ca2 | 62 | |
wolfSSL | 0:1239e9b70ca2 | 63 | #define SHA256_Init CyaSSL_SHA256_Init |
wolfSSL | 0:1239e9b70ca2 | 64 | #define SHA256_Update CyaSSL_SHA256_Update |
wolfSSL | 0:1239e9b70ca2 | 65 | #define SHA256_Final CyaSSL_SHA256_Final |
wolfSSL | 0:1239e9b70ca2 | 66 | |
wolfSSL | 0:1239e9b70ca2 | 67 | |
wolfSSL | 0:1239e9b70ca2 | 68 | #ifdef CYASSL_SHA384 |
wolfSSL | 0:1239e9b70ca2 | 69 | |
wolfSSL | 0:1239e9b70ca2 | 70 | typedef struct CYASSL_SHA384_CTX { |
wolfSSL | 0:1239e9b70ca2 | 71 | long long holder[32]; /* big enough, but check on init */ |
wolfSSL | 0:1239e9b70ca2 | 72 | } CYASSL_SHA384_CTX; |
wolfSSL | 0:1239e9b70ca2 | 73 | |
wolfSSL | 0:1239e9b70ca2 | 74 | CYASSL_API void CyaSSL_SHA384_Init(CYASSL_SHA384_CTX*); |
wolfSSL | 0:1239e9b70ca2 | 75 | CYASSL_API void CyaSSL_SHA384_Update(CYASSL_SHA384_CTX*, const void*, |
wolfSSL | 0:1239e9b70ca2 | 76 | unsigned long); |
wolfSSL | 0:1239e9b70ca2 | 77 | CYASSL_API void CyaSSL_SHA384_Final(unsigned char*, CYASSL_SHA384_CTX*); |
wolfSSL | 0:1239e9b70ca2 | 78 | |
wolfSSL | 0:1239e9b70ca2 | 79 | enum { |
wolfSSL | 0:1239e9b70ca2 | 80 | SHA384_DIGEST_LENGTH = 48 |
wolfSSL | 0:1239e9b70ca2 | 81 | }; |
wolfSSL | 0:1239e9b70ca2 | 82 | |
wolfSSL | 0:1239e9b70ca2 | 83 | |
wolfSSL | 0:1239e9b70ca2 | 84 | typedef CYASSL_SHA384_CTX SHA384_CTX; |
wolfSSL | 0:1239e9b70ca2 | 85 | |
wolfSSL | 0:1239e9b70ca2 | 86 | #define SHA384_Init CyaSSL_SHA384_Init |
wolfSSL | 0:1239e9b70ca2 | 87 | #define SHA384_Update CyaSSL_SHA384_Update |
wolfSSL | 0:1239e9b70ca2 | 88 | #define SHA384_Final CyaSSL_SHA384_Final |
wolfSSL | 0:1239e9b70ca2 | 89 | |
wolfSSL | 0:1239e9b70ca2 | 90 | #endif /* CYASSL_SHA384 */ |
wolfSSL | 0:1239e9b70ca2 | 91 | |
wolfSSL | 0:1239e9b70ca2 | 92 | #ifdef CYASSL_SHA512 |
wolfSSL | 0:1239e9b70ca2 | 93 | |
wolfSSL | 0:1239e9b70ca2 | 94 | typedef struct CYASSL_SHA512_CTX { |
wolfSSL | 0:1239e9b70ca2 | 95 | long long holder[36]; /* big enough, but check on init */ |
wolfSSL | 0:1239e9b70ca2 | 96 | } CYASSL_SHA512_CTX; |
wolfSSL | 0:1239e9b70ca2 | 97 | |
wolfSSL | 0:1239e9b70ca2 | 98 | CYASSL_API void CyaSSL_SHA512_Init(CYASSL_SHA512_CTX*); |
wolfSSL | 0:1239e9b70ca2 | 99 | CYASSL_API void CyaSSL_SHA512_Update(CYASSL_SHA512_CTX*, const void*, |
wolfSSL | 0:1239e9b70ca2 | 100 | unsigned long); |
wolfSSL | 0:1239e9b70ca2 | 101 | CYASSL_API void CyaSSL_SHA512_Final(unsigned char*, CYASSL_SHA512_CTX*); |
wolfSSL | 0:1239e9b70ca2 | 102 | |
wolfSSL | 0:1239e9b70ca2 | 103 | enum { |
wolfSSL | 0:1239e9b70ca2 | 104 | SHA512_DIGEST_LENGTH = 64 |
wolfSSL | 0:1239e9b70ca2 | 105 | }; |
wolfSSL | 0:1239e9b70ca2 | 106 | |
wolfSSL | 0:1239e9b70ca2 | 107 | |
wolfSSL | 0:1239e9b70ca2 | 108 | typedef CYASSL_SHA512_CTX SHA512_CTX; |
wolfSSL | 0:1239e9b70ca2 | 109 | |
wolfSSL | 0:1239e9b70ca2 | 110 | #define SHA512_Init CyaSSL_SHA512_Init |
wolfSSL | 0:1239e9b70ca2 | 111 | #define SHA512_Update CyaSSL_SHA512_Update |
wolfSSL | 0:1239e9b70ca2 | 112 | #define SHA512_Final CyaSSL_SHA512_Final |
wolfSSL | 0:1239e9b70ca2 | 113 | |
wolfSSL | 0:1239e9b70ca2 | 114 | #endif /* CYASSL_SHA512 */ |
wolfSSL | 0:1239e9b70ca2 | 115 | |
wolfSSL | 0:1239e9b70ca2 | 116 | |
wolfSSL | 0:1239e9b70ca2 | 117 | |
wolfSSL | 0:1239e9b70ca2 | 118 | |
wolfSSL | 0:1239e9b70ca2 | 119 | #ifdef __cplusplus |
wolfSSL | 0:1239e9b70ca2 | 120 | } /* extern "C" */ |
wolfSSL | 0:1239e9b70ca2 | 121 | #endif |
wolfSSL | 0:1239e9b70ca2 | 122 | |
wolfSSL | 0:1239e9b70ca2 | 123 | |
wolfSSL | 0:1239e9b70ca2 | 124 | #endif /* CYASSL_SHA_H_ */ |
wolfSSL | 0:1239e9b70ca2 | 125 | |
wolfSSL | 0:1239e9b70ca2 | 126 |