Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksejs Sestakovs <aleksejs.sestakovs@zabbix.com>2021-07-14 10:34:58 +0300
committerAleksejs Sestakovs <aleksejs.sestakovs@zabbix.com>2021-07-14 10:34:58 +0300
commitff0282bd2302a665d0d44c19a98ec096ddebfb8f (patch)
tree6d8209e297dff3e6ed3f22feb55e23588de82d83 /include/sha256crypt.h
parentdb65bcf7e0fa18bb754911789d5f78ced44cdfb7 (diff)
...G...... [ZBXNEXT-6688,ZBXNEXT-6704,ZBXNEXT-2112] added vfs.file.get and updated vfs.file.cksum items for Agent
Diffstat (limited to 'include/sha256crypt.h')
-rw-r--r--include/sha256crypt.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/sha256crypt.h b/include/sha256crypt.h
index 7a1842912e2..540e92dd25c 100644
--- a/include/sha256crypt.h
+++ b/include/sha256crypt.h
@@ -20,8 +20,23 @@
#ifndef ZABBIX_SHA256CRYPT_H
#define ZABBIX_SHA256CRYPT_H
+#include "common.h"
+
#define ZBX_SHA256_DIGEST_SIZE 32
+/* Structure to save state of computation between the single steps. */
+typedef struct
+{
+ uint32_t H[8];
+
+ uint32_t total[2];
+ uint32_t buflen;
+ char buffer[128]; /* NB: always correctly aligned for uint32_t. */
+} sha256_ctx;
+
+void zbx_sha256_init_ctx (sha256_ctx *ctx);
+void zbx_sha256_process_bytes(const void *buffer, size_t len, sha256_ctx *ctx);
+void *zbx_sha256_finish_ctx (sha256_ctx *ctx, void *resbuf);
void zbx_sha256_hash(const char *in, char *out);
#endif /* ZABBIX_SHA256CRYPT_H */