X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/2bdb833f485d3c985a0f930865452fcaafdf95dd..2685767a6125c1620719c7de6234aedf41857b7e:/dh-fetch.c diff --git a/dh-fetch.c b/dh-fetch.c index 7a7e18c..2f25122 100644 --- a/dh-fetch.c +++ b/dh-fetch.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: dh-fetch.c,v 1.1 2000/06/17 10:41:45 mdw Exp $ + * $Id: dh-fetch.c,v 1.2 2000/07/01 11:19:22 mdw Exp $ * * Key fetching for Diffie-Hellman public and private keys * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: dh-fetch.c,v $ + * Revision 1.2 2000/07/01 11:19:22 mdw + * New functions for freeing public and private keys. + * * Revision 1.1 2000/06/17 10:41:45 mdw * Table for driving key data extraction. * @@ -71,4 +74,38 @@ const key_fetchdef dh_privfetch[] = { { 0, 0, 0, 0 } }; +/* --- @dh_paramfree@, @dh_pubfree@, @dh_privfree@ --- * + * + * Arguments: @dh_param *dp@, @dh_pub *dp@, @dh_priv *dp@ = pointer + * to key block to free + * + * Returns: --- + * + * Use: Frees a Diffie-Hellman key block. + */ + +void dh_paramfree(dh_param *dp) +{ + mp_drop(dp->p); + mp_drop(dp->q); + mp_drop(dp->g); +} + +void dh_pubfree(dh_pub *dp) +{ + mp_drop(dp->dp.p); + mp_drop(dp->dp.q); + mp_drop(dp->dp.g); + mp_drop(dp->y); +} + +void dh_privfree(dh_priv *dp) +{ + mp_drop(dp->dp.p); + mp_drop(dp->dp.q); + mp_drop(dp->dp.g); + mp_drop(dp->y); + mp_drop(dp->x); +} + /*----- That's all, folks -------------------------------------------------*/