global initialization of libgcrypt More...
Go to the source code of this file.
Functions | |
| static void * | w_malloc (size_t n) |
| Allocation wrapper for libgcrypt, used to avoid bad locking strategy of libgcrypt implementation. | |
| static int | w_check (const void *p) |
| Allocation wrapper for libgcrypt, used to avoid bad locking strategy of libgcrypt implementation. | |
| void | GNUNET_CRYPTO_gcrypt_init (void) |
| void | __attribute__ ((constructor)) |
| Initialize libgcrypt. | |
| void | GNUNET_CRYPTO_gcrypt_fini (void) |
| void | __attribute__ ((destructor)) |
| Nicely shut down libgcrypt. | |
global initialization of libgcrypt
Randomness generation is done with libsodium (see crypto_random.c), but ECC, RSA, CS, KDF, Paillier and the symmetric primitives still use libgcrypt. libgcrypt requires that gcry_check_version() runs before any other libgcrypt function; most entry points paper over a missing initialization by initializing themselves lazily, but some do not. gcry_mpi_const() – what GCRYMPI_CONST_ONE and friends expand to – calls log_bug() and aborts the process with "MPI subsystem not initialized" instead.
Hence this file, whose only job is to run that global bootstrap from a library constructor. Keep it free of anything else.
Definition in file crypto_gcrypt.c.
|
static |
Allocation wrapper for libgcrypt, used to avoid bad locking strategy of libgcrypt implementation.
Definition at line 50 of file crypto_gcrypt.c.
Referenced by __attribute__().
|
static |
Allocation wrapper for libgcrypt, used to avoid bad locking strategy of libgcrypt implementation.
Definition at line 61 of file crypto_gcrypt.c.
References p.
Referenced by __attribute__().
| void GNUNET_CRYPTO_gcrypt_init | ( | void | ) |
| void __attribute__ | ( | (constructor) | ) |
Initialize libgcrypt.
Definition at line 74 of file crypto_gcrypt.c.
References _, GNUNET_assert, w_check(), and w_malloc().
| void GNUNET_CRYPTO_gcrypt_fini | ( | void | ) |
| void __attribute__ | ( | (destructor) | ) |
Nicely shut down libgcrypt.
Definition at line 112 of file crypto_gcrypt.c.