* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
* Catacomb is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
* Catacomb is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
* You should have received a copy of the GNU Library General Public
* License along with Catacomb; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
* You should have received a copy of the GNU Library General Public
* License along with Catacomb; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
{ "g", offsetof(dh_priv, dp.g), KENC_MP, 0 },
{ "y", offsetof(dh_priv, y), KENC_MP, 0 },
{ "private", 0, KENC_STRUCT, priv },
{ "g", offsetof(dh_priv, dp.g), KENC_MP, 0 },
{ "y", offsetof(dh_priv, y), KENC_MP, 0 },
{ "private", 0, KENC_STRUCT, priv },
+/* --- @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);
+}
+