18 #ifndef __ST_HYPERHASH_SHA256_H
19 #define __ST_HYPERHASH_SHA256_H
37 enum { ST_SHA224_DIGEST_SIZE = 224 / 8 };
38 enum { ST_SHA256_DIGEST_SIZE = 256 / 8 };
41 extern void st_sha256_init_ctx (
struct st_sha256_ctx *ctx);
42 extern void st_sha224_init_ctx (
struct st_sha256_ctx *ctx);
48 extern void st_sha256_process_block (
const void *buffer,
size_t len,
49 struct st_sha256_ctx *ctx);
55 extern void st_sha256_process_bytes (
const void *buffer,
size_t len,
56 struct st_sha256_ctx *ctx);
62 extern void *st_sha256_finish_ctx (
struct st_sha256_ctx *ctx,
void *resbuf);
63 extern void *st_sha224_finish_ctx (
struct st_sha256_ctx *ctx,
void *resbuf);
69 extern void *st_sha256_read_ctx (
const struct st_sha256_ctx *ctx,
void *resbuf);
70 extern void *st_sha224_read_ctx (
const struct st_sha256_ctx *ctx,
void *resbuf);
76 extern int st_sha256_stream (FILE *stream,
void *resblock);
77 extern int st_sha224_stream (FILE *stream,
void *resblock);
83 extern void *st_sha256_buffer (
const char *buffer,
size_t len,
void *resblock);
84 extern void *st_sha224_buffer (
const char *buffer,
size_t len,
void *resblock);
86 std::string sha256sum(
const std::string& str);
90 #endif // __ST_SHA256_H