rephist: Introduce a fraction and period for overload onionskin
[tor.git] / src / lib / crypt_ops / crypto_util.h
blobfb9b3ed6c2b7927c222fe54e48469ff4ee3d9aaa
1 /* Copyright (c) 2001, Matej Pfajfar.
2 * Copyright (c) 2001-2004, Roger Dingledine.
3 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4 * Copyright (c) 2007-2021, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
7 /**
8 * \file crypto_util.h
10 * \brief Common functions for cryptographic routines.
11 **/
13 #ifndef TOR_CRYPTO_UTIL_H
14 #define TOR_CRYPTO_UTIL_H
16 #include "lib/cc/torint.h"
17 #include "lib/malloc/malloc.h"
19 /** OpenSSL-based utility functions. */
20 void memwipe(void *mem, uint8_t byte, size_t sz);
22 void tor_str_wipe_and_free_(char *str);
23 /**
24 * Securely all memory in <b>str</b>, then free it.
26 * As tor_free(), tolerates null pointers, and sets <b>str</b> to NULL.
27 **/
28 #define tor_str_wipe_and_free(str) \
29 FREE_AND_NULL(char, tor_str_wipe_and_free_, (str))
31 #endif /* !defined(TOR_CRYPTO_UTIL_H) */