wickr-crypto-c
Data Structures | Enumerations | Functions
wickr_fingerprint

Data Structures

struct  wickr_fingerprint
 A fingerprint representation of a combination of signature keys / identifiers. More...
 

Enumerations

enum  wickr_fingerprint_output { FINGERPRINT_OUTPUT_SHORT, FINGERPRINT_OUTPUT_LONG }
 
enum  wickr_fingerprint_type { WICKR_FINGERPRINT_TYPE_SHA512 }
 

Functions

wickr_fingerprint_twickr_fingerprint_gen (wickr_crypto_engine_t engine, const wickr_ec_key_t *key, const wickr_buffer_t *identifier, wickr_fingerprint_type type)
 
wickr_fingerprint_twickr_fingerprint_gen_bilateral (wickr_crypto_engine_t engine, const wickr_fingerprint_t *local, const wickr_fingerprint_t *remote, wickr_fingerprint_type type)
 
wickr_fingerprint_twickr_fingerprint_create (wickr_fingerprint_type type, wickr_buffer_t *data)
 
wickr_fingerprint_twickr_fingerprint_copy (const wickr_fingerprint_t *fingerprint)
 
void wickr_fingerprint_destroy (wickr_fingerprint_t **fingerprint)
 
wickr_buffer_twickr_fingerprint_get_b32 (const wickr_fingerprint_t *fingerprint, wickr_fingerprint_output output_mode)
 
wickr_buffer_twickr_fingerprint_get_hex (const wickr_fingerprint_t *fingerprint, wickr_fingerprint_output output_mode)
 

Detailed Description

Enumeration Type Documentation

◆ wickr_fingerprint_output

Fingerprint output format

SHORT - Output a fingerprint that is 1/2 length of the full representation LONG - Output a fingerprint that is encoded to be full length

◆ wickr_fingerprint_type

Fingerprint Encoding Type

SHA512 - Calculated by taking a SHA512 of the inputs concatenated together

Function Documentation

◆ wickr_fingerprint_copy()

wickr_fingerprint_t* wickr_fingerprint_copy ( const wickr_fingerprint_t fingerprint)

Copy a wickr_fingerprint

Parameters
fingerprintthe fingerprint to copy
Returns
a copy of 'fingerprint' that contains a deep copy of 'data'

◆ wickr_fingerprint_create()

wickr_fingerprint_t* wickr_fingerprint_create ( wickr_fingerprint_type  type,
wickr_buffer_t data 
)

Create a new wickr_fingerprint struct

Parameters
typesee 'wickr_fingerprint' property documentation
datasee 'wickr_fingerprint' property documentation
Returns
a newly allocated fingerprint that takes ownership of the passed inputs

◆ wickr_fingerprint_destroy()

void wickr_fingerprint_destroy ( wickr_fingerprint_t **  fingerprint)

Destroy a wickr_fingerprint

Parameters
fingerprintthe fingerprint to destroy

◆ wickr_fingerprint_gen()

wickr_fingerprint_t* wickr_fingerprint_gen ( wickr_crypto_engine_t  engine,
const wickr_ec_key_t key,
const wickr_buffer_t identifier,
wickr_fingerprint_type  type 
)

Generate a fingerprint based on a signing key / fixed user identifier

Parameters
enginethe crypto engine to use for underlying hash operations
keythe key to include in the resulting fingerprint
identifiera fixed user identifier to use in the resulting fingerprint
typethe type of fingerprint algorithm to use when processing key/identifier
Returns
A unique fingerprint representing the combination of key/identifier

◆ wickr_fingerprint_gen_bilateral()

wickr_fingerprint_t* wickr_fingerprint_gen_bilateral ( wickr_crypto_engine_t  engine,
const wickr_fingerprint_t local,
const wickr_fingerprint_t remote,
wickr_fingerprint_type  type 
)

Generate a bilateral fingerprint by combining two existing fingerprints made with 'wickr_fingerprint_gen'. Fingerprints created by this function are identical if local/remote input values are swapped, as they are sorted internally before computation begins

Parameters
enginethe crypto engine to use for underlying hash operations
localthe first existing fingerprint to include in the bilateral fingerprint
remotethe second existing fingerprint to include in the bilateral fingerprint
typethe type of fingerprint algorithm to use when processing local/remote
Returns
A unique fingerprint representing the combination of local/remote

◆ wickr_fingerprint_get_b32()

wickr_buffer_t* wickr_fingerprint_get_b32 ( const wickr_fingerprint_t fingerprint,
wickr_fingerprint_output  output_mode 
)

Get a base32 representation of a fingerprint

Parameters
fingerprintthe fingerprint to get the base32 representation of
output_modethe output mode of the base32 representation (short/long)
Returns
A string buffer containing a base32 representation of 'fingerprint' that is null terminatied

◆ wickr_fingerprint_get_hex()

wickr_buffer_t* wickr_fingerprint_get_hex ( const wickr_fingerprint_t fingerprint,
wickr_fingerprint_output  output_mode 
)

Get a hex representation of a fingerprint

Parameters
fingerprintthe fingerprint to get the hex representation of
output_modethe output mode of the base32 representation (short/long)
Returns
A string buffer containing a hex representation of 'fingerprint' that is null terminatied