![]() |
GNUnet
0.11.x
|
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... | |
enum GNUNET_GenericReturnValue | 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_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. 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_ltr (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... | |
enum GNUNET_GenericReturnValue | 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... | |
enum GNUNET_GenericReturnValue | 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... | |
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. More... | |
Provides hashing and operations on hashes.
#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
enc | the encoding |
result | where to store the hash code |
Definition at line 652 of file gnunet_crypto_lib.h.
Referenced by database_setup(), load_service_room_and_messages(), run(), uri_chk_parse(), and uri_loc_parse().
uint8_t GNUNET_CRYPTO_crc8_n | ( | const void * | buf, |
size_t | len | ||
) |
Calculate the checksum of a buffer in one step.
buf | buffer to calculate CRC over |
len | number of bytes in buf |
Definition at line 179 of file crypto_crc.c.
uint16_t GNUNET_CRYPTO_crc16_n | ( | const void * | buf, |
size_t | len | ||
) |
Calculate the checksum of a buffer in one step.
buf | buffer to calculate CRC over (must be 16-bit aligned) |
len | number of bytes in buf, must be multiple of 2 |
buf | buffer to calculate CRC over (must be 16-bit aligned) |
len | number of bytes in hdr, must be multiple of 2 |
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().
int32_t GNUNET_CRYPTO_crc32_n | ( | const void * | buf, |
size_t | len | ||
) |
Compute the CRC32 checksum for the first len bytes of the buffer.
buf | the data over which we're taking the CRC |
len | the length of the buffer buf in bytes |
buf | the data over which we're taking the CRC |
len | the length of the buffer |
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().
void GNUNET_CRYPTO_hash_to_enc | ( | const struct GNUNET_HashCode * | block, |
struct GNUNET_CRYPTO_HashAsciiEncoded * | result | ||
) |
Convert hash to ASCII encoding.
block | the hash code |
result | where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be safely cast to char*, a '\0' termination is set). |
Definition at line 55 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().
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_hash_from_string2 | ( | const char * | enc, |
size_t | enclen, | ||
struct GNUNET_HashCode * | result | ||
) |
Convert ASCII encoding back to a 'struct GNUNET_HashCode'.
enc | the encoding |
enclen | number of characters in enc (without 0-terminator, which can be missing) |
result | where to store the hash code |
Definition at line 72 of file crypto_hash.c.
References GNUNET_STRINGS_string_to_data(), and GNUNET_STRINGS_utf8_toupper().
uint32_t 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.
a | some hash code |
b | some hash code |
Definition at line 88 of file crypto_hash.c.
References GNUNET_HashCode::bits.
Referenced by score_content().
void GNUNET_CRYPTO_hash | ( | const void * | block, |
size_t | size, | ||
struct GNUNET_HashCode * | ret | ||
) |
Compute hash of a given block.
block | the data to hash |
size | size of the block |
ret | pointer to where to write the hashcode |
Definition at line 41 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_revocation_evaluate(), block_plugin_revocation_get_key(), block_plugin_template_evaluate(), block_plugin_test_evaluate(), build_authz_response(), calculate_hmac(), checkvec(), client_request_complete_alice(), code_redirect(), collector(), commit_set(), consume_timeout(), cookie_identity_interpretation(), core_init(), create_response(), data_to_ecdsa_value(), database_setup(), decrypt_new_element(), delayed_put(), derive_aes_key(), derive_auth_key(), derive_iv(), derive_pong_iv(), determine_id(), do_rekey(), ego_get_all(), ego_get_response(), 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_contact_id_from_key(), get_destination_key_from_ip(), get_fair_encryption_challenge(), get_file_handle(), get_gns_cont(), get_handle_contact_by_pubkey(), get_matching_bits(), get_service_contact_by_pubkey(), get_update_information_directory(), get_url_parameter_copy(), GNUNET_BLOCK_mingle_hash(), GNUNET_CONVERSATION_phone_create(), GNUNET_CRYPTO_ecc_ecdh(), GNUNET_CRYPTO_ecdh_ecdsa(), GNUNET_CRYPTO_ecdh_eddsa(), GNUNET_CRYPTO_ecdsa_ecdh(), GNUNET_CRYPTO_eddsa_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_block(), 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_message(), hash_pkey_and_label(), header_iterator(), iface_proc(), init_socket(), insert_decrypt_element(), insert_round1_element(), iterate_initial_edge(), iterateBits(), load_state(), login_cont(), lookup_diff(), lookup_rfn(), lookup_service_ego(), lookup_set(), lookup_task(), maint_child_death(), mysql_plugin_put(), namestore_get(), ns_lookup_result_cb(), on_identity(), output_vectors(), parse_credentials_basic_auth(), parse_credentials_post_body(), peerinfo_get(), peerstore_flat_store_record(), PEERSTORE_hash_key(), 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(), queue_destroy(), 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(), update_service_ego(), url_iterator(), and userinfo_endpoint().
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)
key | secret key |
plaintext | input plaintext |
plaintext_len | length of plaintext |
hmac | where to store the hmac |
Definition at line 301 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().
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.
priority | scheduling priority to use |
filename | name of file to hash |
blocksize | number of bytes to process in one task |
callback | function to call upon completion |
callback_cls | closure for callback |
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().
void GNUNET_CRYPTO_hash_create_random | ( | enum GNUNET_CRYPTO_Quality | mode, |
struct GNUNET_HashCode * | result | ||
) |
Create a random hash code.
mode | desired quality level |
result | hash code that is randomized |
Definition at line 99 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().
void GNUNET_CRYPTO_hash_difference | ( | const struct GNUNET_HashCode * | a, |
const struct GNUNET_HashCode * | b, | ||
struct GNUNET_HashCode * | result | ||
) |
compute result = b - a
a | some hash code |
b | some hash code |
result | set to b - a |
Definition at line 110 of file crypto_hash.c.
References GNUNET_HashCode::bits.
void GNUNET_CRYPTO_hash_sum | ( | const struct GNUNET_HashCode * | a, |
const struct GNUNET_HashCode * | delta, | ||
struct GNUNET_HashCode * | result | ||
) |
compute result = a + delta
a | some hash code |
delta | some hash code |
result | set to a + delta |
Definition at line 122 of file crypto_hash.c.
References GNUNET_HashCode::bits.
void GNUNET_CRYPTO_hash_xor | ( | const struct GNUNET_HashCode * | a, |
const struct GNUNET_HashCode * | b, | ||
struct GNUNET_HashCode * | result | ||
) |
compute result = a ^ b
a | some hash code |
b | some hash code |
result | set to a ^ b |
Definition at line 134 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().
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.
hc | hash code that serves to generate the key |
skey | set to a valid session key |
iv | set to a valid initialization vector |
Definition at line 146 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(), GNUNET_IDENTITY_decrypt(), GNUNET_IDENTITY_encrypt(), process_result_with_request(), and try_match_block().
int GNUNET_CRYPTO_hash_get_bit_ltr | ( | const struct GNUNET_HashCode * | code, |
unsigned int | bit | ||
) |
Obtain a bit from a hashcode.
code | the struct GNUNET_HashCode to index bit-wise |
bit | index into the hashcode, [0...159] where 0 is the leftmost bit (bytes in code interpreted big endian) |
Definition at line 171 of file crypto_hash.c.
References GNUNET_assert.
Referenced by count_leading_zeroes().
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!).
first | the first hashcode |
second | the hashcode to compare first to |
Definition at line 189 of file crypto_hash.c.
References GNUNET_CRYPTO_hash_get_bit_rtl().
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().
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.
h1 | some hash code |
h2 | some hash code |
Definition at line 201 of file crypto_hash.c.
Referenced by create_message_request(), element_cmp(), find_closest(), handle_client_join(), handle_core_connect(), handle_transport_notify_connect(), op_get_element_iterator(), REGEX_BLOCK_check_proof(), remove_from_list_messages(), RPS_sampler_elem_next(), and update_room_last_messages().
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).
h1 | some hash code |
h2 | some hash code |
target | some hash code |
Definition at line 223 of file crypto_hash.c.
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.
key | authentication key |
rkey | root key |
salt | salt |
salt_len | size of the salt |
argp | pair of void * & size_t for context chunks, terminated by NULL |
Definition at line 260 of file crypto_hash.c.
References GNUNET_CRYPTO_kdf_v(), and GNUNET_CRYPTO_AuthKey::key.
Referenced by 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.
key | authentication key |
rkey | root key |
salt | salt |
salt_len | size of the salt |
... | pair of void * & size_t for context chunks, terminated by NULL |
Definition at line 246 of file crypto_hash.c.
References GNUNET_CRYPTO_hmac_derive_key_v().
Referenced by derive_auth_key(), t_ax_hmac_hash(), and t_hmac().
enum GNUNET_GenericReturnValue 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.
result | buffer for the derived key, allocated by caller |
out_len | desired length of the derived key |
xtr_algo | hash algorithm for the extraction phase, GCRY_MD_... |
prf_algo | hash algorithm for the expansion phase, GCRY_MD_... |
xts | salt |
xts_len | length of xts |
skm | source key material |
skm_len | length of skm |
... | pair of void * & size_t for context chunks, terminated by NULL |
result | buffer for the derived key, allocated by caller |
out_len | desired length of the derived key |
xtr_algo | hash algorithm for the extraction phase, GCRY_MD_... |
prf_algo | hash algorithm for the expansion phase, GCRY_MD_... |
xts | salt |
xts_len | length of xts |
skm | source key material |
skm_len | length of skm |
Definition at line 320 of file crypto_hkdf.c.
References GNUNET_CRYPTO_hkdf_v(), and ret.
Referenced by calculate_cmac(), get_iv_key(), and get_kid().
enum GNUNET_GenericReturnValue 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.
result | buffer for the derived key, allocated by caller |
out_len | desired length of the derived key |
xtr_algo | hash algorithm for the extraction phase, GCRY_MD_... |
prf_algo | hash algorithm for the expansion phase, GCRY_MD_... |
xts | salt |
xts_len | length of xts |
skm | source key material |
skm_len | length of skm |
argp | va_list of void * & size_t pairs for context chunks |
Definition at line 144 of file crypto_hkdf.c.
References gnunet-chk::args, BENCHMARK_END, BENCHMARK_START, ctx, doHMAC(), dump, getPRK(), GNUNET_break, GNUNET_free, GNUNET_malloc, GNUNET_memcpy, GNUNET_SYSERR, GNUNET_YES, len, ret, and t.
Referenced by GNUNET_CRYPTO_hkdf(), and GNUNET_CRYPTO_kdf_v().
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.
result | buffer for the derived key, allocated by caller |
out_len | desired length of the derived key |
xts | salt |
xts_len | length of xts |
skm | source key material |
skm_len | length of skm |
... | void * & size_t pairs for context chunks |
Definition at line 90 of file crypto_kdf.c.
References GNUNET_CRYPTO_kdf_v(), and ret.
Referenced by checkvec(), 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(), output_vectors(), setup_cipher(), t_ax_decrypt_and_validate(), t_ax_encrypt(), t_hmac_derive_key(), and update_ax_by_kx().