GNUnet  0.11.x
Macros | Functions
Crypto library: hash operations

Provides hashing and operations on hashes. More...

Macros

#define GNUNET_CRYPTO_hash_from_string(enc, result)   GNUNET_CRYPTO_hash_from_string2 (enc, strlen (enc), result)
 Convert ASCII encoding back to struct GNUNET_HashCode More...
 

Functions

uint8_t GNUNET_CRYPTO_crc8_n (const void *buf, size_t len)
 Calculate the checksum of a buffer in one step. More...
 
uint16_t GNUNET_CRYPTO_crc16_n (const void *buf, size_t len)
 Calculate the checksum of a buffer in one step. More...
 
int32_t GNUNET_CRYPTO_crc32_n (const void *buf, size_t len)
 Compute the CRC32 checksum for the first len bytes of the buffer. More...
 
void GNUNET_CRYPTO_hash_to_enc (const struct GNUNET_HashCode *block, struct GNUNET_CRYPTO_HashAsciiEncoded *result)
 Convert hash to ASCII encoding. More...
 
int GNUNET_CRYPTO_hash_from_string2 (const char *enc, size_t enclen, struct GNUNET_HashCode *result)
 Convert ASCII encoding back to a 'struct GNUNET_HashCode'. More...
 
uint32_t GNUNET_CRYPTO_hash_distance_u32 (const struct GNUNET_HashCode *a, const struct GNUNET_HashCode *b)
 Compute the distance between 2 hashcodes. More...
 
void GNUNET_CRYPTO_hash (const void *block, size_t size, struct GNUNET_HashCode *ret)
 Compute hash of a given block. More...
 
void GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, const void *plaintext, size_t plaintext_len, struct GNUNET_HashCode *hmac)
 Calculate HMAC of a message (RFC 2104) More...
 
struct GNUNET_CRYPTO_FileHashContextGNUNET_CRYPTO_hash_file (enum GNUNET_SCHEDULER_Priority priority, const char *filename, size_t blocksize, GNUNET_CRYPTO_HashCompletedCallback callback, void *callback_cls)
 Compute the hash of an entire file. More...
 
void GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, struct GNUNET_HashCode *result)
 Create a random hash code. More...
 
void GNUNET_CRYPTO_hash_difference (const struct GNUNET_HashCode *a, const struct GNUNET_HashCode *b, struct GNUNET_HashCode *result)
 compute result = b - a More...
 
void GNUNET_CRYPTO_hash_sum (const struct GNUNET_HashCode *a, const struct GNUNET_HashCode *delta, struct GNUNET_HashCode *result)
 compute result = a + delta More...
 
void GNUNET_CRYPTO_hash_xor (const struct GNUNET_HashCode *a, const struct GNUNET_HashCode *b, struct GNUNET_HashCode *result)
 compute result = a ^ b More...
 
void GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode *hc, struct GNUNET_CRYPTO_SymmetricSessionKey *skey, struct GNUNET_CRYPTO_SymmetricInitializationVector *iv)
 Convert a hashcode into a key. More...
 
int GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode *code, unsigned int bit)
 Obtain a bit from a hashcode. More...
 
unsigned int GNUNET_CRYPTO_hash_matching_bits (const struct GNUNET_HashCode *first, const struct GNUNET_HashCode *second)
 Determine how many low order bits match in two struct GNUNET_HashCodes. More...
 
int GNUNET_CRYPTO_hash_cmp (const struct GNUNET_HashCode *h1, const struct GNUNET_HashCode *h2)
 Compare function for HashCodes, producing a total ordering of all hashcodes. More...
 
int GNUNET_CRYPTO_hash_xorcmp (const struct GNUNET_HashCode *h1, const struct GNUNET_HashCode *h2, const struct GNUNET_HashCode *target)
 Find out which of the two GNUNET_CRYPTO_hash codes is closer to target in the XOR metric (Kademlia). More...
 
void GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey, const void *salt, size_t salt_len, va_list argp)
 Derive an authentication key. More...
 
void GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey, const void *salt, size_t salt_len,...)
 Derive an authentication key. More...
 
int GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, int prf_algo, const void *xts, size_t xts_len, const void *skm, size_t skm_len,...)
 Derive key. More...
 
int GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, int prf_algo, const void *xts, size_t xts_len, const void *skm, size_t skm_len, va_list argp)
 Derive key. More...
 
int 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. More...
 

Detailed Description

Provides hashing and operations on hashes.

See also
Documentation

Macro Definition Documentation

◆ GNUNET_CRYPTO_hash_from_string

#define GNUNET_CRYPTO_hash_from_string (   enc,
  result 
)    GNUNET_CRYPTO_hash_from_string2 (enc, strlen (enc), result)

Convert ASCII encoding back to struct GNUNET_HashCode

Parameters
encthe encoding
resultwhere to store the hash code
Returns
GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding

Definition at line 622 of file gnunet_crypto_lib.h.

Referenced by database_setup(), run(), uri_chk_parse(), and uri_loc_parse().

Function Documentation

◆ GNUNET_CRYPTO_crc8_n()

uint8_t GNUNET_CRYPTO_crc8_n ( const void *  buf,
size_t  len 
)

Calculate the checksum of a buffer in one step.

Parameters
bufbuffer to calculate CRC over
lennumber of bytes in buf
Returns
crc8 value

Definition at line 179 of file crypto_crc.c.

References buf, and data.

181 {
182  const uint8_t *data = buf;
183  unsigned int crc = 0;
184  int i;
185  int j;
186 
187  for (j = len; 0 != j; j--)
188  {
189  crc ^= (*data++ << 8);
190  for (i = 8; 0 != i; i--)
191  {
192  if (0 != (crc & 0x8000))
193  crc ^= (0x1070 << 3);
194  crc <<= 1;
195  }
196  }
197  return (uint8_t) (crc >> 8);
198 }
static char buf[2048]
uint32_t data
The data value.
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...

