34#define LOG(kind, ...) GNUNET_log_from (kind, "util-crypto-kdf", __VA_ARGS__)
72 va_start (argp, skm_len);
89 const void *xts,
size_t xts_len,
90 const void *skm,
size_t skm_len,
98 nbits = gcry_mpi_get_nbits (n);
104 size_t bsize = (nbits - 1) / 8 + 1;
106 uint16_t ctr_nbo = htons (ctr);
113 &ctr_nbo,
sizeof(ctr_nbo),
116 rc = gcry_mpi_scan (r,
118 (
const unsigned char *) buf,
123 gcry_mpi_clear_highbit (*r,
126 gcry_mpi_test_bit (*r,
130 if (0 > gcry_mpi_cmp (*r, n))
132 gcry_mpi_release (*r);
static int ret
Final status code.
static struct GNUNET_FS_Handle * ctx
static int result
Global testing status.
static unsigned int bsize
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_hkdf_gnunet_v(void *result, size_t out_len, const void *xts, size_t xts_len, const void *skm, size_t skm_len, va_list argp)
Derive key.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_kdf(void *result, size_t out_len, const void *xts, size_t xts_len, const void *skm, size_t skm_len,...)
Derive key.
void GNUNET_CRYPTO_kdf_mod_mpi(gcry_mpi_t *r, gcry_mpi_t n, const void *xts, size_t xts_len, const void *skm, size_t skm_len, const char *ctx)
Deterministically generate a pseudo-random number uniformly from the integers modulo a libgcrypt mpi.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_kdf_v(void *result, size_t out_len, const void *xts, size_t xts_len, const void *skm, size_t skm_len, va_list argp)
Derive key.
GNUNET_GenericReturnValue
Named constants for return values.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.