From: mdw Date: Sat, 17 Jun 2000 10:41:45 +0000 (+0000) Subject: Table for driving key data extraction. X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/commitdiff_plain/2bdb833f485d3c985a0f930865452fcaafdf95dd?hp=609df31a6a407092f7a92913c28b369d26e3a637 Table for driving key data extraction. --- diff --git a/bbs-fetch.c b/bbs-fetch.c new file mode 100644 index 0000000..87827bc --- /dev/null +++ b/bbs-fetch.c @@ -0,0 +1,62 @@ +/* -*-c-*- + * + * $Id: bbs-fetch.c,v 1.1 2000/06/17 10:41:45 mdw Exp $ + * + * Key fetching for BBS public and private keys + * + * (c) 2000 Straylight/Edgeware + */ + +/*----- Licensing notice --------------------------------------------------* + * + * This file is part of Catacomb. + * + * Catacomb is free software; you can redistribute it and/or modify + * 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. + * + * 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. + */ + +/*----- Revision history --------------------------------------------------* + * + * $Log: bbs-fetch.c,v $ + * Revision 1.1 2000/06/17 10:41:45 mdw + * Table for driving key data extraction. + * + */ + +/*----- Header files ------------------------------------------------------*/ + +#include "bbs.h" +#include "key.h" + +/*----- Key fetching ------------------------------------------------------*/ + +const key_fetchdef bbs_pubfetch[] = { + { "n", offsetof(bbs_pub, n), KENC_MP, 0 }, + { 0, 0, 0, 0 } +}; + +static const key_fetchdef priv[] = { + { "p", offsetof(bbs_priv, p), KENC_MP, 0 }, + { "q", offsetof(bbs_priv, q), KENC_MP, 0 }, + { 0, 0, 0, 0 } +}; + +const key_fetchdef bbs_privfetch[] = { + { "n", offsetof(bbs_priv, n), KENC_MP, 0 }, + { "private", 0, KENC_STRUCT, priv }, + { 0, 0, 0, 0 } +}; + +/*----- That's all, folks -------------------------------------------------*/ diff --git a/dh-fetch.c b/dh-fetch.c new file mode 100644 index 0000000..7a7e18c --- /dev/null +++ b/dh-fetch.c @@ -0,0 +1,74 @@ +/* -*-c-*- + * + * $Id: dh-fetch.c,v 1.1 2000/06/17 10:41:45 mdw Exp $ + * + * Key fetching for Diffie-Hellman public and private keys + * + * (c) 2000 Straylight/Edgeware + */ + +/*----- Licensing notice --------------------------------------------------* + * + * This file is part of Catacomb. + * + * Catacomb is free software; you can redistribute it and/or modify + * 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. + * + * 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. + */ + +/*----- 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" +#include "key.h" + +/*----- Key fetching ------------------------------------------------------*/ + +const key_fetchdef dh_paramfetch[] = { + { "p", offsetof(dh_param, p), KENC_MP, 0 }, + { "q", offsetof(dh_param, q), KENC_MP, 0 }, + { "g", offsetof(dh_param, g), KENC_MP, 0 }, + { 0, 0, 0, 0 } +}; + +const key_fetchdef dh_pubfetch[] = { + { "p", offsetof(dh_pub, dp.p), KENC_MP, 0 }, + { "q", offsetof(dh_pub, dp.q), KENC_MP, 0 }, + { "g", offsetof(dh_pub, dp.g), KENC_MP, 0 }, + { "y", offsetof(dh_pub, y), KENC_MP, 0 }, + { 0, 0, 0, 0 } +}; + +static const key_fetchdef priv[] = { + { "x", offsetof(dh_priv, x), KENC_MP, 0 }, + { 0, 0, 0, 0 } +}; + +const key_fetchdef dh_privfetch[] = { + { "p", offsetof(dh_priv, dp.p), KENC_MP, 0 }, + { "q", offsetof(dh_priv, dp.q), KENC_MP, 0 }, + { "g", offsetof(dh_priv, dp.g), KENC_MP, 0 }, + { "y", offsetof(dh_priv, y), KENC_MP, 0 }, + { "private", 0, KENC_STRUCT, priv }, + { 0, 0, 0, 0 } +}; + +/*----- That's all, folks -------------------------------------------------*/ diff --git a/dsa-fetch.c b/dsa-fetch.c new file mode 100644 index 0000000..440f80e --- /dev/null +++ b/dsa-fetch.c @@ -0,0 +1,74 @@ +/* -*-c-*- + * + * $Id: dsa-fetch.c,v 1.1 2000/06/17 10:41:45 mdw Exp $ + * + * Key fetching for DSA public and private keys + * + * (c) 2000 Straylight/Edgeware + */ + +/*----- Licensing notice --------------------------------------------------* + * + * This file is part of Catacomb. + * + * Catacomb is free software; you can redistribute it and/or modify + * 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. + * + * 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. + */ + +/*----- Revision history --------------------------------------------------* + * + * $Log: dsa-fetch.c,v $ + * Revision 1.1 2000/06/17 10:41:45 mdw + * Table for driving key data extraction. + * + */ + +/*----- Header files ------------------------------------------------------*/ + +#include "dsa.h" +#include "key.h" + +/*----- Key fetching ------------------------------------------------------*/ + +const key_fetchdef dsa_paramfetch[] = { + { "p", offsetof(dsa_param, p), KENC_MP, 0 }, + { "q", offsetof(dsa_param, q), KENC_MP, 0 }, + { "g", offsetof(dsa_param, g), KENC_MP, 0 }, + { 0, 0, 0, 0 } +}; + +const key_fetchdef dsa_pubfetch[] = { + { "p", offsetof(dsa_pub, dp.p), KENC_MP, 0 }, + { "q", offsetof(dsa_pub, dp.q), KENC_MP, 0 }, + { "g", offsetof(dsa_pub, dp.g), KENC_MP, 0 }, + { "y", offsetof(dsa_pub, y), KENC_MP, 0 }, + { 0, 0, 0, 0 } +}; + +static const key_fetchdef priv[] = { + { "x", offsetof(dsa_priv, x), KENC_MP, 0 }, + { 0, 0, 0, 0 } +}; + +const key_fetchdef dsa_privfetch[] = { + { "p", offsetof(dsa_priv, dp.p), KENC_MP, 0 }, + { "q", offsetof(dsa_priv, dp.q), KENC_MP, 0 }, + { "g", offsetof(dsa_priv, dp.g), KENC_MP, 0 }, + { "y", offsetof(dsa_priv, y), KENC_MP, 0 }, + { "private", 0, KENC_STRUCT, priv }, + { 0, 0, 0, 0 } +}; + +/*----- That's all, folks -------------------------------------------------*/ diff --git a/rsa-fetch.c b/rsa-fetch.c new file mode 100644 index 0000000..f3dcc1d --- /dev/null +++ b/rsa-fetch.c @@ -0,0 +1,68 @@ +/* -*-c-*- + * + * $Id: rsa-fetch.c,v 1.1 2000/06/17 10:41:45 mdw Exp $ + * + * Key fetching for RSA public and private keys + * + * (c) 2000 Straylight/Edgeware + */ + +/*----- Licensing notice --------------------------------------------------* + * + * This file is part of Catacomb. + * + * Catacomb is free software; you can redistribute it and/or modify + * 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. + * + * 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. + */ + +/*----- Revision history --------------------------------------------------* + * + * $Log: rsa-fetch.c,v $ + * Revision 1.1 2000/06/17 10:41:45 mdw + * Table for driving key data extraction. + * + */ + +/*----- Header files ------------------------------------------------------*/ + +#include "key.h" +#include "rsa.h" + +/*----- Key fetching ------------------------------------------------------*/ + +const key_fetchdef rsa_pubfetch[] = { + { "n", offsetof(rsa_pub, n), KENC_MP, 0 }, + { "e", offsetof(rsa_pub, e), KENC_MP, 0 }, + { 0, 0, 0, 0 } +}; + +static const key_fetchdef priv[] = { + { "p", offsetof(rsa_priv, p), KENC_MP, 0 }, + { "q", offsetof(rsa_priv, q), KENC_MP, 0 }, + { "q-inv", offsetof(rsa_priv, q_inv), KENC_MP, 0 }, + { "d", offsetof(rsa_priv, d), KENC_MP, 0 }, + { "d-mod-p", offsetof(rsa_priv, dp), KENC_MP, 0 }, + { "d-mod-q", offsetof(rsa_priv, dq), KENC_MP, 0 }, + { 0, 0, 0, 0 } +}; + +const key_fetchdef rsa_privfetch[] = { + { "n", offsetof(rsa_priv, n), KENC_MP, 0 }, + { "e", offsetof(rsa_priv, e), KENC_MP, 0 }, + { "private", 0, KENC_STRUCT, priv }, + { 0, 0, 0, 0 } +}; + +/*----- That's all, folks -------------------------------------------------*/