progs/perftest.c: Use from Glibc syscall numbers.
[catacomb] / math / ec.h
index cc7649d..c6be6aa 100644 (file)
--- a/math/ec.h
+++ b/math/ec.h
@@ -72,8 +72,10 @@ typedef struct ec_mulfactor {
 
 /* --- Elliptic curve operations --- *
  *
- * All operations (apart from @destroy@ and @in@) are guaranteed to be
- * performed on internal representations of points.
+ * All operations apart from @destroy@, @in@, and @compr@ are guaranteed to
+ * be performed on internal representations of points; @in@ and @compr@ will
+ * always be performed on external representations; @destroy@ might be
+ * performed on either.
  *
  * (Historical note.  We used to guarantee that the second to @add@ and @mul@
  * was the output of @in@ or @fix@, but this canonification turned out to
@@ -94,6 +96,7 @@ typedef struct ec_ops {
   ec *(*sub)(ec_curve */*c*/, ec */*d*/, const ec */*p*/, const ec */*q*/);
   ec *(*dbl)(ec_curve */*c*/, ec */*d*/, const ec */*p*/);
   int (*check)(ec_curve */*c*/, const ec */*p*/);
+  int (*compr)(ec_curve */*c*/, const ec */*p*/);
 } ec_ops;
 
 #define EC_NAME(c)             (c)->ops->name
@@ -104,6 +107,7 @@ typedef struct ec_ops {
 #define EC_FIX(c, d, p)                (c)->ops->fix((c), (d), (p))
 
 #define EC_FIND(c, d, x)       (c)->ops->find((c), (d), (x))
+#define EC_COMPR(c, d)         (c)->ops->compr((c), (d))
 #define EC_NEG(c, d, x)                (c)->ops->neg((c), (d), (x))
 #define EC_ADD(c, d, p, q)     (c)->ops->add((c), (d), (p), (q))
 #define EC_SUB(c, d, p, q)     (c)->ops->sub((c), (d), (p), (q))
@@ -576,14 +580,14 @@ extern const char *ec_getinfo(ec_info */*ei*/, const char */*p*/);
 
 /* --- @ec_sameinfop@ --- *
  *
- * Arguments:  @ec_info *ei, *ej@ = two elliptic curve parameter sets
+ * Arguments:  @const ec_info *ei, *ej@ = two elliptic curve parameter sets
  *
  * Returns:    Nonzero if the curves are identical (not just isomorphic).
  *
  * Use:                Checks for sameness of curve parameters.
  */
 
-extern int ec_sameinfop(ec_info */*ei*/, ec_info */*ej*/);
+extern int ec_sameinfop(const ec_info */*ei*/, const ec_info */*ej*/);
 
 /* --- @ec_freeinfo@ --- *
  *