33 #if defined(HAVE_SHA256) || defined(HAVE_SHA224)
41 #define CX_SHA224_SIZE 28
44 #define CX_SHA256_SIZE 32
50 struct cx_hash_header_s header;
56 typedef struct cx_sha256_s cx_sha256_t;
58 #if defined(HAVE_SHA224)
69 cx_err_t cx_sha224_init_no_throw(cx_sha256_t *hash);
79 static inline int cx_sha224_init(cx_sha256_t *hash)
81 cx_sha224_init_no_throw(hash);
97 cx_err_t cx_sha224_hash_iovec(
const cx_iovec_t *iovec,
99 uint8_t digest[
static CX_SHA224_SIZE]);
113 static inline cx_err_t cx_sha224_hash(
const uint8_t *in,
115 uint8_t digest[
static CX_SHA224_SIZE])
119 return cx_sha224_hash_iovec(&iovec, 1, digest);
133 cx_err_t cx_sha256_init_no_throw(cx_sha256_t *hash);
143 static inline int cx_sha256_init(cx_sha256_t *hash)
145 cx_sha256_init_no_throw(hash);
161 cx_err_t cx_sha256_hash_iovec(
const cx_iovec_t *iovec,
163 uint8_t digest[
static CX_SHA256_SIZE]);
177 static inline cx_err_t cx_sha256_hash(
const uint8_t *in,
179 uint8_t digest[
static CX_SHA256_SIZE])
183 return cx_sha256_hash_iovec(&iovec, 1, digest);
199 size_t cx_hash_sha256(
const uint8_t *in,
size_t len,
uint8_t *out,
size_t out_len);
Similar to libc iovec type.