diff --git a/src/keypair.c b/src/keypair.c index 8f3dd4d..bd608f5 100644 --- a/src/keypair.c +++ b/src/keypair.c @@ -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); +} diff --git a/src/keypair.h b/src/keypair.h index 680ef12..71f0154 100644 --- a/src/keypair.h +++ b/src/keypair.h @@ -68,5 +68,7 @@ bool ntru_create_keypair( keypair *pair, ntru_context *ctx); +void ntru_delete_keypair(keypair *pair); + #endif /* NTRU_KEYPAIR_H */