3#include "mbedtls/ecdsa.h"
9#define PUB_KEY_SER_LEN 65
18ssize_t ser_pub_key(
unsigned char *dest, mbedtls_ecp_point *key);
28unsigned char *ser_pub_key_alloc(ssize_t *written, mbedtls_ecp_point *key);
37ssize_t deser_pub_key(mbedtls_ecp_point *dest,
unsigned char *src);
46mbedtls_ecp_point *deser_pub_key_alloc(ssize_t *read,
unsigned char *src);
52#define PRIV_KEY_SER_LEN 32
61ssize_t ser_priv_key(
unsigned char *dest, mbedtls_mpi *key);
71unsigned char *ser_priv_key_alloc(ssize_t *written, mbedtls_mpi *key);
80ssize_t deser_priv_key(mbedtls_mpi *dest,
unsigned char *src);
89mbedtls_mpi *deser_priv_key_alloc(ssize_t *read,
unsigned char *src);
95#define KEYPAIR_SER_LEN PUB_KEY_SER_LEN + PRIV_KEY_SER_LEN
104ssize_t ser_keypair(
unsigned char *dest, mbedtls_ecdsa_context *keypair);
114unsigned char *ser_keypair_alloc(ssize_t *written, mbedtls_ecdsa_context *keypair);
123ssize_t deser_keypair(mbedtls_ecdsa_context *dest,
unsigned char *src);
132mbedtls_ecdsa_context *deser_keypair_alloc(ssize_t *read,
unsigned char *src);