Noise-C
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Typedefs | Functions
signstate.h File Reference

SignState interface. More...

#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Typedefs

typedef struct NoiseSignState_s NoiseSignState
 Opaque object that represents a SignState. More...
 

Functions

int noise_signstate_clear_key (NoiseSignState *state)
 Clears the key in a SignState object. More...
 
int noise_signstate_copy (NoiseSignState *state, const NoiseSignState *from)
 Copies the keys from one SignState object to another. More...
 
int noise_signstate_format_fingerprint (const NoiseSignState *state, int fingerprint_type, char *buffer, size_t len)
 Formats the public key fingerprint for the key within a SignState. More...
 
int noise_signstate_free (NoiseSignState *state)
 Frees a SignState object after destroying all sensitive material. More...
 
int noise_signstate_generate_keypair (NoiseSignState *state)
 Generates a new key pair within a SignState object. More...
 
int noise_signstate_get_keypair (const NoiseSignState *state, uint8_t *private_key, size_t private_key_len, uint8_t *public_key, size_t public_key_len)
 Gets the keypair from within a SignState object. More...
 
int noise_signstate_get_max_key_length (void)
 Gets the maximum length of signing keys for the supported algorithms. More...
 
int noise_signstate_get_max_signature_length (void)
 Gets the maximum length of signatures for the supported algorithms. More...
 
size_t noise_signstate_get_private_key_length (const NoiseSignState *state)
 Gets the length of the private key for a SignState object. More...
 
int noise_signstate_get_public_key (const NoiseSignState *state, uint8_t *public_key, size_t public_key_len)
 Gets the public key value from a SignState object. More...
 
size_t noise_signstate_get_public_key_length (const NoiseSignState *state)
 Gets the length of the public key for a SignState object. More...
 
int noise_signstate_get_sign_id (const NoiseSignState *state)
 Gets the algorithm identifier for a SignState object. More...
 
size_t noise_signstate_get_signature_length (const NoiseSignState *state)
 Gets the length of the signature for a SignState object. More...
 
int noise_signstate_has_keypair (const NoiseSignState *state)
 Determine if a SignState object contains a keypair. More...
 
int noise_signstate_has_public_key (const NoiseSignState *state)
 Determine if a SignState object contains a public key. More...
 
int noise_signstate_new_by_id (NoiseSignState **state, int id)
 Creates a new SignState object by its algorithm identifier. More...
 
int noise_signstate_new_by_name (NoiseSignState **state, const char *name)
 Creates a new SignState object by its algorithm name. More...
 
int noise_signstate_set_keypair (NoiseSignState *state, const uint8_t *private_key, size_t private_key_len, const uint8_t *public_key, size_t public_key_len)
 Sets the keypair within a SignState object. More...
 
int noise_signstate_set_keypair_private (NoiseSignState *state, const uint8_t *private_key, size_t private_key_len)
 Sets the keypair within a SignState object based on a private key only. More...
 
int noise_signstate_set_public_key (NoiseSignState *state, const uint8_t *public_key, size_t public_key_len)
 Sets the public key in a SignState object. More...
 
int noise_signstate_sign (const NoiseSignState *state, const uint8_t *message, size_t message_len, uint8_t *signature, size_t signature_len)
 Signs a message to create a digital signature. More...
 
int noise_signstate_verify (const NoiseSignState *state, const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len)
 Verifies a digital signature on a message. More...
 

Detailed Description

SignState interface.

Definition in file signstate.h.