|
PQLR_API kryzhovnik_t | kryzhovnik_new (kryzhovnik_parameterset_t parameterset) |
| Creates new kryzhovnik instance with selected parameter set. More...
|
|
PQLR_API void | kryzhovnik_free (kryzhovnik_t kryzhovnik) |
| Frees kryzhovnik instance and all corresponding resources. More...
|
|
PQLR_API kryzhovnik_t | kryzhovnik_duplicate (const kryzhovnik_t kryzhovnik) |
| Duplicates context of kryzhovnik instance. More...
|
|
PQLR_API pqlr_t | kryzhovnik_to_pqlr (kryzhovnik_t kryzhovnik) |
| Casts kryzhovnik instance to pqlr instance. More...
|
|
PQLR_API size_t | kryzhovnik_get_public_key_bytes_len (const kryzhovnik_t kryzhovnik) |
| Obtains public key buffer length in bytes for current kryzhovnik instance. More...
|
|
PQLR_API size_t | kryzhovnik_get_secret_key_bytes_len (const kryzhovnik_t kryzhovnik) |
| Obtains secret key buffer length in bytes for current kryzhovnik instance. More...
|
|
PQLR_API size_t | kryzhovnik_get_signature_bytes_len (kryzhovnik_t kryzhovnik) |
| Obtains signature buffer length in bytes for current kryzhovnik instance. More...
|
|
PQLR_API void | kryzhovnik_generate_keys (const kryzhovnik_t kryzhovnik, uint8_t *result_sk, uint8_t *result_pk) |
| Generates random secret key and public key for given context. More...
|
|
PQLR_API void | kryzhovnik_sign (const kryzhovnik_t kryzhovnik, 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 | kryzhovnik_verify (const kryzhovnik_t kryzhovnik, 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 Kryzhovnik algorithm implementation, whose security is based on the hardness of finding short vectors in lattices.
After there are no more need in signature scheme it's resources must be made free by kryzhovnik_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* 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);
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 void kryzhovnik_generate_keys(const kryzhovnik_t kryzhovnik, uint8_t *result_sk, uint8_t *result_pk)
Generates random secret key and public key for given context.
PQLR_API void kryzhovnik_sign(const kryzhovnik_t kryzhovnik, 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 size_t kryzhovnik_get_public_key_bytes_len(const kryzhovnik_t kryzhovnik)
Obtains public key buffer length in bytes for current kryzhovnik instance.
PQLR_API kryzhovnik_t kryzhovnik_new(kryzhovnik_parameterset_t parameterset)
Creates new kryzhovnik instance with selected parameter set.
PQLR_API size_t kryzhovnik_get_secret_key_bytes_len(const kryzhovnik_t kryzhovnik)
Obtains secret key buffer length in bytes for current kryzhovnik instance.
PQLR_API size_t kryzhovnik_get_signature_bytes_len(kryzhovnik_t kryzhovnik)
Obtains signature buffer length in bytes for current kryzhovnik instance.
struct kryzhovnik_st * kryzhovnik_t
kryzhovnik algorithm instance handle
Definition: kryzhovnik.h:51
PQLR_API int kryzhovnik_verify(const kryzhovnik_t kryzhovnik, 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.
PQLR_API void kryzhovnik_free(kryzhovnik_t kryzhovnik)
Frees kryzhovnik instance and all corresponding resources.
@ kryzhovnik_default
Definition: kryzhovnik.h:44