KEYGEN: add const modifiers where possible
This commit is contained in:
parent
56484e939a
commit
d1cc3bc524
@ -45,10 +45,10 @@
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
ntru_create_keypair(
|
ntru_create_keypair(
|
||||||
fmpz_poly_t f,
|
const fmpz_poly_t f,
|
||||||
fmpz_poly_t g,
|
const fmpz_poly_t g,
|
||||||
keypair *pair,
|
keypair *pair,
|
||||||
ntru_params *params)
|
const ntru_params *params)
|
||||||
{
|
{
|
||||||
bool retval = false;
|
bool retval = false;
|
||||||
fmpz_poly_t Fq,
|
fmpz_poly_t Fq,
|
||||||
@ -94,8 +94,8 @@ _return:
|
|||||||
|
|
||||||
void
|
void
|
||||||
export_public_key(char const * const filename,
|
export_public_key(char const * const filename,
|
||||||
fmpz_poly_t pub,
|
const fmpz_poly_t pub,
|
||||||
ntru_params *params)
|
const ntru_params *params)
|
||||||
{
|
{
|
||||||
string *pub_string;
|
string *pub_string;
|
||||||
|
|
||||||
@ -109,8 +109,8 @@ export_public_key(char const * const filename,
|
|||||||
|
|
||||||
void
|
void
|
||||||
export_priv_key(char const * const filename,
|
export_priv_key(char const * const filename,
|
||||||
fmpz_poly_t priv,
|
const fmpz_poly_t priv,
|
||||||
ntru_params *params)
|
const ntru_params *params)
|
||||||
{
|
{
|
||||||
string *priv_string;
|
string *priv_string;
|
||||||
fmpz_poly_t priv_u;
|
fmpz_poly_t priv_u;
|
||||||
@ -131,7 +131,7 @@ export_priv_key(char const * const filename,
|
|||||||
void
|
void
|
||||||
import_public_key(char const * const filename,
|
import_public_key(char const * const filename,
|
||||||
fmpz_poly_t pub,
|
fmpz_poly_t pub,
|
||||||
ntru_params *params)
|
const ntru_params *params)
|
||||||
{
|
{
|
||||||
string *pub_string;
|
string *pub_string;
|
||||||
fmpz_poly_t **imported;
|
fmpz_poly_t **imported;
|
||||||
@ -157,7 +157,7 @@ void
|
|||||||
import_priv_key(char const * const filename,
|
import_priv_key(char const * const filename,
|
||||||
fmpz_poly_t priv,
|
fmpz_poly_t priv,
|
||||||
fmpz_poly_t priv_inv,
|
fmpz_poly_t priv_inv,
|
||||||
ntru_params *params)
|
const ntru_params *params)
|
||||||
{
|
{
|
||||||
string *pub_string;
|
string *pub_string;
|
||||||
fmpz_poly_t **imported,
|
fmpz_poly_t **imported,
|
||||||
|
@ -76,10 +76,10 @@ struct keypair {
|
|||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ntru_create_keypair(
|
ntru_create_keypair(
|
||||||
fmpz_poly_t f,
|
const fmpz_poly_t f,
|
||||||
fmpz_poly_t g,
|
const fmpz_poly_t g,
|
||||||
keypair *pair,
|
keypair *pair,
|
||||||
ntru_params *params);
|
const ntru_params *params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export the public key to a file.
|
* Export the public key to a file.
|
||||||
@ -90,8 +90,8 @@ ntru_create_keypair(
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
export_public_key(char const * const filename,
|
export_public_key(char const * const filename,
|
||||||
fmpz_poly_t pub,
|
const fmpz_poly_t pub,
|
||||||
ntru_params *params);
|
const ntru_params *params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export the private key to a file.
|
* Export the private key to a file.
|
||||||
@ -102,8 +102,8 @@ export_public_key(char const * const filename,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
export_priv_key(char const * const filename,
|
export_priv_key(char const * const filename,
|
||||||
fmpz_poly_t priv,
|
const fmpz_poly_t priv,
|
||||||
ntru_params *params);
|
const ntru_params *params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Import the public key from a file.
|
* Import the public key from a file.
|
||||||
@ -114,7 +114,7 @@ export_priv_key(char const * const filename,
|
|||||||
void
|
void
|
||||||
import_public_key(char const * const filename,
|
import_public_key(char const * const filename,
|
||||||
fmpz_poly_t pub,
|
fmpz_poly_t pub,
|
||||||
ntru_params *params);
|
const ntru_params *params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Import the private key from a file and store him
|
* Import the private key from a file and store him
|
||||||
@ -129,7 +129,7 @@ void
|
|||||||
import_priv_key(char const * const filename,
|
import_priv_key(char const * const filename,
|
||||||
fmpz_poly_t priv,
|
fmpz_poly_t priv,
|
||||||
fmpz_poly_t priv_inv,
|
fmpz_poly_t priv_inv,
|
||||||
ntru_params *params);
|
const ntru_params *params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to free the inner structure
|
* Used to free the inner structure
|
||||||
|
Loading…
Reference in New Issue
Block a user