/* -*-c-*-
*
- * $Id: gf.h,v 1.1.2.1 2004/03/21 22:39:46 mdw Exp $
+ * $Id$
*
* Arithmetic on binary polynomials
*
* MA 02111-1307, USA.
*/
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: gf.h,v $
- * 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
extern void gf_div(mp **/*qq*/, mp **/*rr*/, mp */*a*/, mp */*b*/);
+/* --- @gf_exp@ --- *
+ *
+ * Arguments: @mp *d@ = fake destination
+ * @mp *a@ = base
+ * @mp *e@ = exponent
+ *
+ * Returns: Result, %$a^e$%.
+ */
+
+extern mp *gf_exp(mp */*d*/, mp */*a*/, mp */*e*/);
+
+/* --- @gf_irreduciblep@ --- *
+ *
+ * Arguments: @mp *f@ = a polynomial
+ *
+ * Returns: Nonzero if the polynomial is irreducible; otherwise zero.
+ */
+
+extern int gf_irreduciblep(mp */*f*/);
+
/* --- @gf_gcd@ --- *
*
* Arguments: @mp **gcd, **xx, **yy@ = where to write the results
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