wickr-crypto-c
|
Data Structures | |
struct | wickr_dev_info |
Device Information used to make a uniquely identifying set of data for each context running the Wickr Protocol. More... | |
Functions | |
wickr_dev_info_t * | wickr_dev_info_create (wickr_buffer_t *dev_salt, wickr_buffer_t *system_salt, wickr_buffer_t *msg_proto_id, wickr_buffer_t *srv_comm_id) |
wickr_dev_info_t * | wickr_dev_info_create_new (const wickr_crypto_engine_t *crypto, const wickr_buffer_t *system_id) |
wickr_dev_info_t * | wickr_dev_info_derive (const wickr_crypto_engine_t *crypto, wickr_buffer_t *dev_salt, const wickr_buffer_t *system_id) |
wickr_dev_info_t * | wickr_dev_info_copy (const wickr_dev_info_t *info) |
void | wickr_dev_info_destroy (wickr_dev_info_t **info) |
wickr_dev_info_t* wickr_dev_info_copy | ( | const wickr_dev_info_t * | info | ) |
Copy a device info set
info | the source info to copy |
wickr_dev_info_t* wickr_dev_info_create | ( | wickr_buffer_t * | dev_salt, |
wickr_buffer_t * | system_salt, | ||
wickr_buffer_t * | msg_proto_id, | ||
wickr_buffer_t * | srv_comm_id | ||
) |
Create a device info set from components
dev_salt | random salt, see property declaration of 'wickr_dev_info' |
system_salt | system bound salt, see property declaration of 'wickr_dev_info' |
msg_proto_id | messaging protocol identifier, see property declaration of 'wickr_dev_info' |
srv_comm_id | server communication identifier, see property declaration of 'wickr_dev_info' |
wickr_dev_info_t* wickr_dev_info_create_new | ( | const wickr_crypto_engine_t * | crypto, |
const wickr_buffer_t * | system_id | ||
) |
Generate a new randomized device info set from a system identifier. This function uses crypto engine 'crypto' to generate a random 'dev_salt' value, and then calls 'wickr_dev_info_derive' with the resulting random 'dev_salt', crypto engine, and provided 'system_id' values
crypto | a crypto engine that supports a PRNG, SHA512, and SHA256 functions |
system_id | a buffer representing data optimally unique to your system. It is used as the basis of generating the 'system_salt' property. See property declaration of 'system_salt' in 'wickr_dev_info' |
wickr_dev_info_t* wickr_dev_info_derive | ( | const wickr_crypto_engine_t * | crypto, |
wickr_buffer_t * | dev_salt, | ||
const wickr_buffer_t * | system_id | ||
) |
Derive a set of salt values and identifiers. Creates 'system_salt' by taking a SHA256 hash of the system_id. Creates 'msg_proto_id', and 'srv_comm_id' properties by taking a SHA512 of of 'system_id' using 'dev_salt' as a salt, and then splits by using the first 32 bytes as 'msg_proto_id', and the last 32 bytes as 'srv_comm_id'
crypto | a crypto engine that supports a PRNG, SHA512, and SHA256 functions |
dev_salt | a randomly generated device salt to be used as input for generating identifiers |
system_id | a system level identifier to be used as input to generating a 'system_salt' value, as well as identifiers |
void wickr_dev_info_destroy | ( | wickr_dev_info_t ** | info | ) |
Destroy a device info set
info | a pointer to a device info set to destroy. Properties of '*info' will also be destroyed |