33#define LOG(kind, ...) GNUNET_log_from (kind, "util-crypto-mpi", __VA_ARGS__)
40#define LOG_GCRY(level, cmd, rc) do { LOG (level, _ ( \
41 "`%s' failed at %s:%d with error: %s\n"), \
42 cmd, __FILE__, __LINE__, \
43 gcry_strerror (rc)); } while (0)
64 memset (buf, 0, target -
size);
86 if (gcry_mpi_get_flag (val, GCRYMPI_FLAG_OPAQUE))
92 p = gcry_mpi_get_opaque (val, &nbits);
94 rsize = (nbits + 7) / 8;
99 memset (buf + rsize, 0,
size - rsize);
107 (rc = gcry_mpi_print (GCRYMPI_FMT_USG,
138 if (0 != (rc = gcry_mpi_scan (
result,
#define LOG_GCRY(level, cmd, rc)
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the mess...
static void adjust(void *buf, size_t size, size_t target)
If target != size, move target bytes to the end of the size-sized buffer and zero out the first targe...
static char * data
The data to insert into the dht.
static int result
Global testing status.
static struct GNUNET_OS_Process * p
Helper process we started.
void GNUNET_CRYPTO_mpi_scan_unsigned(gcry_mpi_t *result, const void *data, size_t size)
Convert data buffer into MPI value.
void GNUNET_CRYPTO_mpi_print_unsigned(void *buf, size_t size, gcry_mpi_t val)
Output the given MPI value to the given buffer in network byte order.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
@ GNUNET_ERROR_TYPE_ERROR
static unsigned int size
Size of the "table".