23 #ifndef NOISE_SIGNSTATE_H
24 #define NOISE_SIGNSTATE_H
59 (
const NoiseSignState *state,
const uint8_t *message,
size_t message_len,
62 (
const NoiseSignState *state,
const uint8_t *message,
size_t message_len,
67 char *buffer,
size_t len);
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.
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.
Internal structure of the NoiseSignState type.
uint8_t * public_key
Points to the public key in the subclass state.
int noise_signstate_new_by_name(NoiseSignState **state, const char *name)
Creates a new SignState object by its algorithm name.
size_t noise_signstate_get_private_key_length(const NoiseSignState *state)
Gets the length of the private key for a SignState object.
int noise_signstate_get_max_key_length(void)
Gets the maximum length of signing keys for the supported algorithms.
size_t noise_signstate_get_public_key_length(const NoiseSignState *state)
Gets the length of the public key for a SignState object.
int noise_signstate_free(NoiseSignState *state)
Frees a SignState object after destroying all sensitive material.
int noise_signstate_get_sign_id(const NoiseSignState *state)
Gets the algorithm identifier for a SignState object.
int noise_signstate_has_public_key(const NoiseSignState *state)
Determine if a SignState object contains a public key.
int noise_signstate_get_max_signature_length(void)
Gets the maximum length of signatures for the supported algorithms.
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.
size_t noise_signstate_get_signature_length(const NoiseSignState *state)
Gets the length of the signature for a SignState object.
int noise_signstate_new_by_id(NoiseSignState **state, int id)
Creates a new SignState object by its algorithm identifier.
uint16_t private_key_len
Length of the private key for this algorithm in bytes.
uint8_t * private_key
Points to the private key in the subclass state.
uint16_t public_key_len
Length of the public key for this algorithm in bytes.
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.
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.
int noise_signstate_generate_keypair(NoiseSignState *state)
Generates a new key pair within a SignState object.
uint16_t signature_len
Length of the signature for this algorithm in bytes.
int noise_signstate_clear_key(NoiseSignState *state)
Clears the key in a SignState object.
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.
int noise_signstate_has_keypair(const NoiseSignState *state)
Determine if a SignState object contains a keypair.
int noise_signstate_copy(NoiseSignState *state, const NoiseSignState *from)
Copies the keys from one SignState object to another.
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.
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.