source: UsbWattMeter/trunk/wolfssl-3.7.0/wolfssl/openssl/sha.h@ 164

Last change on this file since 164 was 164, checked in by coas-nagasima, 6 years ago

TOPPERS/ECNLサンプルアプリ「USB充電器電力計」を追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-chdr
File size: 3.0 KB
Line 
1/* sha.h for openssl */
2
3
4#ifndef WOLFSSL_SHA_H_
5#define WOLFSSL_SHA_H_
6
7#include <wolfssl/wolfcrypt/settings.h>
8
9#ifdef WOLFSSL_PREFIX
10#include "prefix_sha.h"
11#endif
12
13#ifdef __cplusplus
14 extern "C" {
15#endif
16
17
18typedef struct WOLFSSL_SHA_CTX {
19 int holder[24]; /* big enough to hold wolfcrypt sha, but check on init */
20} WOLFSSL_SHA_CTX;
21
22WOLFSSL_API void wolfSSL_SHA_Init(WOLFSSL_SHA_CTX*);
23WOLFSSL_API void wolfSSL_SHA_Update(WOLFSSL_SHA_CTX*, const void*, unsigned long);
24WOLFSSL_API void wolfSSL_SHA_Final(unsigned char*, WOLFSSL_SHA_CTX*);
25
26/* SHA1 points to above, shouldn't use SHA0 ever */
27WOLFSSL_API void wolfSSL_SHA1_Init(WOLFSSL_SHA_CTX*);
28WOLFSSL_API void wolfSSL_SHA1_Update(WOLFSSL_SHA_CTX*, const void*, unsigned long);
29WOLFSSL_API void wolfSSL_SHA1_Final(unsigned char*, WOLFSSL_SHA_CTX*);
30
31enum {
32 SHA_DIGEST_LENGTH = 20
33};
34
35
36typedef WOLFSSL_SHA_CTX SHA_CTX;
37
38#define SHA_Init wolfSSL_SHA_Init
39#define SHA_Update wolfSSL_SHA_Update
40#define SHA_Final wolfSSL_SHA_Final
41
42#define SHA1_Init wolfSSL_SHA1_Init
43#define SHA1_Update wolfSSL_SHA1_Update
44#define SHA1_Final wolfSSL_SHA1_Final
45
46
47typedef struct WOLFSSL_SHA256_CTX {
48 int holder[28]; /* big enough to hold wolfcrypt sha, but check on init */
49} WOLFSSL_SHA256_CTX;
50
51WOLFSSL_API void wolfSSL_SHA256_Init(WOLFSSL_SHA256_CTX*);
52WOLFSSL_API void wolfSSL_SHA256_Update(WOLFSSL_SHA256_CTX*, const void*,
53 unsigned long);
54WOLFSSL_API void wolfSSL_SHA256_Final(unsigned char*, WOLFSSL_SHA256_CTX*);
55
56enum {
57 SHA256_DIGEST_LENGTH = 32
58};
59
60
61typedef WOLFSSL_SHA256_CTX SHA256_CTX;
62
63#define SHA256_Init wolfSSL_SHA256_Init
64#define SHA256_Update wolfSSL_SHA256_Update
65#define SHA256_Final wolfSSL_SHA256_Final
66
67
68#ifdef WOLFSSL_SHA384
69
70typedef struct WOLFSSL_SHA384_CTX {
71 long long holder[32]; /* big enough, but check on init */
72} WOLFSSL_SHA384_CTX;
73
74WOLFSSL_API void wolfSSL_SHA384_Init(WOLFSSL_SHA384_CTX*);
75WOLFSSL_API void wolfSSL_SHA384_Update(WOLFSSL_SHA384_CTX*, const void*,
76 unsigned long);
77WOLFSSL_API void wolfSSL_SHA384_Final(unsigned char*, WOLFSSL_SHA384_CTX*);
78
79enum {
80 SHA384_DIGEST_LENGTH = 48
81};
82
83
84typedef WOLFSSL_SHA384_CTX SHA384_CTX;
85
86#define SHA384_Init wolfSSL_SHA384_Init
87#define SHA384_Update wolfSSL_SHA384_Update
88#define SHA384_Final wolfSSL_SHA384_Final
89
90#endif /* WOLFSSL_SHA384 */
91
92#ifdef WOLFSSL_SHA512
93
94typedef struct WOLFSSL_SHA512_CTX {
95 long long holder[36]; /* big enough, but check on init */
96} WOLFSSL_SHA512_CTX;
97
98WOLFSSL_API void wolfSSL_SHA512_Init(WOLFSSL_SHA512_CTX*);
99WOLFSSL_API void wolfSSL_SHA512_Update(WOLFSSL_SHA512_CTX*, const void*,
100 unsigned long);
101WOLFSSL_API void wolfSSL_SHA512_Final(unsigned char*, WOLFSSL_SHA512_CTX*);
102
103enum {
104 SHA512_DIGEST_LENGTH = 64
105};
106
107
108typedef WOLFSSL_SHA512_CTX SHA512_CTX;
109
110#define SHA512_Init wolfSSL_SHA512_Init
111#define SHA512_Update wolfSSL_SHA512_Update
112#define SHA512_Final wolfSSL_SHA512_Final
113
114#endif /* WOLFSSL_SHA512 */
115
116
117
118
119#ifdef __cplusplus
120 } /* extern "C" */
121#endif
122
123
124#endif /* WOLFSSL_SHA_H_ */
125
Note: See TracBrowser for help on using the repository browser.