KEYGEN: add const modifiers where possible

This commit is contained in:
hasufell 2014-06-09 18:41:03 +02:00
parent 56484e939a
commit d1cc3bc524
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
2 changed files with 18 additions and 18 deletions

View File

@ -45,10 +45,10 @@
bool
ntru_create_keypair(
fmpz_poly_t f,
fmpz_poly_t g,
const fmpz_poly_t f,
const fmpz_poly_t g,
keypair *pair,
ntru_params *params)
const ntru_params *params)
{
bool retval = false;
fmpz_poly_t Fq,
@ -94,8 +94,8 @@ _return:
void
export_public_key(char const * const filename,
fmpz_poly_t pub,
ntru_params *params)
const fmpz_poly_t pub,
const ntru_params *params)
{
string *pub_string;
@ -109,8 +109,8 @@ export_public_key(char const * const filename,
void
export_priv_key(char const * const filename,
fmpz_poly_t priv,
ntru_params *params)
const fmpz_poly_t priv,
const ntru_params *params)
{
string *priv_string;
fmpz_poly_t priv_u;
@ -131,7 +131,7 @@ export_priv_key(char const * const filename,
void
import_public_key(char const * const filename,
fmpz_poly_t pub,
ntru_params *params)
const ntru_params *params)
{
string *pub_string;
fmpz_poly_t **imported;
@ -157,7 +157,7 @@ void
import_priv_key(char const * const filename,
fmpz_poly_t priv,
fmpz_poly_t priv_inv,
ntru_params *params)
const ntru_params *params)
{
string *pub_string;
fmpz_poly_t **imported,

View File

@ -76,10 +76,10 @@ struct keypair {
*/
bool
ntru_create_keypair(
fmpz_poly_t f,
fmpz_poly_t g,
const fmpz_poly_t f,
const fmpz_poly_t g,
keypair *pair,
ntru_params *params);
const ntru_params *params);
/**
* Export the public key to a file.
@ -90,8 +90,8 @@ ntru_create_keypair(
*/
void
export_public_key(char const * const filename,
fmpz_poly_t pub,
ntru_params *params);
const fmpz_poly_t pub,
const ntru_params *params);
/**
* Export the private key to a file.
@ -102,8 +102,8 @@ export_public_key(char const * const filename,
*/
void
export_priv_key(char const * const filename,
fmpz_poly_t priv,
ntru_params *params);
const fmpz_poly_t priv,
const ntru_params *params);
/**
* Import the public key from a file.
@ -114,7 +114,7 @@ export_priv_key(char const * const filename,
void
import_public_key(char const * const filename,
fmpz_poly_t pub,
ntru_params *params);
const ntru_params *params);
/**
* Import the private key from a file and store him
@ -129,7 +129,7 @@ void
import_priv_key(char const * const filename,
fmpz_poly_t priv,
fmpz_poly_t priv_inv,
ntru_params *params);
const ntru_params *params);
/**
* Used to free the inner structure