wickr-crypto-c
Data Structures | Functions
Wickr_ecdsa_result

Data Structures

struct  wickr_ecdsa_result
 Elliptic Curve Digital Signature Algorithm Result. More...
 

Functions

wickr_ecdsa_result_twickr_ecdsa_result_create (wickr_ec_curve_t curve, wickr_digest_t digest_mode, wickr_buffer_t *sig_data)
 
wickr_buffer_twickr_ecdsa_result_serialize (const wickr_ecdsa_result_t *result)
 
wickr_ecdsa_result_twickr_ecdsa_result_create_from_buffer (const wickr_buffer_t *buffer)
 
wickr_ecdsa_result_twickr_ecdsa_result_copy (const wickr_ecdsa_result_t *source)
 
void wickr_ecdsa_result_destroy (wickr_ecdsa_result_t **result)
 

Detailed Description

Function Documentation

◆ wickr_ecdsa_result_copy()

wickr_ecdsa_result_t* wickr_ecdsa_result_copy ( const wickr_ecdsa_result_t source)

Copy an ECDSA result

Parameters
sourcethe ECDSA result to copy
Returns
a newly allocated ECDSA result holding a deep copy of the properties of 'source'

◆ wickr_ecdsa_result_create()

wickr_ecdsa_result_t* wickr_ecdsa_result_create ( wickr_ec_curve_t  curve,
wickr_digest_t  digest_mode,
wickr_buffer_t sig_data 
)

Create an ECDSA result from components

Parameters
curvesee 'wickr_ecdsa_result' property documentation
digest_modesee 'wickr_ecdsa_result' property documentation
sig_datasee 'wickr_ecdsa_result' property documentation property documentation
Returns
a newly allocated ECDSA result owning the properties passed in

◆ wickr_ecdsa_result_create_from_buffer()

wickr_ecdsa_result_t* wickr_ecdsa_result_create_from_buffer ( const wickr_buffer_t buffer)

Create an ECDSA result from a serialized ECDSA result buffer

Parameters
buffera buffer containing a serialized ECDSA result buffer
Returns
ecdsa result parsed from 'buffer'. This function makes a copy of all bytes as it is parsing, so the resulting ECDSA result owns its properties. Returns NULL on parsing failure

◆ wickr_ecdsa_result_destroy()

void wickr_ecdsa_result_destroy ( wickr_ecdsa_result_t **  result)

Destroy an ECDSA result

Parameters
resulta pointer to the result to destroy. All properties of '*result' will also be destroyed

◆ wickr_ecdsa_result_serialize()

wickr_buffer_t* wickr_ecdsa_result_serialize ( const wickr_ecdsa_result_t result)

Serialize an ECDSA result into a buffer

Parameters
resultthe ecdsa result to serialize
Returns
a newly allocated buffer with serialized ECDSA result properties in the following format | CURVE_ID DIGEST_ID | SIG_DATA |. NOTE that CURVE_ID and DIGEST_ID are packed into 1 byte as 4 bit unsigned integers