JabberWerxC  2015.1.1
sha1.h
Go to the documentation of this file.
1 
13 #ifndef JABBERWERX_CRYPTO_SHA1_H
14 #define JABBERWERX_CRYPTO_SHA1_H
15 
16 #include "../basics.h"
17 
18 
20 #define JW_SHA1_HASH_SIZE 20
21 
22 
24 typedef struct _jw_sha1_ctx_int jw_sha1_ctx;
25 
27 typedef struct _jw_hmac_sha1_ctx_int jw_hmac_sha1_ctx;
28 
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
34 
70 JABBERWERX_API bool jw_sha1(const uint8_t *input,
71  size_t input_len,
72  uint8_t **output,
73  size_t *output_len,
74  jw_err *err);
75 
88  jw_err *err);
96 
105 
123  const uint8_t *input,
124  size_t len,
125  jw_err *err);
126 
148  uint8_t **output,
149  size_t *output_len,
150  jw_err *err);
151 
187 JABBERWERX_API bool jw_hmac_sha1(const uint8_t *input,
188  size_t input_len,
189  const uint8_t *key,
190  size_t key_len,
191  uint8_t **output,
192  size_t *output_len,
193  jw_err *err);
194 
208 JABBERWERX_API bool jw_hmac_sha1_create(const uint8_t *key,
209  size_t key_len,
210  jw_hmac_sha1_ctx **ctx,
211  jw_err *err);
212 
220 
232  const uint8_t *key,
233  size_t key_len,
234  jw_err *err);
235 
251  const uint8_t *input,
252  size_t len,
253  jw_err *err);
254 
276  uint8_t **output,
277  size_t *output_len,
278  jw_err *err);
279 
280 #ifdef __cplusplus
281 }
282 #endif
283 
284 #endif /* JABBERWERX_CRYPTO_SHA1_H */
struct _jw_hmac_sha1_ctx_int jw_hmac_sha1_ctx
Definition: sha1.h:27
JABBERWERX_API bool jw_sha1(const uint8_t *input, size_t input_len, uint8_t **output, size_t *output_len, jw_err *err)
#define JABBERWERX_API
Definition: basics.h:32
JABBERWERX_API bool jw_hmac_sha1_result(jw_hmac_sha1_ctx *ctx, uint8_t **output, size_t *output_len, jw_err *err)
JABBERWERX_API bool jw_hmac_sha1_input(jw_hmac_sha1_ctx *ctx, const uint8_t *input, size_t len, jw_err *err)
JABBERWERX_API bool jw_sha1_result(jw_sha1_ctx *ctx, uint8_t **output, size_t *output_len, jw_err *err)
JABBERWERX_API void jw_hmac_sha1_destroy(jw_hmac_sha1_ctx *ctx)
JABBERWERX_API bool jw_hmac_sha1(const uint8_t *input, size_t input_len, const uint8_t *key, size_t key_len, uint8_t **output, size_t *output_len, jw_err *err)
JABBERWERX_API bool jw_sha1_input(jw_sha1_ctx *ctx, const uint8_t *input, size_t len, jw_err *err)
JABBERWERX_API bool jw_hmac_sha1_reset(jw_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len, jw_err *err)
Definition: basics.h:157
struct _jw_sha1_ctx_int jw_sha1_ctx
Definition: sha1.h:24
JABBERWERX_API bool jw_sha1_create(jw_sha1_ctx **ctx, jw_err *err)
JABBERWERX_API jw_sha1_ctx * jw_sha1_reset(jw_sha1_ctx *ctx)
JABBERWERX_API bool jw_hmac_sha1_create(const uint8_t *key, size_t key_len, jw_hmac_sha1_ctx **ctx, jw_err *err)
JABBERWERX_API void jw_sha1_destroy(jw_sha1_ctx *ctx)