X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/898a4e2555438ff8adb08b4d82690d08715e1048..b817bfc642225b8c3c0b6a7e42d1fb949b61a606:/gf.h diff --git a/gf.h b/gf.h index fba801c..2429e95 100644 --- a/gf.h +++ b/gf.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: gf.h,v 1.3 2004/03/27 17:54:11 mdw Exp $ + * $Id: gf.h,v 1.4 2004/04/08 01:36:15 mdw Exp $ * * Arithmetic on binary polynomials * @@ -27,20 +27,6 @@ * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: gf.h,v $ - * Revision 1.3 2004/03/27 17:54:11 mdw - * Standard curves and curve checking. - * - * Revision 1.2 2004/03/21 22:52:06 mdw - * Merge and close elliptic curve branch. - * - * Revision 1.1.2.1 2004/03/21 22:39:46 mdw - * Elliptic curves on binary fields work. - * - */ - #ifndef CATACOMB_GF_H #define CATACOMB_GF_H @@ -130,6 +116,21 @@ extern int gf_irreduciblep(mp */*f*/); extern void gf_gcd(mp **/*gcd*/, mp **/*xx*/, mp **/*yy*/, mp */*a*/, mp */*b*/); +/* -- @gf_modinv@ --- * + * + * Arguments: @mp *d@ = destination + * @mp *x@ = argument + * @mp *p@ = modulus + * + * Returns: The inverse %$x^{-1} \bmod p$%. + * + * Use: Computes a modular inverse, the catch being that the + * arguments and results are binary polynomials. An assertion + * fails if %$p$% has no inverse. + */ + +extern mp *gf_modinv(mp */*d*/, mp */*x*/, mp */*p*/); + /*----- That's all, folks -------------------------------------------------*/ #ifdef __cplusplus