cecies
Functions
keygen.h File Reference

Curve25519 and Curve448 key-pair generators (both export their output into NUL-terminated, hex-encoded strings). More...

#include <time.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include "util.h"
#include "types.h"
Include dependency graph for keygen.h:

Go to the source code of this file.

Functions

CECIES_API int cecies_generate_curve25519_keypair (cecies_curve25519_keypair *output, const uint8_t *additional_entropy, size_t additional_entropy_length)
 
CECIES_API int cecies_generate_curve448_keypair (cecies_curve448_keypair *output, const uint8_t *additional_entropy, size_t additional_entropy_length)
 

Detailed Description

Curve25519 and Curve448 key-pair generators (both export their output into NUL-terminated, hex-encoded strings).

Author
Raphael Beck

Function Documentation

◆ cecies_generate_curve25519_keypair()

CECIES_API int cecies_generate_curve25519_keypair ( cecies_curve25519_keypair output,
const uint8_t *  additional_entropy,
size_t  additional_entropy_length 
)

Generates a CECIES Curve25519 keypair and writes it into the specified output buffers.

Parameters
outputThe cecies_curve25519_keypair instance into which to write the generated key-pair.
additional_entropy[OPTIONAL] Additional entropy bytes for the CSPRNG. Can be set to NULL if you wish not to add custom entropy.
additional_entropy_length[OPTIONAL] Length of the additional_entropy array. If additional_entropy is NULL, this value is ignored.
Returns
0 if key generation succeeded; error codes as defined inside the header file or MbedTLS otherwise.

◆ cecies_generate_curve448_keypair()

CECIES_API int cecies_generate_curve448_keypair ( cecies_curve448_keypair output,
const uint8_t *  additional_entropy,
size_t  additional_entropy_length 
)

Generates a CECIES Curve448 keypair and writes it into the specified output buffers.

Parameters
outputThe cecies_curve448_keypair instance into which to write the generated key-pair.
additional_entropy[OPTIONAL] Additional entropy bytes for the CSPRNG. Can be set to NULL if you wish not to add custom entropy.
additional_entropy_length[OPTIONAL] Length of the additional_entropy array. If additional_entropy is NULL, this value is ignored.
Returns
0 if key generation succeeded; error codes as defined inside the header file or MbedTLS otherwise.