summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-10-16 23:07:34 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-10-17 06:32:06 +0200
commit256e972b36623d24251f5c69d7c40bb5ab9d2a29 (patch)
treea2b471be16931a26d4335889744ab537340b1e00 /include
parenta0751e06dc93b42c5ce93e22853577b55e933477 (diff)
downloadlibuecc-256e972b36623d24251f5c69d7c40bb5ab9d2a29.tar
libuecc-256e972b36623d24251f5c69d7c40bb5ab9d2a29.zip
Add Ed25519-compatible generator point
The old point is renamed, as it isn't the only default point anymore. The old name and functions using the old point are deprecated now.
Diffstat (limited to 'include')
-rw-r--r--include/libuecc/ecc.h44
1 files changed, 40 insertions, 4 deletions
diff --git a/include/libuecc/ecc.h b/include/libuecc/ecc.h
index 98d756c..12f1d3e 100644
--- a/include/libuecc/ecc.h
+++ b/include/libuecc/ecc.h
@@ -27,6 +27,11 @@
#ifndef _LIBUECC_ECC_H_
#define _LIBUECC_ECC_H_
+#ifndef DEPRECATED
+#define DEPRECATED __attribute__((deprecated))
+#endif
+
+
#include <stdint.h>
@@ -61,8 +66,35 @@ typedef struct _ecc_25519_work {
/** The identity element */
extern const ecc_25519_work_t ecc_25519_work_identity;
-/** The ec25519 default base */
-extern const ecc_25519_work_t ecc_25519_work_default_base;
+
+/**
+ * The generator point used by Ed25519
+ *
+ * \ref ecc_25519_work_base_ed25519 is the inverse of \ref ecc_25519_work_base_legacy
+ *
+ * The order of the base point is \f$ 2^{252} + 27742317777372353535851937790883648493 \f$.
+ **/
+extern const ecc_25519_work_t ecc_25519_work_base_ed25519;
+
+/**
+ * The ec25519 legacy generator point ("default base" till libuecc v5)
+ *
+ * In new software that doesn't need compablity with older libuecc releases, you should consider
+ * using \ref ecc_25519_work_base_ed25519 instead.
+ *
+ * \ref ecc_25519_work_base_legacy is the inverse of \ref ecc_25519_work_base_ed25519
+ *
+ * The order of the base point is \f$ 2^{252} + 27742317777372353535851937790883648493 \f$.
+ */
+extern const ecc_25519_work_t ecc_25519_work_base_legacy;
+
+
+/**
+ * The ec25519 legacy generator point (provided for API/ABI compatiblity with older releases of libuecc)
+ *
+ * \deprecated Use \ref ecc_25519_work_base_legacy instead.
+ */
+DEPRECATED extern const ecc_25519_work_t ecc_25519_work_default_base;
@@ -143,15 +175,19 @@ void ecc_25519_scalarmult(ecc_25519_work_t *out, const ecc_int256_t *n, const ec
* The order of the base point is \f$ 2^{252} + 27742317777372353535851937790883648493 \f$.
*
* See the notes about \ref ecc_25519_scalarmult_bits before using this function.
+ *
+ * \deprecated Use \ref ecc_25519_scalarmult_bits and explicitly specify the base point.
*/
-void ecc_25519_scalarmult_base_bits(ecc_25519_work_t *out, const ecc_int256_t *n, unsigned bits);
+DEPRECATED void ecc_25519_scalarmult_base_bits(ecc_25519_work_t *out, const ecc_int256_t *n, unsigned bits);
/**
* Does a scalar multiplication of the default base point (generator element) of the Elliptic Curve with an integer
*
* The order of the base point is \f$ 2^{252} + 27742317777372353535851937790883648493 \f$.
+ *
+ * \deprecated Use \ref ecc_25519_scalarmult and explicitly specify the base point.
*/
-void ecc_25519_scalarmult_base(ecc_25519_work_t *out, const ecc_int256_t *n);
+DEPRECATED void ecc_25519_scalarmult_base(ecc_25519_work_t *out, const ecc_int256_t *n);
/**@}*/