wickr-crypto-c
Data Structures | Functions
wickr_ec_curve_t

Data Structures

struct  wickr_ec_curve
 Metadata about curve types to help with key generation, and signatures. More...
 
struct  wickr_ec_key
 Representation of public and private Elliptic Curve Keypair information as buffers. More...
 

Functions

wickr_ec_key_twickr_ec_key_create (wickr_ec_curve_t curve, wickr_buffer_t *pub_data, wickr_buffer_t *pri_data)
 
wickr_ec_key_twickr_ec_key_copy (const wickr_ec_key_t *source)
 
void wickr_ec_key_destroy (wickr_ec_key_t **key)
 
const wickr_ec_curve_twickr_ec_curve_find (uint8_t identifier)
 

Detailed Description

Function Documentation

◆ wickr_ec_curve_find()

const wickr_ec_curve_t* wickr_ec_curve_find ( uint8_t  identifier)

Find an EC key by numerical identifier

Parameters
identifierthe identifier in which to return the curve information for
Returns
the requested curve information, or NULL if no matching information can be found

◆ wickr_ec_key_copy()

wickr_ec_key_t* wickr_ec_key_copy ( const wickr_ec_key_t source)

Copy an EC Key

Parameters
sourcethe EC key to copy
Returns
a newly allocated EC key holding a deep copy of the properties of 'source'

◆ wickr_ec_key_create()

wickr_ec_key_t* wickr_ec_key_create ( wickr_ec_curve_t  curve,
wickr_buffer_t pub_data,
wickr_buffer_t pri_data 
)

Create an Elliptic Curve Keypair from components

NOTE: This function does not have the capability to generate key pair information, it simply constructs the data structure using pre-generated components. A crypto engine is required to generate random keypairs

Parameters
curvesee 'wickr_ec_key' property documentation
pub_datasee 'wickr_ec_key' property documentation
pri_datasee 'wickr_ec_key' property documentation. May be NULL to represent a public key
Returns
a newly allocated elliptic curve key representing either a public or private key. Takes ownership of the passed inputs

◆ wickr_ec_key_destroy()

void wickr_ec_key_destroy ( wickr_ec_key_t **  key)

Destroy an EC Key

Parameters
keya pointer to the key to destroy. All properties of '*key' will also be destroyed