◆ GNUNET_CRYPTO_crc16_n()

uint16_t GNUNET_CRYPTO_crc16_n ( const void *  buf,
size_t  len 
)

Calculate the checksum of a buffer in one step.

Parameters
bufbuffer to calculate CRC over (must be 16-bit aligned)
lennumber of bytes in buf, must be multiple of 2
Returns
crc16 value
Parameters
bufbuffer to calculate CRC over (must be 16-bit aligned)
lennumber of bytes in hdr, must be multiple of 2
Returns
crc16 value

Definition at line 161 of file crypto_crc.c.

References buf, GNUNET_CRYPTO_crc16_finish(), and GNUNET_CRYPTO_crc16_step().

Referenced by GNUNET_TUN_initialize_ipv4_header().

162 {
163  const uint16_t *hdr = buf;
164  uint32_t sum = GNUNET_CRYPTO_crc16_step (0, hdr, len);
165 
166  return GNUNET_CRYPTO_crc16_finish (sum);
167 }
static char buf[2048]
uint32_t GNUNET_CRYPTO_crc16_step(uint32_t sum, const void *buf, size_t len)
Perform an incremental step in a CRC16 (for TCP/IP) calculation.
Definition: crypto_crc.c:125
uint16_t GNUNET_CRYPTO_crc16_finish(uint32_t sum)
Convert results from GNUNET_CRYPTO_crc16_step() to final crc16.
Definition: crypto_crc.c:144
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_crc32_n()

int32_t GNUNET_CRYPTO_crc32_n ( const void *  buf,
size_t  len 
)

Compute the CRC32 checksum for the first len bytes of the buffer.

Parameters
bufthe data over which we're taking the CRC
lenthe length of the buffer buf in bytes
Returns
the resulting CRC32 checksum
Parameters
bufthe data over which we're taking the CRC
lenthe length of the buffer
Returns
the resulting CRC32 checksum

Definition at line 106 of file crypto_crc.c.

References crc32(), and Z_NULL.

Referenced by do_decrypt(), do_encrypt(), ibf_get_indices(), process_data(), and wlan_plugin_send().

107 {
108  GNUNET_uLong crc;
109 
110  crc = crc32 (0L, Z_NULL, 0);
111  crc = crc32 (crc, (char *) buf, len);
112  return crc;
113 }
#define Z_NULL
Definition: crypto_crc.c:44
static char buf[2048]
static GNUNET_uLong crc32(GNUNET_uLong crc, const char *buf, size_t len)
Definition: crypto_crc.c:87
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hash_to_enc()

void GNUNET_CRYPTO_hash_to_enc ( const struct GNUNET_HashCode block,
struct GNUNET_CRYPTO_HashAsciiEncoded result 
)

Convert hash to ASCII encoding.

Parameters
blockthe hash code
resultwhere to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be safely cast to char*, a '\0' termination is set).

Convert hash to ASCII encoding.

The ASCII encoding is rather GNUnet specific. It was chosen such that it only uses characters in [0-9A-V], can be produced without complex arithmetics and uses a small number of characters. The GNUnet encoding uses 103 characters plus a null terminator.

Parameters
blockthe hash code
resultwhere to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be safely cast to char*, a '\0' termination is set).

Definition at line 73 of file crypto_hash.c.

References GNUNET_assert, and GNUNET_STRINGS_data_to_string().

Referenced by get_update_information_directory(), GNUNET_e2s(), GNUNET_e2s2(), GNUNET_h2s(), GNUNET_h2s2(), GNUNET_h2s_full(), GNUNET_NETWORK_shorten_unixpath(), GNUNET_p2s(), GNUNET_p2s2(), store_and_free_entries(), uri_chk_to_string(), and uri_loc_to_string().

