From f7f7332afafd4f965c5ef1d45cc1c7da9275c6ef Mon Sep 17 00:00:00 2001 From: David Timber Date: Mon, 14 Sep 2020 15:47:30 +0930 Subject: * Add "--enable-static" configure option * Change "PRNE_DEBUG" macro use * Add "PRNE_VERBOSE" * Impl "recon" * Add "inet.h" for Internet Protocol stuff * Changes regarding "PRNE_RND_WELL512_SEEDLEN" * Add prne_own_realloc() for objects with multiple array memebers * Add prne_add_timespec() --- src/util_rt.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/util_rt.h') diff --git a/src/util_rt.h b/src/util_rt.h index f44e4ae..3d94bf5 100644 --- a/src/util_rt.h +++ b/src/util_rt.h @@ -30,6 +30,13 @@ char *prne_alloc_str (const size_t len); void prne_free (void *ptr); size_t prne_getpagesize (void); +bool prne_own_realloc ( + void **p, + bool *ownership, + const size_t se, + size_t *old, + const size_t req); + bool prne_nstreq (const char *a, const char *b); size_t prne_nstrlen (const char *s); void prne_rnd_anum_str (mbedtls_ctr_drbg_context *rnd, char *str, const size_t len); @@ -43,6 +50,7 @@ void prne_hex_tochar (const uint_fast8_t in, char *out, const bool upper); bool prne_uuid_fromstr (const char *str, uint8_t *out); void prne_uuid_tostr (const uint8_t *in, char *out); +struct timespec prne_add_timespec (const struct timespec a, const struct timespec b); struct timespec prne_sub_timespec (const struct timespec a, const struct timespec b); double prne_real_timespec (const struct timespec ts); struct timespec prne_ms_timespec (const long ms); @@ -59,3 +67,18 @@ bool prne_dec_base64_mem (const char *str, const size_t str_len, uint8_t **data, // getrandom polyfill ssize_t prne_geturandom (void *buf, const size_t len); + +void prne_bitop_and ( + const uint8_t *a, + const uint8_t *b, + uint8_t *c, + const size_t len); +void prne_bitop_or ( + const uint8_t *a, + const uint8_t *b, + uint8_t *c, + const size_t len); +void prne_bitop_inv ( + const uint8_t *x, + uint8_t *y, + const size_t len); -- cgit