summaryrefslogtreecommitdiffstats
path: root/src/crypto/digest/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/digest/internal.h')
-rw-r--r--src/crypto/digest/internal.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/crypto/digest/internal.h b/src/crypto/digest/internal.h
index 94dbfaa..1572fa8 100644
--- a/src/crypto/digest/internal.h
+++ b/src/crypto/digest/internal.h
@@ -75,15 +75,14 @@ struct env_md_st {
/* flags contains the OR of |EVP_MD_FLAG_*| values. */
uint32_t flags;
- /* init initialises the state in |ctx->md_data|. It returns one on success
- * and zero otherwise. */
- int (*init)(EVP_MD_CTX *ctx);
+ /* init initialises the state in |ctx->md_data|. */
+ void (*init)(EVP_MD_CTX *ctx);
/* update hashes |len| bytes of |data| into the state in |ctx->md_data|. */
- int (*update)(EVP_MD_CTX *ctx, const void *data, size_t count);
+ void (*update)(EVP_MD_CTX *ctx, const void *data, size_t count);
/* final completes the hash and writes |md_size| bytes of digest to |out|. */
- int (*final)(EVP_MD_CTX *ctx, uint8_t *out);
+ void (*final)(EVP_MD_CTX *ctx, uint8_t *out);
/* block_size contains the hash's native block size. */
unsigned block_size;
@@ -109,6 +108,17 @@ struct evp_md_pctx_ops {
int (*begin_digest) (EVP_MD_CTX *ctx);
};
+/* EVP_MD_CTX_set_flags ORs |flags| into the flags member of |ctx|. */
+OPENSSL_EXPORT void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, uint32_t flags);
+
+/* EVP_MD_CTX_FLAG_NO_INIT causes the |EVP_MD|'s |init| function not to be
+ * called, the |update| member not to be copied from the |EVP_MD| in
+ * |EVP_DigestInit_ex| and for |md_data| not to be initialised.
+ *
+ * TODO(davidben): This is an implementation detail of |EVP_PKEY_HMAC| and can
+ * be removed when it is gone. */
+#define EVP_MD_CTX_FLAG_NO_INIT 1
+
#if defined(__cplusplus)
} /* extern C */