]> pd.if.org Git - zpackage/blobdiff - crypto/libeddsa/lib/ed.h
add package signing code
[zpackage] / crypto / libeddsa / lib / ed.h
diff --git a/crypto/libeddsa/lib/ed.h b/crypto/libeddsa/lib/ed.h
new file mode 100644 (file)
index 0000000..285040a
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef ED_H
+#define ED_H
+
+#include <stdint.h>
+
+#include "fld.h"
+#include "sc.h"
+
+
+/* (x,y,z) are the projective points on our curve E and t = x*y is an
+ * auxiliary coordinate (see [2], ch. 3).
+ */
+struct ed {
+       fld_t           x;
+       fld_t           y;
+       fld_t           t;
+       fld_t           z;
+};
+
+
+void   ed_export(uint8_t out[32], const struct ed *P);
+void   ed_import(struct ed *P, const uint8_t in[32]);
+
+void   ed_scale_base(struct ed *res, const sc_t x);
+
+void   ed_dual_scale(struct ed *R, const sc_t x,
+                     const sc_t y, const struct ed *Q);
+
+#endif