50 #include <sys/types.h> 53 # ifdef HAVE_PROTOTYPES 59 # define LITTLE_ENDIAN 1234 60 # define BIG_ENDIAN 4321 61 # ifdef WORDS_BIGENDIAN 62 # define BYTE_ORDER BIG_ENDIAN 64 # define BYTE_ORDER LITTLE_ENDIAN 67 # define SHA2_USE_INTTYPES_H 69 #ifdef SHA2_USE_INTTYPES_H 78 #define SHA256_BLOCK_LENGTH 64 79 #define SHA256_DIGEST_LENGTH 32 80 #define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) 81 #define SHA384_BLOCK_LENGTH 128 82 #define SHA384_DIGEST_LENGTH 48 83 #define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) 84 #define SHA512_BLOCK_LENGTH 128 85 #define SHA512_DIGEST_LENGTH 64 86 #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) 94 #ifndef SHA2_USE_INTTYPES_H 138 #define SHA256_Init rb_Digest_SHA256_Init 139 #define SHA256_Update rb_Digest_SHA256_Update 140 #define SHA256_Finish rb_Digest_SHA256_Finish 141 #define SHA256_Data rb_Digest_SHA256_Data 142 #define SHA256_End rb_Digest_SHA256_End 143 #define SHA256_Last rb_Digest_SHA256_Last 144 #define SHA256_Transform rb_Digest_SHA256_Transform 145 #define SHA256_Final(d, c) SHA256_Finish(c, d) 147 #define SHA384_Init rb_Digest_SHA384_Init 148 #define SHA384_Update rb_Digest_SHA384_Update 149 #define SHA384_Finish rb_Digest_SHA384_Finish 150 #define SHA384_Data rb_Digest_SHA384_Data 151 #define SHA384_End rb_Digest_SHA384_End 152 #define SHA384_Last rb_Digest_SHA384_Last 153 #define SHA384_Transform rb_Digest_SHA384_Transform 154 #define SHA384_Final(d, c) SHA384_Finish(c, d) 156 #define SHA512_Init rb_Digest_SHA512_Init 157 #define SHA512_Update rb_Digest_SHA512_Update 158 #define SHA512_Finish rb_Digest_SHA512_Finish 159 #define SHA512_Data rb_Digest_SHA512_Data 160 #define SHA512_End rb_Digest_SHA512_End 161 #define SHA512_Last rb_Digest_SHA512_Last 162 #define SHA512_Transform rb_Digest_SHA512_Transform 163 #define SHA512_Final(d, c) SHA512_Finish(c, d)
char * SHA384_End(SHA384_CTX *, char[SHA384_DIGEST_STRING_LENGTH])
#define SHA256_DIGEST_STRING_LENGTH
char * SHA512_End(SHA512_CTX *, char[SHA512_DIGEST_STRING_LENGTH])
char * SHA256_End(SHA256_CTX *, char[SHA256_DIGEST_STRING_LENGTH])
#define SHA256_BLOCK_LENGTH
int SHA384_Init(SHA384_CTX *)
struct _SHA512_CTX SHA512_CTX
int SHA512_Init(SHA512_CTX *)
int SHA256_Final(uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX *)
int SHA384_Final(uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX *)
struct _SHA256_CTX SHA256_CTX
unsigned long long uint64_t
void SHA384_Update(SHA384_CTX *, const uint8_t *, size_t)
char * SHA384_Data(const uint8_t *, size_t, char[SHA384_DIGEST_STRING_LENGTH])
int SHA256_Init(SHA256_CTX *)
void SHA512_Update(SHA512_CTX *, const uint8_t *, size_t)
#define SHA384_DIGEST_LENGTH
#define SHA256_DIGEST_LENGTH
int SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX *)
char * SHA512_Data(const uint8_t *, size_t, char[SHA512_DIGEST_STRING_LENGTH])
#define SHA384_DIGEST_STRING_LENGTH
void SHA256_Update(SHA256_CTX *, const uint8_t *, size_t)
#define SHA512_DIGEST_LENGTH
char * SHA256_Data(const uint8_t *, size_t, char[SHA256_DIGEST_STRING_LENGTH])
#define SHA512_BLOCK_LENGTH
uint8_t buffer[SHA256_BLOCK_LENGTH]
#define SHA512_DIGEST_STRING_LENGTH