KEYGEN: add deletion method

This commit is contained in:
hasufell 2014-05-25 04:06:24 +02:00
parent 3ea4006b1c
commit c3eb0e52f4
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
2 changed files with 15 additions and 0 deletions

View File

@ -90,3 +90,16 @@ cleanup:
return retval;
}
/**
* Used to free the inner structure
* of a keypair. This will not call free()
* on the pair itself.
*
* @param pair the pair to free the inner structure of
*/
void ntru_delete_keypair(keypair *pair)
{
fmpz_poly_clear(pair->priv_inv);
fmpz_poly_clear(pair->priv);
fmpz_poly_clear(pair->pub);
}

View File

@ -68,5 +68,7 @@ bool ntru_create_keypair(
keypair *pair,
ntru_context *ctx);
void ntru_delete_keypair(keypair *pair);
#endif /* NTRU_KEYPAIR_H */