42#define CECIES_MIN(x, y) (((x) < (y)) ? (x) : (y))
47#define CECIES_MAX(x, y) (((x) > (y)) ? (x) : (y))
56 return plaintext_length + 16 - (plaintext_length % 16);
66 return data_length + (data_length >> 12) + (data_length >> 14) + (data_length >> 25) + 13;
78 return 16 + 32 + key_size + 16 + input_buffer_length;
114 return ((4 * data_length / 3 + 3) & ~(
unsigned)3) + 1;
127CECIES_API
int cecies_hexstr2bin(
const char* hexstr,
size_t hexstr_length, uint8_t* output,
size_t output_size,
size_t* output_length);
140CECIES_API
int cecies_bin2hexstr(
const uint8_t* bin,
size_t bin_length,
char* output,
size_t output_size,
size_t* output_length,
int uppercase);
173CECIES_API
extern int (*cecies_fprintf_fptr)(FILE* stream,
const char* format, ...);
186#define cecies_fprintf cecies_fprintf_fptr
197 srand((
unsigned int)time(NULL) * (
unsigned int)time(NULL));
198 return rand() * rand() * rand() * rand();
#define CECIES_X448_KEY_SIZE
Definition: constants.h:63
#define CECIES_X25519_KEY_SIZE
Definition: constants.h:58
CECIES_API int cecies_hexstr2bin(const char *hexstr, size_t hexstr_length, uint8_t *output, size_t output_size, size_t *output_length)
CECIES_API void cecies_enable_fprintf()
static int cecies_printvoid(FILE *stream, const char *format,...)
Definition: util.h:167
CECIES_API int cecies_bin2hexstr(const uint8_t *bin, size_t bin_length, char *output, size_t output_size, size_t *output_length, int uppercase)
static size_t cecies_calc_aes_cbc_ciphertext_length(const size_t plaintext_length)
Definition: util.h:54
CECIES_API void cecies_disable_fprintf()
CECIES_API void cecies_dev_urandom(uint8_t *output_buffer, size_t output_buffer_size)
static size_t cecies_curve448_calc_output_buffer_needed_size(const size_t input_buffer_length)
Definition: util.h:102
static size_t cecies_calc_output_buffer_needed_size(const size_t input_buffer_length, const size_t key_size)
Definition: util.h:75
CECIES_API char * cecies_get_version_str()
CECIES_API uint64_t cecies_get_version_nr()
static size_t cecies_calc_base64_length(const size_t data_length)
Definition: util.h:112
static size_t cecies_calc_compression_bound(const size_t data_length)
Definition: util.h:64
CECIES_API void cecies_free(void *mem)
static size_t cecies_curve25519_calc_output_buffer_needed_size(const size_t input_buffer_length)
Definition: util.h:92
CECIES_API int cecies_is_fprintf_enabled()
static unsigned long long int cecies_get_random_big_integer()
Definition: util.h:195