|
PQLR_API shipovnik_t | shipovnik_new (shipovnik_parameterset_t parameterset) |
| Creates new shipovnik instance with selected parameter set. More...
|
|
PQLR_API void | shipovnik_free (shipovnik_t shipovnik) |
| Frees shipovnik instance and all corresponding resources. More...
|
|
PQLR_API shipovnik_t | shipovnik_duplicate (const shipovnik_t shipovnik) |
| Duplicates context of shipovnik instance. More...
|
|
PQLR_API pqlr_t | shipovnik_to_pqlr (shipovnik_t shipovnik) |
| Casts shipovnik instance to pqlr instance. More...
|
|
PQLR_API size_t | shipovnik_get_public_key_bytes_len (const shipovnik_t shipovnik) |
| Obtains public key buffer length in bytes for current shipovnik instance. More...
|
|
PQLR_API size_t | shipovnik_get_secret_key_bytes_len (const shipovnik_t shipovnik) |
| Obtains secret key buffer length in bytes for current shipovnik instance. More...
|
|
PQLR_API size_t | shipovnik_get_signature_bytes_len (shipovnik_t shipovnik) |
| Obtains signature buffer length in bytes for current shipovnik instance. More...
|
|
PQLR_API void | shipovnik_generate_keys (const shipovnik_t shipovnik, uint8_t *result_sk, uint8_t *result_pk) |
| Generates random secret key and public key for given context. More...
|
|
PQLR_API void | shipovnik_sign (const shipovnik_t shipovnik, const uint8_t *sk, const uint8_t *msg, size_t msg_len, uint8_t *result_sig, size_t *result_sig_len) |
| Generates signature for given message according to context and secret key. More...
|
|
PQLR_API int | shipovnik_verify (const shipovnik_t shipovnik, const uint8_t *pk, const uint8_t *sig, size_t sig_len, const uint8_t *msg, size_t msg_len) |
| Verifies that given signature is the signature of given message. More...
|
|
This module provides Shipovnik algorithm, whose security is implemented using operations on error-correcting codes defined on a final two-element prime field.
After there is no more need in signature scheme it's resources must be made free by shipovnik_free.
#include <stdlib.h>
void use_new(void)
{
}
void use_generate_keys(void)
{
uint8_t* sk = (uint8_t*)calloc(sk_len, sizeof(uint8_t));
uint8_t* pk = (uint8_t*)calloc(pk_len, sizeof(uint8_t));
free(pk);
free(sk);
}
void use_sign(void)
{
uint8_t* sk = (uint8_t*)calloc(sk_len, sizeof(uint8_t));
uint8_t* sig = (uint8_t*)calloc(sig_len, sizeof(uint8_t));
unsigned char msg[] = "test";
free(sig);
free(sk);
}
void use_verify(void)
{
uint8_t* pk = (uint8_t*)calloc(pk_len, sizeof(uint8_t));
uint8_t* sig = (uint8_t*)calloc(sig_len, sizeof(uint8_t));
unsigned char msg[] = "test";
free(sig);
free(pk);
}
int main(void)
{
use_new();
use_generate_keys();
use_sign();
use_verify();
}
PQLR_API int shipovnik_verify(const shipovnik_t shipovnik, const uint8_t *pk, const uint8_t *sig, size_t sig_len, const uint8_t *msg, size_t msg_len)
Verifies that given signature is the signature of given message.
struct shipovnik_st * shipovnik_t
Shipovnik algorithm instance handle.
Definition: shipovnik.h:55
PQLR_API size_t shipovnik_get_public_key_bytes_len(const shipovnik_t shipovnik)
Obtains public key buffer length in bytes for current shipovnik instance.
PQLR_API size_t shipovnik_get_signature_bytes_len(shipovnik_t shipovnik)
Obtains signature buffer length in bytes for current shipovnik instance.
PQLR_API void shipovnik_sign(const shipovnik_t shipovnik, const uint8_t *sk, const uint8_t *msg, size_t msg_len, uint8_t *result_sig, size_t *result_sig_len)
Generates signature for given message according to context and secret key.
PQLR_API void shipovnik_free(shipovnik_t shipovnik)
Frees shipovnik instance and all corresponding resources.
PQLR_API shipovnik_t shipovnik_new(shipovnik_parameterset_t parameterset)
Creates new shipovnik instance with selected parameter set.
PQLR_API void shipovnik_generate_keys(const shipovnik_t shipovnik, uint8_t *result_sk, uint8_t *result_pk)
Generates random secret key and public key for given context.
PQLR_API size_t shipovnik_get_secret_key_bytes_len(const shipovnik_t shipovnik)
Obtains secret key buffer length in bytes for current shipovnik instance.
@ shipovnik_default
Definition: shipovnik.h:46