X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/2bdb833f485d3c985a0f930865452fcaafdf95dd..80be023065ced106a4078a36371c135a60d2bd6c:/dh-fetch.c diff --git a/dh-fetch.c b/dh-fetch.c index 7a7e18c..5f5c74d 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.3 2004/04/08 01:36:15 mdw Exp $ * * Key fetching for Diffie-Hellman public and private keys * @@ -27,14 +27,6 @@ * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: dh-fetch.c,v $ - * Revision 1.1 2000/06/17 10:41:45 mdw - * Table for driving key data extraction. - * - */ - /*----- Header files ------------------------------------------------------*/ #include "dh.h" @@ -71,4 +63,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 -------------------------------------------------*/