GNUnet  0.10.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 604 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 178 of file crypto_crc.c.

References buf, and data.

180 {
181  const uint8_t *data = buf;
182  unsigned int crc = 0;
183  int i;
184  int j;
185 
186  for (j = len; 0 != j; j--)
187  {
188  crc ^= (*data++ << 8);
189  for (i = 8; 0 != i; i--)
190  {
191  if (0 != (crc & 0x8000))
192  crc ^= (0x1070 << 3);
193  crc <<= 1;
194  }
195  }
196  return (uint8_t)(crc >> 8);
197 }
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 160 of file crypto_crc.c.

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

Referenced by GNUNET_TUN_initialize_ipv4_header().

161 {
162  const uint16_t *hdr = buf;
163  uint32_t sum = GNUNET_CRYPTO_crc16_step(0, hdr, len);
164 
165  return GNUNET_CRYPTO_crc16_finish(sum);
166 }
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:124
uint16_t GNUNET_CRYPTO_crc16_finish(uint32_t sum)
Convert results from GNUNET_CRYPTO_crc16_step() to final crc16.
Definition: crypto_crc.c:143
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 105 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().

106 {
107  GNUNET_uLong crc;
108 
109  crc = crc32(0L, Z_NULL, 0);
110  crc = crc32(crc, (char *)buf, len);
111  return crc;
112 }
#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:86
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 69 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().

71 {
72  char *np;
73 
74  np = GNUNET_STRINGS_data_to_string((const unsigned char *)block,
75  sizeof(struct GNUNET_HashCode),
76  (char *)result,
77  sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded) - 1);
78  GNUNET_assert(NULL != np);
79  *np = '\0';
80 }
#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:857
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 92 of file crypto_hash.c.

References GNUNET_STRINGS_string_to_data(), and GNUNET_STRINGS_utf8_toupper().

95 {
96  char upper_enc[enclen];
97  char *up_ptr = upper_enc;
98 
100 
101  return GNUNET_STRINGS_string_to_data(upper_enc, enclen,
102  (unsigned char*)result,
103  sizeof(struct GNUNET_HashCode));
104 }
void GNUNET_STRINGS_utf8_toupper(const char *input, char *output)
Convert the utf-8 input string to upper case.
Definition: strings.c:577
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:953
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 121 of file crypto_hash.c.

References GNUNET_HashCode::bits.

Referenced by score_content().

123 {
124  unsigned int x1 = (a->bits[1] - b->bits[1]) >> 16;
125  unsigned int x2 = (b->bits[1] - a->bits[1]) >> 16;
126 
127  return(x1 * x2);
128 }
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 44 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(), collect_cred_cont(), 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_cred_issuer_cb(), 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(), userinfo_endpoint(), and verify_cred_cont().

47 {
48  BENCHMARK_START(hash);
49  gcry_md_hash_buffer(GCRY_MD_SHA512, ret, block, size);
50  BENCHMARK_END(hash);
51 }
#define BENCHMARK_START(opname)
Definition: benchmark.h:53
#define BENCHMARK_END(opname)
Definition: benchmark.h:54
static unsigned int size
Size of the "table".
Definition: peer.c:66

◆ 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 418 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().

421 {
422  GNUNET_CRYPTO_hmac_raw((void*)key->key, sizeof(key->key),
423  plaintext, plaintext_len,
424  hmac);
425 }
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:383
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 172 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().

177 {
178  struct GNUNET_CRYPTO_FileHashContext *fhc;
179 
180  GNUNET_assert(blocksize > 0);
181  fhc =
182  GNUNET_malloc(sizeof(struct GNUNET_CRYPTO_FileHashContext) + blocksize);
183  fhc->callback = callback;
184  fhc->callback_cls = callback_cls;
185  fhc->buffer = (unsigned char *)&fhc[1];
187  if (GPG_ERR_NO_ERROR != gcry_md_open(&fhc->md, GCRY_MD_SHA512, 0))
188  {
189  GNUNET_break(0);
190  GNUNET_free(fhc);
191  return NULL;
192  }
193  fhc->bsize = blocksize;
194  if (GNUNET_OK !=
196  &fhc->fsize,
197  GNUNET_NO,
198  GNUNET_YES))
199  {
200  GNUNET_free(fhc->filename);
201  GNUNET_free(fhc);
202  return NULL;
203  }
207  if (!fhc->fh)
208  {
209  GNUNET_free(fhc->filename);
210  GNUNET_free(fhc);
211  return NULL;
212  }
213  fhc->priority = priority;
216  fhc);
217  return fhc;
218 }
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:1191
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:254
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:1262
#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 138 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().

