X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fcrypto%2Fsha256%2Fsha256.h;h=9a310b9564c6be7bfcaca90a718d280788f303c7;hp=1297c41f48f0fabbc9bfda41c9dd93627e0c1858;hb=61aead95bb68f33d7f38998f0e8ff7c81141f99f;hpb=1968f4d42a71c3b2d809981228dc6bbc5760ccf5 diff --git a/ccan/crypto/sha256/sha256.h b/ccan/crypto/sha256/sha256.h index 1297c41f..9a310b95 100644 --- a/ccan/crypto/sha256/sha256.h +++ b/ccan/crypto/sha256/sha256.h @@ -6,7 +6,7 @@ #include /* Uncomment this to use openssl's SHA256 routines (and link with -lcrypto) */ -//#define CCAN_CRYPTO_SHA256_USE_OPENSSL 1 +/*#define CCAN_CRYPTO_SHA256_USE_OPENSSL 1*/ #ifdef CCAN_CRYPTO_SHA256_USE_OPENSSL #include @@ -45,11 +45,11 @@ struct sha256_ctx { SHA256_CTX c; #else uint32_t s[8]; - uint64_t bytes; union { uint32_t u32[16]; unsigned char u8[64]; } buf; + size_t bytes; #endif }; @@ -80,7 +80,7 @@ void sha256_init(struct sha256_ctx *ctx); /** * 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: @@ -104,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 /**