PQLR
Postquantum Crypto Library by QAPP
dilithium.h File Reference
#include "pqlr/common/pqlr.h"
#include "pqlr/common/api.h"
#include "stdint.h"
#include "stddef.h"

Go to the source code of this file.

Typedefs

typedef struct dilithium_st * dilithium_t
 Dilithium algorithm instance handle. More...
 

Enumerations

enum  dilithium_parameterset_t {
  dilithium_2 , dilithium_3 , dilithium_5 , dilithium_2_r ,
  dilithium_3_r , dilithium_5_r , dilithium_last
}
 Possible dilithium parameters sets. More...
 

Functions

PQLR_API dilithium_t dilithium_new (dilithium_parameterset_t parameterset)
 Creates new dilithium instance with selected parameter set. More...
 
PQLR_API void dilithium_free (dilithium_t dilithium)
 Frees dilithium instance and all corresponding resources. More...
 
PQLR_API dilithium_t dilithium_duplicate (const dilithium_t dilithium)
 Duplicates context of dilithium instance. More...
 
PQLR_API pqlr_t dilithium_to_pqlr (dilithium_t dilithium)
 Casts dilithium instance to pqlr instance. More...
 
PQLR_API size_t dilithium_get_public_key_bytes_len (const dilithium_t dilithium)
 Obtains public key buffer length in bytes for current dilithium instance. More...
 
PQLR_API size_t dilithium_get_secret_key_bytes_len (const dilithium_t dilithium)
 Obtains secret key buffer length in bytes for current dilithium instance. More...
 
PQLR_API size_t dilithium_get_signature_bytes_len (dilithium_t dilithium)
 Obtains signature buffer length in bytes for current dilithium instance. More...
 
PQLR_API void dilithium_generate_keys (const dilithium_t dilithium, uint8_t *result_sk, uint8_t *result_pk)
 Generates random secret key and public key for given context. More...
 
PQLR_API void dilithium_sign (const dilithium_t dilithium, 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 dilithium_verify (const dilithium_t dilithium, 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...