X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/5c3f75ec49019d160806489824fc76652a2ef444..07290a455e008c37adc233554eff8ad468608161:/group.h diff --git a/group.h b/group.h index 9578f33..a144706 100644 --- a/group.h +++ b/group.h @@ -1,13 +1,13 @@ /* -*-c-*- * - * $Id: group.h,v 1.5 2004/04/17 09:58:37 mdw Exp $ + * $Id$ * * General cyclic group abstraction * * (c) 2004 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Catacomb. * @@ -15,12 +15,12 @@ * 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, @@ -80,7 +80,11 @@ typedef struct group_expfactor { } group_expfactor; typedef struct group_ops { + + /* --- General information --- */ + unsigned ty; /* Type of this group */ + const char *name; /* Textual name string */ /* --- Memory management --- */ @@ -136,6 +140,9 @@ enum { GTY_EC /* Elliptic curve group */ }; +#define G_NAME(g) (g)->ops->name +#define G_TYPE(g) (g)->ops->ty + #define G_DESTROYGROUP(g) (g)->ops->destroygroup((g)) #define G_CREATE(g) (g)->ops->create((g)) #define G_COPY(g, d, x) (g)->ops->copy((g), (d), (x)) @@ -334,6 +341,22 @@ typedef struct gprime_param { group *group_prime(const gprime_param */*gp*/); +/*----- Binary field subgroups --------------------------------------------*/ + +typedef gprime_param gbin_param; + +/* --- @group_binary@ --- * + * + * Arguments: @const gbin_param *gb@ = group parameters + * + * Returns: A pointer to the group, or null. + * + * Use: Constructs an abstract group interface for a subgroup of a + * prime field. Group elements are @mp *@ pointers. + */ + +group *group_binary(const gbin_param */*gp*/); + /*----- Elliptic curve groups ---------------------------------------------*/ /* --- @group_ec@ --- *