75 {
76  char *np;
77 
78  np = GNUNET_STRINGS_data_to_string ((const unsigned char *) block,
79  sizeof(struct GNUNET_HashCode),
80  (char *) result,
81  sizeof(struct
83  - 1);
84  GNUNET_assert (NULL != np);
85  *np = '\0';
86 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
A 512-bit hashcode.
0-terminated ASCII encoding of a struct GNUNET_HashCode.
char * GNUNET_STRINGS_data_to_string(const void *data, size_t size, char *out, size_t out_size)
Convert binary data to ASCII encoding using CrockfordBase32.
Definition: strings.c:856
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hash_from_string2()

int GNUNET_CRYPTO_hash_from_string2 ( const char *  enc,
size_t  enclen,
struct GNUNET_HashCode result 
)

Convert ASCII encoding back to a 'struct GNUNET_HashCode'.

Parameters
encthe encoding
enclennumber of characters in enc (without 0-terminator, which can be missing)
resultwhere to store the hash code
Returns
GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding

Convert ASCII encoding back to a 'struct GNUNET_HashCode'.

Parameters
encthe encoding
enclennumber of characters in enc (without 0-terminator, which can be missing)
resultwhere to store the hash code
Returns
GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding

Definition at line 98 of file crypto_hash.c.

References GNUNET_STRINGS_string_to_data(), and GNUNET_STRINGS_utf8_toupper().

101 {
102  char upper_enc[enclen];
103  char *up_ptr = upper_enc;
104 
106 
107  return GNUNET_STRINGS_string_to_data (upper_enc, enclen,
108  (unsigned char*) result,
109  sizeof(struct GNUNET_HashCode));
110 }
void GNUNET_STRINGS_utf8_toupper(const char *input, char *output)
Convert the utf-8 input string to upper case.
Definition: strings.c:578
A 512-bit hashcode.
static OpusEncoder * enc
OPUS encoder.
int GNUNET_STRINGS_string_to_data(const char *enc, size_t enclen, void *out, size_t out_size)
Convert CrockfordBase32 encoding back to data.
Definition: strings.c:952
Here is the call graph for this function:

◆ GNUNET_CRYPTO_hash_distance_u32()

unsigned int GNUNET_CRYPTO_hash_distance_u32 ( const struct GNUNET_HashCode a,
const struct GNUNET_HashCode b 
)

Compute the distance between 2 hashcodes.

The computation must be fast, not involve a[0] or a[4] (they're used elsewhere), and be somewhat consistent. And of course, the result should be a positive number.

Parameters
asome hash code
bsome hash code
Returns
number between 0 and UINT32_MAX

The computation must be fast, not involve bits[0] or bits[4] (they're used elsewhere), and be somewhat consistent. And of course, the result should be a positive number.

Parameters
asome hash code
bsome hash code
Returns
a positive number which is a measure for hashcode proximity.

Definition at line 127 of file crypto_hash.c.

References GNUNET_HashCode::bits.

Referenced by score_content().

129 {
130  unsigned int x1 = (a->bits[1] - b->bits[1]) >> 16;
131  unsigned int x2 = (b->bits[1] - a->bits[1]) >> 16;
132 
133  return(x1 * x2);
134 }
uint32_t bits[512/8/sizeof(uint32_t)]
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hash()

void GNUNET_CRYPTO_hash ( const void *  block,
size_t  size,
struct GNUNET_HashCode ret 
)

Compute hash of a given block.

Parameters
blockthe data to hash
sizesize of the block
retpointer to where to write the hashcode

Compute hash of a given block.

Parameters
blockthe data to GNUNET_CRYPTO_hash, length is given as a second argument
sizethe length of the data to GNUNET_CRYPTO_hash in block
retpointer to where to write the hashcode

Definition at line 48 of file crypto_hash.c.

References BENCHMARK_END, and BENCHMARK_START.

Referenced by add_file(), add_known_to_bloom(), add_to_keyword_counter(), add_to_meta_counter(), advertise_dns_exit(), automaton_create_proofs(), block_plugin_dht_evaluate(), block_plugin_dns_evaluate(), block_plugin_fs_evaluate(), block_plugin_fs_get_key(), block_plugin_gns_evaluate(), block_plugin_gns_get_key(), block_plugin_revocation_evaluate(), block_plugin_revocation_get_key(), block_plugin_template_evaluate(), block_plugin_test_evaluate(), build_authz_response(), calculate_hmac(), check_authorization(), client_request_complete_alice(), code_redirect(), collector(), commit_set(), cookie_identity_interpretation(), core_init(), create_response(), data_to_ecdsa_value(), data_to_eddsa_value(), database_setup(), decrypt_new_element(), delayed_put(), derive_aes_key(), derive_auth_key(), derive_iv(), derive_pong_iv(), determine_id(), do_rekey(), encrypt_existing_match(), evaluate_block_regex(), evaluate_block_regex_accept(), find_advertisable_hello(), find_trees(), forward_reply(), GC_u2h(), GCT_handle_kx_auth(), get_cadet(), get_destination_key_from_ip(), get_fair_encryption_challenge(), get_file_handle(), get_gns_cont(), get_matching_bits(), get_update_information_directory(), get_url_parameter_copy(), GNUNET_BLOCK_mingle_hash(), GNUNET_CONVERSATION_phone_create(), GNUNET_CRYPTO_ecc_ecdh(), GNUNET_CRYPTO_rsa_public_key_hash(), GNUNET_e2s(), GNUNET_e2s2(), GNUNET_FS_handle_on_demand_block(), GNUNET_FS_namespace_list_updateable(), GNUNET_FS_publish_ublock_(), GNUNET_FS_search_start_searching_(), GNUNET_FS_tree_encoder_next(), GNUNET_FS_unindex_do_remove_kblocks_(), GNUNET_FS_uri_to_key(), GNUNET_GNSRECORD_query_from_public_key(), GNUNET_HELLO_extract_address(), GNUNET_HELLO_sign_address(), GNUNET_IDENTITY_ego_get_anonymous(), GNUNET_NETWORK_shorten_unixpath(), GNUNET_p2s(), GNUNET_p2s2(), GNUNET_TESTBED_barrier_init_(), GNUNET_TUN_service_name_to_hash(), GSC_KX_encrypt_and_transmit(), GSC_KX_init(), GSC_TYPEMAP_hash(), GSF_cadet_start_server(), handle_barrier_cancel(), handle_barrier_init(), handle_barrier_status(), handle_barrier_wait(), handle_client_decrypt(), handle_core_connect(), handle_encrypted(), handle_ephemeral_key(), handle_identity_set_default(), handle_identity_update(), handle_put(), handle_query_message(), handle_regex_result(), handle_transport_notify_connect(), hash_hosts(), hash_pkey_and_label(), header_iterator(), iface_proc(), insert_decrypt_element(), insert_round1_element(), iterate_initial_edge(), iterateBits(), load_plugin(), load_state(), login_cont(), lookup_diff(), lookup_rfn(), lookup_set(), lookup_task(), maint_child_death(), mysql_plugin_put(), namecache_cache_block(), namecache_postgres_cache_block(), namecache_sqlite_cache_block(), namestore_delete(), ns_lookup_result_cb(), peerinfo_get(), peerstore_flat_store_record(), PEERSTORE_hash_key(), persist_access_token(), point_to_hash(), post_data_iter(), postgres_plugin_put(), process_client_result(), process_kblock_for_unindex(), process_reply(), publicize_rm(), put_diff(), put_rfn(), put_set(), put_task(), queue(), REGEX_BLOCK_check_proof(), REGEX_BLOCK_get_key(), REGEX_INTERNAL_get_first_key(), remove_high_frequency_keywords(), reset_cadet(), run(), schedule_next_hello(), schedule_transmit_search_request(), score_content(), send_key(), send_kx_auth(), set_result_cb(), setup_filter(), sock_read(), sqlite_plugin_put(), start_intersection(), token_endpoint(), try_connect(), try_match_block(), try_open_exit(), try_top_down_reconstruction(), url_iterator(), and userinfo_endpoint().

51 {
52  BENCHMARK_START (hash);
53  gcry_md_hash_buffer (GCRY_MD_SHA512, ret, block, size);
54  BENCHMARK_END (hash);
55 }
#define BENCHMARK_START(opname)
Definition: benchmark.h:57
#define BENCHMARK_END(opname)
Definition: benchmark.h:58
static unsigned int size
Size of the "table".
Definition: peer.c:67

◆ GNUNET_CRYPTO_hmac()

void GNUNET_CRYPTO_hmac ( const struct GNUNET_CRYPTO_AuthKey key,
const void *  plaintext,
size_t  plaintext_len,
struct GNUNET_HashCode hmac 
)

Calculate HMAC of a message (RFC 2104)

Parameters
keysecret key
plaintextinput plaintext
plaintext_lenlength of plaintext
hmacwhere to store the hmac

Definition at line 438 of file crypto_hash.c.

References GNUNET_CRYPTO_hmac_raw(), and GNUNET_CRYPTO_AuthKey::key.

Referenced by dv_hmac(), GSC_KX_encrypt_and_transmit(), handle_encrypted(), RPS_sampler_elem_next(), t_ax_hmac_hash(), and t_hmac().

441 {
442  GNUNET_CRYPTO_hmac_raw ((void*) key->key, sizeof(key->key),
443  plaintext, plaintext_len,
444  hmac);
445 }
void GNUNET_CRYPTO_hmac_raw(const void *key, size_t key_len, const void *plaintext, size_t plaintext_len, struct GNUNET_HashCode *hmac)
Calculate HMAC of a message (RFC 2104) TODO: Shouldn&#39; this be the standard hmac function and the abov...
Definition: crypto_hash.c:403
unsigned char key[(512/8)]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hash_file()

struct GNUNET_CRYPTO_FileHashContext* GNUNET_CRYPTO_hash_file ( enum GNUNET_SCHEDULER_Priority  priority,
const char *  filename,
size_t  blocksize,
GNUNET_CRYPTO_HashCompletedCallback  callback,
void *  callback_cls 
)

Compute the hash of an entire file.

Parameters
priorityscheduling priority to use
filenamename of file to hash
blocksizenumber of bytes to process in one task
callbackfunction to call upon completion
callback_clsclosure for callback
Returns
NULL on (immediate) errror

Definition at line 178 of file crypto_hash_file.c.

References GNUNET_CRYPTO_FileHashContext::bsize, GNUNET_CRYPTO_FileHashContext::buffer, GNUNET_CRYPTO_FileHashContext::callback, GNUNET_CRYPTO_FileHashContext::callback_cls, GNUNET_CRYPTO_FileHashContext::fh, file_hash_task(), GNUNET_CRYPTO_FileHashContext::filename, GNUNET_CRYPTO_FileHashContext::fsize, GNUNET_assert, GNUNET_break, GNUNET_DISK_file_open(), GNUNET_DISK_file_size(), GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_NONE, GNUNET_free, GNUNET_malloc, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_with_priority(), GNUNET_strdup, GNUNET_YES, GNUNET_CRYPTO_FileHashContext::md, GNUNET_CRYPTO_FileHashContext::priority, and GNUNET_CRYPTO_FileHashContext::task.

Referenced by deserialize_unindex_file(), GNUNET_FS_publish_main_(), GNUNET_FS_unindex_start(), and handle_client_index_start().

183 {
184  struct GNUNET_CRYPTO_FileHashContext *fhc;
185 
186  GNUNET_assert (blocksize > 0);
187  fhc =
188  GNUNET_malloc (sizeof(struct GNUNET_CRYPTO_FileHashContext) + blocksize);
189  fhc->callback = callback;
190  fhc->callback_cls = callback_cls;
191  fhc->buffer = (unsigned char *) &fhc[1];
193  if (GPG_ERR_NO_ERROR != gcry_md_open (&fhc->md, GCRY_MD_SHA512, 0))
194  {
195  GNUNET_break (0);
196  GNUNET_free (fhc);
197  return NULL;
198  }
199  fhc->bsize = blocksize;
200  if (GNUNET_OK !=
202  &fhc->fsize,
203  GNUNET_NO,
204  GNUNET_YES))
205  {
206  GNUNET_free (fhc->filename);
207  GNUNET_free (fhc);
208  return NULL;
209  }
213  if (! fhc->fh)
214  {
215  GNUNET_free (fhc->filename);
216  GNUNET_free (fhc);
217  return NULL;
218  }
219  fhc->priority = priority;
222  fhc);
223  return fhc;
224 }
Open the file for reading.
struct GNUNET_SCHEDULER_Task * task
Current task for hashing.
struct GNUNET_DISK_FileHandle * fh
File descriptor.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
Nobody is allowed to do anything to the file.
#define GNUNET_NO
Definition: gnunet_common.h:78
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
gcry_md_hd_t md
Cummulated hash.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_with_priority(enum GNUNET_SCHEDULER_Priority prio, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified priority.
Definition: scheduler.c:1207
static char * filename
unsigned char * buffer
IO buffer.
char * filename
Name of the file we are hashing.
uint64_t fsize
Size of the file.
Context used when hashing a file.
int GNUNET_DISK_file_size(const char *filename, uint64_t *size, int include_symbolic_links, int single_file_mode)
Get the size of the file (or directory) of the given file (in bytes).
Definition: disk.c:257
enum GNUNET_SCHEDULER_Priority priority
Priority we use.
GNUNET_CRYPTO_HashCompletedCallback callback
Function to call upon completion.
#define GNUNET_YES
Definition: gnunet_common.h:77
static void file_hash_task(void *cls)
File hashing task.
struct GNUNET_DISK_FileHandle * GNUNET_DISK_file_open(const char *fn, enum GNUNET_DISK_OpenFlags flags, enum GNUNET_DISK_AccessPermissions perm)
Open a file.
Definition: disk.c:1268
#define GNUNET_malloc(size)
Wrapper around malloc.
void * callback_cls
Closure for callback.
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hash_create_random()

void GNUNET_CRYPTO_hash_create_random ( enum GNUNET_CRYPTO_Quality  mode,
struct GNUNET_HashCode result 
)

Create a random hash code.

Parameters
modedesired quality level
resulthash code that is randomized

Definition at line 144 of file crypto_hash.c.

References GNUNET_HashCode::bits, and GNUNET_CRYPTO_random_u32().

Referenced by commit_set(), do_consensus(), GDS_DATACACHE_get_random_key(), and run().

146 {
147  int i;
148 
149  for (i = (sizeof(struct GNUNET_HashCode) / sizeof(uint32_t)) - 1; i >= 0; i--)
150  result->bits[i] = GNUNET_CRYPTO_random_u32 (mode, UINT32_MAX);
151 }
uint32_t GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i)
Produce a random value.
static enum @8 mode
Should we do a PUT (mode = 0) or GET (mode = 1);.
A 512-bit hashcode.
uint32_t bits[512/8/sizeof(uint32_t)]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hash_difference()

void GNUNET_CRYPTO_hash_difference ( const struct GNUNET_HashCode a,
const struct GNUNET_HashCode b,
struct GNUNET_HashCode result 
)

compute result = b - a

Parameters
asome hash code
bsome hash code
resultset to b - a

compute result = b - a

Parameters
asome hash code
bsome hash code
resultset to b - a

Definition at line 162 of file crypto_hash.c.

References GNUNET_HashCode::bits.

165 {
166  int i;
167 
168  for (i = (sizeof(struct GNUNET_HashCode) / sizeof(unsigned int)) - 1; i >= 0;
169  i--)
170  result->bits[i] = b->bits[i] - a->bits[i];
171 }
A 512-bit hashcode.
uint32_t bits[512/8/sizeof(uint32_t)]

◆ GNUNET_CRYPTO_hash_sum()

void GNUNET_CRYPTO_hash_sum ( const struct GNUNET_HashCode a,
const struct GNUNET_HashCode delta,
struct GNUNET_HashCode result 
)

compute result = a + delta

Parameters
asome hash code
deltasome hash code
resultset to a + delta

compute result = a + delta

Parameters
asome hash code
deltasome hash code
resultset to a + delta

Definition at line 182 of file crypto_hash.c.

References GNUNET_HashCode::bits.

185 {
186  int i;
187 
188  for (i = (sizeof(struct GNUNET_HashCode) / sizeof(unsigned int)) - 1; i >= 0;
189  i--)
190  result->bits[i] = delta->bits[i] + a->bits[i];
191 }
A 512-bit hashcode.
uint32_t bits[512/8/sizeof(uint32_t)]

◆ GNUNET_CRYPTO_hash_xor()

void GNUNET_CRYPTO_hash_xor ( const struct GNUNET_HashCode a,
const struct GNUNET_HashCode b,
struct GNUNET_HashCode result 
)

compute result = a ^ b

Parameters
asome hash code
bsome hash code
resultset to a ^ b
asome hash code
bsome hash code
resultset to a ^ b

Definition at line 202 of file crypto_hash.c.

References GNUNET_HashCode::bits.

Referenced by determine_id(), filter_all(), filtered_map_initialization(), GNUNET_BLOCK_mingle_hash(), initialize_map_unfiltered(), iterator_bf_reduce(), and process_sks_result().

205 {
206  int i;
207 
208  for (i = (sizeof(struct GNUNET_HashCode) / sizeof(unsigned int)) - 1; i >= 0;
209  i--)
210  result->bits[i] = a->bits[i] ^ b->bits[i];
211 }
A 512-bit hashcode.
uint32_t bits[512/8/sizeof(uint32_t)]
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hash_to_aes_key()

void GNUNET_CRYPTO_hash_to_aes_key ( const struct GNUNET_HashCode hc,
struct GNUNET_CRYPTO_SymmetricSessionKey skey,
struct GNUNET_CRYPTO_SymmetricInitializationVector iv 
)

Convert a hashcode into a key.

Parameters
hchash code that serves to generate the key
skeyset to a valid session key
ivset to a valid initialization vector

Definition at line 222 of file crypto_hash.c.

References GNUNET_assert, GNUNET_CRYPTO_kdf(), and GNUNET_YES.

Referenced by derive_ublock_encryption_key(), encrypt_existing_match(), GNUNET_FS_handle_on_demand_block(), GNUNET_FS_tree_encoder_next(), process_result_with_request(), and try_match_block().

226 {
228  GNUNET_CRYPTO_kdf (skey, sizeof(struct
230  "Hash key derivation", strlen (
231  "Hash key derivation"),
232  hc, sizeof(struct GNUNET_HashCode),
233  NULL, 0));
235  GNUNET_CRYPTO_kdf (iv, sizeof(struct
237  "Initialization vector derivation", strlen (
238  "Initialization vector derivation"),
239  hc, sizeof(struct GNUNET_HashCode),
240  NULL, 0));
241 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
A 512-bit hashcode.
#define GNUNET_YES
Definition: gnunet_common.h:77
int 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.
Definition: crypto_kdf.c:89
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hash_get_bit()

int GNUNET_CRYPTO_hash_get_bit ( const struct GNUNET_HashCode code,
unsigned int  bit 
)

Obtain a bit from a hashcode.

Parameters
codethe struct GNUNET_HashCode to index bit-wise
bitindex into the hashcode, [0...159]
Returns
Bit bit from hashcode code, -1 for invalid index
Parameters
codethe GNUNET_CRYPTO_hash to index bit-wise
bitindex into the hashcode, [0...511]
Returns
Bit bit from hashcode code, -1 for invalid index

Definition at line 251 of file crypto_hash.c.

References GNUNET_assert.

Referenced by count_leading_zeroes(), get_distance(), and GNUNET_CRYPTO_hash_matching_bits().

253 {
254  GNUNET_assert (bit < 8 * sizeof(struct GNUNET_HashCode));
255  return (((unsigned char *) code)[bit >> 3] & (1 << (bit & 7))) > 0;
256 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
A 512-bit hashcode.
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hash_matching_bits()

unsigned int GNUNET_CRYPTO_hash_matching_bits ( const struct GNUNET_HashCode first,
const struct GNUNET_HashCode second 
)

Determine how many low order bits match in two struct GNUNET_HashCodes.

i.e. - 010011 and 011111 share the first two lowest order bits, and therefore the return value is two (NOT XOR distance, nor how many bits match absolutely!).

Parameters
firstthe first hashcode
secondthe hashcode to compare first to
Returns
the number of bits that match

Determine how many low order bits match in two struct GNUNET_HashCodes.

i.e. - 010011 and 011111 share the first two lowest order bits, and therefore the return value is two (NOT XOR distance, nor how many bits match absolutely!).

Parameters
firstthe first hashcode
secondthe hashcode to compare first to
Returns
the number of bits that match

Definition at line 272 of file crypto_hash.c.

References GNUNET_CRYPTO_hash_get_bit().

Referenced by find_bucket(), GDS_am_closest_peer(), GDS_DATACACHE_handle_put(), get_distance(), get_matching_bits(), handle_dht_p2p_get(), and handle_dht_p2p_put().

274 {
275  unsigned int i;
276 
277  for (i = 0; i < sizeof(struct GNUNET_HashCode) * 8; i++)
278  if (GNUNET_CRYPTO_hash_get_bit (first, i) !=
279  GNUNET_CRYPTO_hash_get_bit (second, i))
280  return i;
281  return sizeof(struct GNUNET_HashCode) * 8;
282 }
A 512-bit hashcode.
int GNUNET_CRYPTO_hash_get_bit(const struct GNUNET_HashCode *code, unsigned int bit)
Obtain a bit from a hashcode.
Definition: crypto_hash.c:251
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hash_cmp()

int GNUNET_CRYPTO_hash_cmp ( const struct GNUNET_HashCode h1,
const struct GNUNET_HashCode h2 
)

Compare function for HashCodes, producing a total ordering of all hashcodes.

Parameters
h1some hash code
h2some hash code
Returns
1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2.
Parameters
h1some hash code
h2some hash code
Returns
1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2.

Definition at line 294 of file crypto_hash.c.

Referenced by element_cmp(), find_closest(), handle_client_join(), handle_core_connect(), handle_transport_notify_connect(), op_get_element_iterator(), REGEX_BLOCK_check_proof(), and RPS_sampler_elem_next().

296 {
297  unsigned int *i1;
298  unsigned int *i2;
299  int i;
300 
301  i1 = (unsigned int *) h1;
302  i2 = (unsigned int *) h2;
303  for (i = (sizeof(struct GNUNET_HashCode) / sizeof(unsigned int)) - 1; i >= 0;
304  i--)
305  {
306  if (i1[i] > i2[i])
307  return 1;
308  if (i1[i] < i2[i])
309  return -1;
310  }
311  return 0;
312 }
A 512-bit hashcode.
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hash_xorcmp()

int GNUNET_CRYPTO_hash_xorcmp ( const struct GNUNET_HashCode h1,
const struct GNUNET_HashCode h2,
const struct GNUNET_HashCode target 
)

Find out which of the two GNUNET_CRYPTO_hash codes is closer to target in the XOR metric (Kademlia).

Parameters
h1some hash code
h2some hash code
targetsome hash code
Returns
-1 if h1 is closer, 1 if h2 is closer and 0 if h1== h2.

Find out which of the two GNUNET_CRYPTO_hash codes is closer to target in the XOR metric (Kademlia).

Parameters
h1some hash code
h2some hash code
targetsome hash code
Returns
-1 if h1 is closer, 1 if h2 is closer and 0 if h1==h2.

Definition at line 325 of file crypto_hash.c.

328 {
329  int i;
330  unsigned int d1;
331  unsigned int d2;
332 
333  for (i = sizeof(struct GNUNET_HashCode) / sizeof(unsigned int) - 1; i >= 0;
334  i--)
335  {
336  d1 = ((unsigned int *) h1)[i] ^ ((unsigned int *) target)[i];
337  d2 = ((unsigned int *) h2)[i] ^ ((unsigned int *) target)[i];
338  if (d1 > d2)
339  return 1;
340  else if (d1 < d2)
341  return -1;
342  }
343  return 0;
344 }
A 512-bit hashcode.

◆ GNUNET_CRYPTO_hmac_derive_key_v()

void GNUNET_CRYPTO_hmac_derive_key_v ( struct GNUNET_CRYPTO_AuthKey key,
const struct GNUNET_CRYPTO_SymmetricSessionKey rkey,
const void *  salt,
size_t  salt_len,
va_list  argp 
)

Derive an authentication key.

Parameters
keyauthentication key
rkeyroot key
saltsalt
salt_lensize of the salt
argppair of void * & size_t for context chunks, terminated by NULL
keyauthentication key
rkeyroot key
saltsalt
salt_lensize of the salt
argppair of void * & size_t for context chunks, terminated by NULL

Definition at line 378 of file crypto_hash.c.

References GNUNET_CRYPTO_kdf_v(), and GNUNET_CRYPTO_AuthKey::key.

Referenced by GNUNET_CRYPTO_hmac_derive_key().

383 {
384  GNUNET_CRYPTO_kdf_v (key->key, sizeof(key->key),
385  salt, salt_len,
386  rkey, sizeof(struct GNUNET_CRYPTO_SymmetricSessionKey),
387  argp);
388 }
unsigned char key[(512/8)]
int 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.
Definition: crypto_kdf.c:47
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hmac_derive_key()

void GNUNET_CRYPTO_hmac_derive_key ( struct GNUNET_CRYPTO_AuthKey key,
const struct GNUNET_CRYPTO_SymmetricSessionKey rkey,
const void *  salt,
size_t  salt_len,
  ... 
)

Derive an authentication key.

Parameters
keyauthentication key
rkeyroot key
saltsalt
salt_lensize of the salt
...pair of void * & size_t for context chunks, terminated by NULL
keyauthentication key
rkeyroot key
saltsalt
salt_lensize of the salt
...pair of void * & size_t for context chunks, terminated by NULL

Definition at line 356 of file crypto_hash.c.

References GNUNET_CRYPTO_hmac_derive_key_v().

Referenced by derive_auth_key(), t_ax_hmac_hash(), and t_hmac().

360 {
361  va_list argp;
362 
363  va_start (argp, salt_len);
364  GNUNET_CRYPTO_hmac_derive_key_v (key, rkey, salt, salt_len, argp);
365  va_end (argp);
366 }
void GNUNET_CRYPTO_hmac_derive_key_v(struct GNUNET_CRYPTO_AuthKey *key, const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey, const void *salt, size_t salt_len, va_list argp)
Derive an authentication key.
Definition: crypto_hash.c:378
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hkdf()

int GNUNET_CRYPTO_hkdf ( void *  result,
size_t  out_len,
int  xtr_algo,
int  prf_algo,
const void *  xts,
size_t  xts_len,
const void *  skm,
size_t  skm_len,
  ... 
)

Derive key.

Parameters
resultbuffer for the derived key, allocated by caller
out_lendesired length of the derived key
xtr_algohash algorithm for the extraction phase, GCRY_MD_...
prf_algohash algorithm for the expansion phase, GCRY_MD_...
xtssalt
xts_lenlength of xts
skmsource key material
skm_lenlength of skm
...pair of void * & size_t for context chunks, terminated by NULL
Returns
GNUNET_YES on success
Parameters
resultbuffer for the derived key, allocated by caller
out_lendesired length of the derived key
xtr_algohash algorithm for the extraction phase, GCRY_MD_...
prf_algohash algorithm for the expansion phase, GCRY_MD_...
xtssalt
xts_lenlength of xts
skmsource key material
skm_lenlength of skm
Returns
GNUNET_YES on success

Definition at line 291 of file crypto_hkdf.c.

References GNUNET_CRYPTO_hkdf_v(), and ret.

Referenced by calculate_cmac(), get_iv_key(), and get_kid().

294 {
295  va_list argp;
296  int ret;
297 
298  va_start (argp, skm_len);
299  ret =
300  GNUNET_CRYPTO_hkdf_v (result, out_len, xtr_algo, prf_algo, xts, xts_len,
301  skm, skm_len, argp);
302  va_end (argp);
303 
304  return ret;
305 }
int GNUNET_CRYPTO_hkdf_v(void *result, size_t out_len, int xtr_algo, int prf_algo, const void *xts, size_t xts_len, const void *skm, size_t skm_len, va_list argp)
Derive key.
Definition: crypto_hkdf.c:144
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:81
static int result
Global testing status.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_hkdf_v()

int GNUNET_CRYPTO_hkdf_v ( void *  result,
size_t  out_len,
int  xtr_algo,
int  prf_algo,
const void *  xts,
size_t  xts_len,
const void *  skm,
size_t  skm_len,
va_list  argp 
)

Derive key.

Parameters
resultbuffer for the derived key, allocated by caller
out_lendesired length of the derived key
xtr_algohash algorithm for the extraction phase, GCRY_MD_...
prf_algohash algorithm for the expansion phase, GCRY_MD_...
xtssalt
xts_lenlength of xts
skmsource key material
skm_lenlength of skm
argpva_list of void * & size_t pairs for context chunks
Returns
GNUNET_YES on success

Definition at line 144 of file crypto_hkdf.c.

References gnunet-chk::args, BENCHMARK_END, BENCHMARK_START, ctx, doHMAC(), dump, getPRK(), GNUNET_memcpy, GNUNET_SYSERR, GNUNET_YES, len, ret, and t.

Referenced by GNUNET_CRYPTO_hkdf(), and GNUNET_CRYPTO_kdf_v().

147 {
148  gcry_md_hd_t xtr;
149  gcry_md_hd_t prf;
150  const void *hc;
151  unsigned long i;
152  unsigned long t;
153  unsigned long d;
154  unsigned int k = gcry_md_get_algo_dlen (prf_algo);
155  unsigned int xtr_len = gcry_md_get_algo_dlen (xtr_algo);
156  char prk[xtr_len];
157  int ret;
158  size_t ctx_len;
159  va_list args;
160 
161  BENCHMARK_START (hkdf);
162 
163  if (0 == k)
164  return GNUNET_SYSERR;
165  if (GPG_ERR_NO_ERROR !=
166  gcry_md_open (&xtr, xtr_algo, GCRY_MD_FLAG_HMAC))
167  return GNUNET_SYSERR;
168  if (GPG_ERR_NO_ERROR !=
169  gcry_md_open (&prf, prf_algo, GCRY_MD_FLAG_HMAC))
170  {
171  gcry_md_close (xtr);
172  return GNUNET_SYSERR;
173  }
174  va_copy (args, argp);
175 
176  ctx_len = 0;
177  while (NULL != va_arg (args, void *))
178  ctx_len += va_arg (args, size_t);
179 
180  va_end (args);
181 
182  memset (result, 0, out_len);
183  if (getPRK (xtr, xts, xts_len, skm, skm_len, prk) != GNUNET_YES)
184  goto hkdf_error;
185 #if DEBUG_HKDF
186  dump ("PRK", prk, xtr_len);
187 #endif
188 
189  t = out_len / k;
190  d = out_len % k;
191 
192  /* K(1) */
193  {
194  size_t plain_len = k + ctx_len + 1;
195  char plain[plain_len];
196  const void *ctx;
197  char *dst;
198 
199  dst = plain + k;
200  va_copy (args, argp);
201  while ((ctx = va_arg (args, void *)))
202  {
203  size_t len;
204 
205  len = va_arg (args, size_t);
206  GNUNET_memcpy (dst, ctx, len);
207  dst += len;
208  }
209  va_end (args);
210 
211  if (t > 0)
212  {
213  memset (plain + k + ctx_len, 1, 1);
214 #if DEBUG_HKDF
215  dump ("K(1)", plain, plain_len);
216 #endif
217  hc = doHMAC (prf, prk, xtr_len, &plain[k], ctx_len + 1);
218  if (hc == NULL)
219  goto hkdf_error;
220  GNUNET_memcpy (result, hc, k);
221  result += k;
222  }
223 
224  /* K(i+1) */
225  for (i = 1; i < t; i++)
226  {
227  GNUNET_memcpy (plain, result - k, k);
228  memset (plain + k + ctx_len, i + 1, 1);
229  gcry_md_reset (prf);
230 #if DEBUG_HKDF
231  dump ("K(i+1)", plain, plain_len);
232 #endif
233  hc = doHMAC (prf, prk, xtr_len, plain, plain_len);
234  if (hc == NULL)
235  goto hkdf_error;
236  GNUNET_memcpy (result, hc, k);
237  result += k;
238  }
239 
240  /* K(t):d */
241  if (d > 0)
242  {
243  if (t > 0)
244  {
245  GNUNET_memcpy (plain, result - k, k);
246  i++;
247  }
248  memset (plain + k + ctx_len, i, 1);
249  gcry_md_reset (prf);
250 #if DEBUG_HKDF
251  dump ("K(t):d", plain, plain_len);
252 #endif
253  if (t > 0)
254  hc = doHMAC (prf, prk, xtr_len, plain, plain_len);
255  else
256  hc = doHMAC (prf, prk, xtr_len, plain + k, plain_len - k);
257  if (hc == NULL)
258  goto hkdf_error;
259  GNUNET_memcpy (result, hc, d);
260  }
261 #if DEBUG_HKDF
262  dump ("result", result - k, out_len);
263 #endif
264 
265  ret = GNUNET_YES;
266  goto hkdf_ok;
267  }
268 hkdf_error:
269  ret = GNUNET_SYSERR;
270 hkdf_ok:
271  gcry_md_close (xtr);
272  gcry_md_close (prf);
273  BENCHMARK_END (hkdf);
274  return ret;
275 }
#define BENCHMARK_START(opname)
Definition: benchmark.h:57
#define BENCHMARK_END(opname)
Definition: benchmark.h:58
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:81
static struct GNUNET_SCHEDULER_Task * t
Main task.
static struct GNUNET_DNSSTUB_Context * ctx
Context for DNS resolution.
static int result
Global testing status.
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
#define GNUNET_YES
Definition: gnunet_common.h:77
static const void * doHMAC(gcry_md_hd_t mac, const void *key, size_t key_len, const void *buf, size_t buf_len)
Compute the HMAC.
Definition: crypto_hkdf.c:77
static int getPRK(gcry_md_hd_t mac, const void *xts, size_t xts_len, const void *skm, size_t skm_len, void *prk)
Generate pseudo-random key.
Definition: crypto_hkdf.c:98
static int dump
Dump the database.
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_CRYPTO_kdf()

int 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.

Parameters
resultbuffer for the derived key, allocated by caller
out_lendesired length of the derived key
xtssalt
xts_lenlength of xts
skmsource key material
skm_lenlength of skm
...void * & size_t pairs for context chunks
Returns
GNUNET_YES on success

Definition at line 89 of file crypto_kdf.c.

References GNUNET_CRYPTO_kdf_v(), and ret.

Referenced by compute_global_id(), derive_aes_key(), derive_block_aes_key(), derive_h(), derive_ublock_encryption_key(), dv_setup_key_state_from_km(), get_ibf_key(), GNUNET_CRYPTO_hash_to_aes_key(), GNUNET_CRYPTO_kdf_mod_mpi(), hash_from_share_val(), setup_cipher(), t_ax_decrypt_and_validate(), t_ax_encrypt(), t_hmac_derive_key(), and update_ax_by_kx().

95 {
96  va_list argp;
97  int ret;
98 
99  va_start (argp, skm_len);
101  out_len,
102  xts,
103  xts_len,
104  skm,
105  skm_len,
106  argp);
107  va_end (argp);
108 
109  return ret;
110 }
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:81
int 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.
Definition: crypto_kdf.c:47
static int result
Global testing status.
Here is the call graph for this function:
Here is the caller graph for this function: