projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simple (non-projective) curves over prime fields now seem to work.
[u/mdw/catacomb]
/
ec.h
diff --git
a/ec.h
b/ec.h
index
2efe939
..
72ee7a9
100644
(file)
--- a/
ec.h
+++ b/
ec.h
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: ec.h,v 1.
3 2002/01/13 13:48:44
mdw Exp $
+ * $Id: ec.h,v 1.
4.4.1 2003/06/10 13:43:53
mdw Exp $
*
* Elliptic curve definitions
*
*
* Elliptic curve definitions
*
@@
-30,6
+30,12
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: ec.h,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: ec.h,v $
+ * Revision 1.4.4.1 2003/06/10 13:43:53 mdw
+ * Simple (non-projective) curves over prime fields now seem to work.
+ *
+ * Revision 1.4 2003/05/15 23:25:59 mdw
+ * Make elliptic curve stuff build.
+ *
* Revision 1.3 2002/01/13 13:48:44 mdw
* Further progress.
*
* Revision 1.3 2002/01/13 13:48:44 mdw
* Further progress.
*
@@
-74,7
+80,7
@@
typedef struct ec {
typedef struct ec_mulfactor {
ec base; /* The point */
typedef struct ec_mulfactor {
ec base; /* The point */
-
ec
*exp; /* The exponent */
+
mp
*exp; /* The exponent */
} ec_mulfactor;
/* --- Elliptic curve operations --- */
} ec_mulfactor;
/* --- Elliptic curve operations --- */
@@
-91,7
+97,7
@@
typedef struct ec_ops {
} ec_ops;
#define EC_IN(c, d, p) (c)->ops->in((c), (d), (p))
} ec_ops;
#define EC_IN(c, d, p) (c)->ops->in((c), (d), (p))
-#define EC_OUT(c, d, p) (c)->ops->
in
((c), (d), (p))
+#define EC_OUT(c, d, p) (c)->ops->
out
((c), (d), (p))
#define EC_FIND(c, d, x) (c)->ops->find((c), (d), (x))
#define EC_NEG(c, d, x) (c)->ops->neg((c), (d), (x))
#define EC_FIND(c, d, x) (c)->ops->find((c), (d), (x))
#define EC_NEG(c, d, x) (c)->ops->neg((c), (d), (x))
@@
-372,7
+378,7
@@
extern ec *ec_projout(ec_curve */*c*/, ec */*d*/, const ec */*p*/);
*
* Arguments: @ec_curve *c@ = pointer to an elliptic curve
* @ec *d@ = pointer to the destination
*
* Arguments: @ec_curve *c@ = pointer to an elliptic curve
* @ec *d@ = pointer to the destination
- * @const ec *
a, *b
@ = the operand points
+ * @const ec *
p, *q
@ = the operand points
*
* Returns: The destination @d@.
*
*
* Returns: The destination @d@.
*
@@
-381,7
+387,8
@@
extern ec *ec_projout(ec_curve */*c*/, ec */*d*/, const ec */*p*/);
* subtraction operator.
*/
* subtraction operator.
*/
-extern ec *ec_stdsub(ec_curve */*c*/, ec */*d*/, const ec */*p*/);
+extern ec *ec_stdsub(ec_curve */*c*/, ec */*d*/,
+ const ec */*p*/, const ec */*q*/);
/*----- Creating curves ---------------------------------------------------*/
/*----- Creating curves ---------------------------------------------------*/
@@
-398,7
+405,7
@@
extern void ec_destroycurve(ec_curve */*c*/);
/* --- @ec_prime@, @ec_primeproj@ --- *
*
/* --- @ec_prime@, @ec_primeproj@ --- *
*
- * Arguments: @field *f@ = the under
yl
ing field for this elliptic curve
+ * Arguments: @field *f@ = the under
ly
ing field for this elliptic curve
* @mp *a, *b@ = the coefficients for this curve
*
* Returns: A pointer to the curve.
* @mp *a, *b@ = the coefficients for this curve
*
* Returns: A pointer to the curve.