CJOSE  0.6.0
util.h
Go to the documentation of this file.
1 /*
2  * Copyrights
3  *
4  * Portions created or assigned to Cisco Systems, Inc. are
5  * Copyright (c) 2014-2016 Cisco Systems, Inc. All Rights Reserved.
6  */
7 
14 #ifndef CJOSE_UTIL_H
15 #define CJOSE_UTIL_H
16 
17 #include <stddef.h>
18 #include <stdint.h>
19 #include <stdbool.h>
20 
21 #include <openssl/rsa.h>
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #define CJOSE_OPENSSL_11X OPENSSL_VERSION_NUMBER >= 0x10100005L && !defined(LIBRESSL_VERSION_NUMBER)
28 
33 #define CJOSE_UNUSED_PARAM(x) (void)(x)
34 
38 typedef void *(*cjose_alloc_fn_t)(size_t);
42 typedef void *(*cjose_alloc3_fn_t)(size_t, const char *, int);
43 
47 typedef void *(*cjose_realloc_fn_t)(void *, size_t);
51 typedef void *(*cjose_realloc3_fn_t)(void *, size_t, const char *, int);
52 
56 typedef void (*cjose_dealloc_fn_t)(void *);
60 typedef void (*cjose_dealloc3_fn_t)(void *, const char *, int);
61 
80 
103 
111 
121 
129 
139 
147 
157 
168 int cjose_const_memcmp(const uint8_t *a, const uint8_t *b, const size_t size);
169 
170 #ifdef __cplusplus
171 }
172 #endif
173 
174 #endif // CJOSE_UTIL_H
cjose_realloc3_fn_t cjose_get_realloc3()
void cjose_set_alloc_ex_funcs(cjose_alloc3_fn_t alloc3, cjose_realloc3_fn_t realloc3, cjose_dealloc3_fn_t dealloc3)
void cjose_set_alloc_funcs(cjose_alloc_fn_t alloc, cjose_realloc_fn_t realloc, cjose_dealloc_fn_t dealloc)
int cjose_const_memcmp(const uint8_t *a, const uint8_t *b, const size_t size)
void *(* cjose_realloc_fn_t)(void *, size_t)
Definition: util.h:47
cjose_realloc_fn_t cjose_get_realloc()
void *(* cjose_realloc3_fn_t)(void *, size_t, const char *, int)
Definition: util.h:51
cjose_dealloc3_fn_t cjose_get_dealloc3()
void(* cjose_dealloc3_fn_t)(void *, const char *, int)
Definition: util.h:60
cjose_alloc_fn_t cjose_get_alloc()
cjose_alloc3_fn_t cjose_get_alloc3()
cjose_dealloc_fn_t cjose_get_dealloc()
void *(* cjose_alloc3_fn_t)(size_t, const char *, int)
Definition: util.h:42
void *(* cjose_alloc_fn_t)(size_t)
Definition: util.h:38
void(* cjose_dealloc_fn_t)(void *)
Definition: util.h:56