GNU libmicrohttpd  1.0.1
sha256_ext.h
Go to the documentation of this file.
1 /*
2  This file is part of GNU libmicrohttpd
3  Copyright (C) 2022 Evgeny Grin (Karlson2k)
4 
5  GNU libmicrohttpd is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with GNU libmicrohttpd.
17  If not, see <http://www.gnu.org/licenses/>.
18 */
19 
26 #ifndef MHD_SHA256_EXT_H
27 #define MHD_SHA256_EXT_H 1
28 
29 #include "mhd_options.h"
30 #include <stdint.h>
31 #ifdef HAVE_STDDEF_H
32 #include <stddef.h> /* for size_t */
33 #endif /* HAVE_STDDEF_H */
34 
39 #define SHA256_DIGEST_SIZE (32)
40 
41 /* Actual declaration is in GnuTLS lib header */
42 struct hash_hd_st;
43 
47 #define MHD_SHA256_HAS_EXT_ERROR 1
48 
53 {
54  struct hash_hd_st *handle;
55  int ext_error;
56 };
57 
61 #define MHD_SHA256_HAS_INIT_ONE_TIME 1
62 
70 void
72 
73 
81 void
82 MHD_SHA256_update (struct Sha256CtxExt *ctx,
83  const uint8_t *data,
84  size_t length);
85 
86 
90 #define MHD_SHA256_HAS_FINISH_RESET 1
91 
98 void
100  uint8_t digest[SHA256_DIGEST_SIZE]);
101 
105 #define MHD_SHA256_HAS_DEINIT 1
106 
112 void
113 MHD_SHA256_deinit (struct Sha256CtxExt *ctx);
114 
115 #endif /* MHD_SHA256_EXT_H */
additional automatic macros for MHD_config.h
void * data
Definition: microhttpd.h:3968
void MHD_SHA256_deinit(struct Sha256CtxExt *ctx)
Definition: sha256_ext.c:97
void MHD_SHA256_finish_reset(struct Sha256CtxExt *ctx, uint8_t digest[SHA256_DIGEST_SIZE])
Definition: sha256_ext.c:83
#define SHA256_DIGEST_SIZE
Definition: sha256_ext.h:39
void MHD_SHA256_update(struct Sha256CtxExt *ctx, const uint8_t *data, size_t length)
Definition: sha256_ext.c:67
void MHD_SHA256_init_one_time(struct Sha256CtxExt *ctx)
Definition: sha256_ext.c:39
struct hash_hd_st * handle
Definition: sha256_ext.h:54