X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcrypto%2Fsha256%2Fsha256.h;h=9a310b9564c6be7bfcaca90a718d280788f303c7;hb=e5fb923ba3735c758ef795eb69d5ee1c6f0a94e9;hp=d8b683ecee3747a2081592a8e0b624e3c2b8d98e;hpb=8bede7d6e3f363151cb680cfc44b59e6a7d13b23;p=ccan diff --git a/ccan/crypto/sha256/sha256.h b/ccan/crypto/sha256/sha256.h index d8b683ec..9a310b95 100644 --- a/ccan/crypto/sha256/sha256.h +++ b/ccan/crypto/sha256/sha256.h @@ -21,10 +21,8 @@ */ struct sha256 { union { - /* Array of chars */ - unsigned char u8[32]; - /* Array of uint32_t */ uint32_t u32[8]; + unsigned char u8[32]; } u; }; @@ -47,11 +45,11 @@ struct sha256_ctx { 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 }; @@ -106,7 +104,8 @@ void sha256_init(struct sha256_ctx *ctx); #else #define SHA256_INIT \ { { 0x6a09e667ul, 0xbb67ae85ul, 0x3c6ef372ul, 0xa54ff53aul, \ - 0x510e527ful, 0x9b05688cul, 0x1f83d9abul, 0x5be0cd19ul }, 0 } + 0x510e527ful, 0x9b05688cul, 0x1f83d9abul, 0x5be0cd19ul }, \ + { { 0 } }, 0 } #endif /**