*/
struct sha256 {
union {
- /* Array of chars */
- unsigned char u8[32];
- /* Array of uint32_t */
uint32_t u32[8];
+ unsigned char u8[32];
} u;
};
SHA256_CTX c;
#else
uint32_t s[8];
- uint64_t bytes;
union {
- uint32_t u32[8];
+ uint32_t u32[16];
unsigned char u8[64];
} buf;
+ size_t bytes;
#endif
};
/**
* SHA256_INIT - initializer for an SHA256 context.
*
- * This can be used to staticly initialize an SHA256 context (instead
+ * This can be used to statically initialize an SHA256 context (instead
* of sha256_init()).
*
* Example:
#else
#define SHA256_INIT \
{ { 0x6a09e667ul, 0xbb67ae85ul, 0x3c6ef372ul, 0xa54ff53aul, \
- 0x510e527ful, 0x9b05688cul, 0x1f83d9abul, 0x5be0cd19ul }, 0 }
+ 0x510e527ful, 0x9b05688cul, 0x1f83d9abul, 0x5be0cd19ul }, \
+ { { 0 } }, 0 }
#endif
/**