140 {
141  int i;
142 
143  for (i = (sizeof(struct GNUNET_HashCode) / sizeof(uint32_t)) - 1; i >= 0; i--)
144  result->bits[i] = GNUNET_CRYPTO_random_u32(mode, UINT32_MAX);
145 }
uint32_t GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i)
Produce a random value.
A 512-bit hashcode.
static enum @11 mode
Should we do a PUT (mode = 0) or GET (mode = 1);.
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 156 of file crypto_hash.c.

References GNUNET_HashCode::bits.

159 {
160  int i;
161 
162  for (i = (sizeof(struct GNUNET_HashCode) / sizeof(unsigned int)) - 1; i >= 0; i--)
163  result->bits[i] = b->bits[i] - a->bits[i];
164 }
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 175 of file crypto_hash.c.

References GNUNET_HashCode::bits.

177 {
178  int i;
179 
180  for (i = (sizeof(struct GNUNET_HashCode) / sizeof(unsigned int)) - 1; i >= 0; i--)
181  result->bits[i] = delta->bits[i] + a->bits[i];
182 }
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 193 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().

196 {
197  int i;
198 
199  for (i = (sizeof(struct GNUNET_HashCode) / sizeof(unsigned int)) - 1; i >= 0; i--)
200  result->bits[i] = a->bits[i] ^ b->bits[i];
201 }
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 212 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().

215 {
218  "Hash key derivation", strlen("Hash key derivation"),
219  hc, sizeof(struct GNUNET_HashCode),
220  NULL, 0));
223  "Initialization vector derivation", strlen("Initialization vector derivation"),
224  hc, sizeof(struct GNUNET_HashCode),
225  NULL, 0));
226 }
#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:91
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 236 of file crypto_hash.c.

References GNUNET_assert.

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

237 {
238  GNUNET_assert(bit < 8 * sizeof(struct GNUNET_HashCode));
239  return (((unsigned char *)code)[bit >> 3] & (1 << (bit & 7))) > 0;
240 }
#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 256 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().

258 {
259  unsigned int i;
260 
261  for (i = 0; i < sizeof(struct GNUNET_HashCode) * 8; i++)
262  if (GNUNET_CRYPTO_hash_get_bit(first, i) !=
263  GNUNET_CRYPTO_hash_get_bit(second, i))
264  return i;
265  return sizeof(struct GNUNET_HashCode) * 8;
266 }
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:236
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 278 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().

280 {
281  unsigned int *i1;
282  unsigned int *i2;
283  int i;
284 
285  i1 = (unsigned int *)h1;
286  i2 = (unsigned int *)h2;
287  for (i = (sizeof(struct GNUNET_HashCode) / sizeof(unsigned int)) - 1; i >= 0; i--)
288  {
289  if (i1[i] > i2[i])
290  return 1;
291  if (i1[i] < i2[i])
292  return -1;
293  }
294  return 0;
295 }
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 308 of file crypto_hash.c.

311 {
312  int i;
313  unsigned int d1;
314  unsigned int d2;
315 
316  for (i = sizeof(struct GNUNET_HashCode) / sizeof(unsigned int) - 1; i >= 0; i--)
317  {
318  d1 = ((unsigned int *)h1)[i] ^ ((unsigned int *)target)[i];
319  d2 = ((unsigned int *)h2)[i] ^ ((unsigned int *)target)[i];
320  if (d1 > d2)
321  return 1;
322  else if (d1 < d2)
323  return -1;
324  }
325  return 0;
326 }
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 359 of file crypto_hash.c.

References GNUNET_CRYPTO_kdf_v(), and GNUNET_CRYPTO_AuthKey::key.

Referenced by GNUNET_CRYPTO_hmac_derive_key().

363 {
364  GNUNET_CRYPTO_kdf_v(key->key, sizeof(key->key),
365  salt, salt_len,
366  rkey, sizeof(struct GNUNET_CRYPTO_SymmetricSessionKey),
367  argp);
368 }
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 338 of file crypto_hash.c.

References GNUNET_CRYPTO_hmac_derive_key_v().

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

341 {
342  va_list argp;
343 
344  va_start(argp, salt_len);
345  GNUNET_CRYPTO_hmac_derive_key_v(key, rkey, salt, salt_len, argp);
346  va_end(argp);
347 }
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:359
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 289 of file crypto_hkdf.c.

References GNUNET_CRYPTO_hkdf_v(), and ret.

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

292 {
293  va_list argp;
294  int ret;
295 
296  va_start(argp, skm_len);
297  ret =
298  GNUNET_CRYPTO_hkdf_v(result, out_len, xtr_algo, prf_algo, xts, xts_len,
299  skm, skm_len, argp);
300  va_end(argp);
301 
302  return ret;
303 }
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:142
static int ret
Final status code.
Definition: gnunet-arm.c:89
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 142 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().

