diff options
author | Carsten Schoenert <c.schoenert@gmail.com> | 2013-11-29 14:19:15 (EST) |
---|---|---|
committer | Paul Barker <paul@paulbarker.me.uk> | 2013-12-17 16:00:36 (EST) |
commit | 6b8be706c08f547d17949f2f72783375bbb8b14c (patch) | |
tree | 7e177d6a719577c6823640db457f833304479cb3 /libopkg/sha256.h | |
parent | fed9b245150a7faa630f7615302c472b7c68ff3e (diff) |
libopkg: cleanup inside the public header files
No functional changes!
Just a cleanup like whitespaces, blank lines, tabs and reformating lines
longer 76 characters.
Also adding the missed comments at the closing bracket from the #ifndef
HEADER_FOO_H ... #endif loop. This helps to identify the associated
preprocessor elements like theay already exits in some files.
Signed-off-by: Carsten Schoenert <c.schoenert@gmail.com>
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
Diffstat (limited to 'libopkg/sha256.h')
-rw-r--r-- | libopkg/sha256.h | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/libopkg/sha256.h b/libopkg/sha256.h index c53277d..858d319 100644 --- a/libopkg/sha256.h +++ b/libopkg/sha256.h @@ -17,7 +17,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SHA256_H -# define SHA256_H 1 +#define SHA256_H # include <stdio.h> # include <stdint.h> @@ -29,14 +29,12 @@ extern "C" { /* Structure to save state of computation between the single steps. */ struct sha256_ctx { - uint32_t state[8]; - - uint32_t total[2]; - uint32_t buflen; - uint32_t buffer[32]; + uint32_t state[8]; + uint32_t total[2]; + uint32_t buflen; + uint32_t buffer[32]; }; - /* Initialize structure containing state of computation. */ extern void sha256_init_ctx (struct sha256_ctx *ctx); extern void sha224_init_ctx (struct sha256_ctx *ctx); @@ -56,7 +54,7 @@ extern void sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx); /* Process the remaining bytes in the buffer and put result from CTX - in first 32 (28) bytes following RESBUF. The result is always in little + in first 32 (28) bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. @@ -65,8 +63,7 @@ extern void sha256_process_bytes (const void *buffer, size_t len, extern void *sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf); extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf); - -/* Put result from CTX in first 32 (28) bytes following RESBUF. The result is +/* Put result from CTX in first 32 (28) bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. @@ -75,14 +72,13 @@ extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf); extern void *sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf); extern void *sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf); - /* Compute SHA256 (SHA224) message digest for bytes read from STREAM. The resulting message digest number will be written into the 32 (28) bytes beginning at RESBLOCK. */ extern int sha256_stream (FILE *stream, void *resblock); extern int sha224_stream (FILE *stream, void *resblock); -/* Compute SHA256 (SHA224) message digest for LEN bytes beginning at BUFFER. The +/* Compute SHA256 (SHA224) message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ @@ -93,4 +89,4 @@ extern void *sha224_buffer (const char *buffer, size_t len, void *resblock); } #endif -#endif +#endif /* SHA256_H */ |