145 {
146  gcry_md_hd_t xtr;
147  gcry_md_hd_t prf;
148  const void *hc;
149  unsigned long i;
150  unsigned long t;
151  unsigned long d;
152  unsigned int k = gcry_md_get_algo_dlen(prf_algo);
153  unsigned int xtr_len = gcry_md_get_algo_dlen(xtr_algo);
154  char prk[xtr_len];
155  int ret;
156  size_t ctx_len;
157  va_list args;
158 
159  BENCHMARK_START(hkdf);
160 
161  if (0 == k)
162  return GNUNET_SYSERR;
163  if (GPG_ERR_NO_ERROR !=
164  gcry_md_open(&xtr, xtr_algo, GCRY_MD_FLAG_HMAC))
165  return GNUNET_SYSERR;
166  if (GPG_ERR_NO_ERROR !=
167  gcry_md_open(&prf, prf_algo, GCRY_MD_FLAG_HMAC))
168  {
169  gcry_md_close(xtr);
170  return GNUNET_SYSERR;
171  }
172  va_copy(args, argp);
173 
174  ctx_len = 0;
175  while (NULL != va_arg(args, void *))
176  ctx_len += va_arg(args, size_t);
177 
178  va_end(args);
179 
180  memset(result, 0, out_len);
181  if (getPRK(xtr, xts, xts_len, skm, skm_len, prk) != GNUNET_YES)
182  goto hkdf_error;
183 #if DEBUG_HKDF
184  dump("PRK", prk, xtr_len);
185 #endif
186 
187  t = out_len / k;
188  d = out_len % k;
189 
190  /* K(1) */
191  {
192  size_t plain_len = k + ctx_len + 1;
193  char plain[plain_len];
194  const void *ctx;
195  char *dst;
196 
197  dst = plain + k;
198  va_copy(args, argp);
199  while ((ctx = va_arg(args, void *)))
200  {
201  size_t len;
202 
203  len = va_arg(args, size_t);
204  GNUNET_memcpy(dst, ctx, len);
205  dst += len;
206  }
207  va_end(args);
208 
209  if (t > 0)
210  {
211  memset(plain + k + ctx_len, 1, 1);
212 #if DEBUG_HKDF
213  dump("K(1)", plain, plain_len);
214 #endif
215  hc = doHMAC(prf, prk, xtr_len, &plain[k], ctx_len + 1);
216  if (hc == NULL)
217  goto hkdf_error;
218  GNUNET_memcpy(result, hc, k);
219  result += k;
220  }
221 
222  /* K(i+1) */
223  for (i = 1; i < t; i++)
224  {
225  GNUNET_memcpy(plain, result - k, k);
226  memset(plain + k + ctx_len, i + 1, 1);
227  gcry_md_reset(prf);
228 #if DEBUG_HKDF
229  dump("K(i+1)", plain, plain_len);
230 #endif
231  hc = doHMAC(prf, prk, xtr_len, plain, plain_len);
232  if (hc == NULL)
233  goto hkdf_error;
234  GNUNET_memcpy(result, hc, k);
235  result += k;
236  }
237 
238  /* K(t):d */
239  if (d > 0)
240  {
241  if (t > 0)
242  {
243  GNUNET_memcpy(plain, result - k, k);
244  i++;
245  }
246  memset(plain + k + ctx_len, i, 1);
247  gcry_md_reset(prf);
248 #if DEBUG_HKDF
249  dump("K(t):d", plain, plain_len);
250 #endif
251  if (t > 0)
252  hc = doHMAC(prf, prk, xtr_len, plain, plain_len);
253  else
254  hc = doHMAC(prf, prk, xtr_len, plain + k, plain_len - k);
255  if (hc == NULL)
256  goto hkdf_error;
257  GNUNET_memcpy(result, hc, d);
258  }
259 #if DEBUG_HKDF
260  dump("result", result - k, out_len);
261 #endif
262 
263  ret = GNUNET_YES;
264  goto hkdf_ok;
265  }
266 hkdf_error:
267  ret = GNUNET_SYSERR;
268 hkdf_ok:
269  gcry_md_close(xtr);
270  gcry_md_close(prf);
271  BENCHMARK_END(hkdf);
272  return ret;
273 }
#define BENCHMARK_START(opname)
Definition: benchmark.h:53
#define BENCHMARK_END(opname)
Definition: benchmark.h:54
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
static struct GNUNET_SCHEDULER_Task * t
Main task.
static int ret
Final status code.
Definition: gnunet-arm.c:89
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:78
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 91 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().

97 {
98  va_list argp;
99  int ret;
100 
101  va_start(argp, skm_len);
103  out_len,
104  xts,
105  xts_len,
106  skm,
107  skm_len,
108  argp);
109  va_end(argp);
110 
111  return ret;
112 }
static int ret
Final status code.
Definition: gnunet-arm.c:89
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: