summaryrefslogtreecommitdiff
path: root/libs/libsodium/src/include/sodium/private/ed25519_ref10.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libsodium/src/include/sodium/private/ed25519_ref10.h')
-rw-r--r--libs/libsodium/src/include/sodium/private/ed25519_ref10.h45
1 files changed, 38 insertions, 7 deletions
diff --git a/libs/libsodium/src/include/sodium/private/ed25519_ref10.h b/libs/libsodium/src/include/sodium/private/ed25519_ref10.h
index cbf258e0c1..9477df3ca4 100644
--- a/libs/libsodium/src/include/sodium/private/ed25519_ref10.h
+++ b/libs/libsodium/src/include/sodium/private/ed25519_ref10.h
@@ -4,6 +4,8 @@
#include <stddef.h>
#include <stdint.h>
+#include "private/quirks.h"
+
/*
fe means field element.
Here the field is \Z/(2^255-19).
@@ -25,7 +27,6 @@ void fe25519_tobytes(unsigned char *s, const fe25519 h);
# include "ed25519_ref10_fe_25_5.h"
#endif
-
/*
ge means group element.
@@ -81,35 +82,58 @@ int ge25519_frombytes(ge25519_p3 *h, const unsigned char *s);
int ge25519_frombytes_negate_vartime(ge25519_p3 *h, const unsigned char *s);
-void ge25519_p3_to_cached(ge25519_cached *r, const ge25519_p3 *p);
-
void ge25519_p1p1_to_p2(ge25519_p2 *r, const ge25519_p1p1 *p);
void ge25519_p1p1_to_p3(ge25519_p3 *r, const ge25519_p1p1 *p);
-void ge25519_add(ge25519_p1p1 *r, const ge25519_p3 *p, const ge25519_cached *q);
+void ge25519_p2_to_p3(ge25519_p3 *r, const ge25519_p2 *p);
-void ge25519_sub(ge25519_p1p1 *r, const ge25519_p3 *p, const ge25519_cached *q);
+void ge25519_p3_add(ge25519_p3 *r, const ge25519_p3 *p, const ge25519_p3 *q);
+
+void ge25519_p3_sub(ge25519_p3 *r, const ge25519_p3 *p, const ge25519_p3 *q);
void ge25519_scalarmult_base(ge25519_p3 *h, const unsigned char *a);
void ge25519_double_scalarmult_vartime(ge25519_p2 *r, const unsigned char *a,
const ge25519_p3 *A,
- const unsigned char *b);
+ const unsigned char *b,
+ const ge25519_p3 *B);
void ge25519_scalarmult(ge25519_p3 *h, const unsigned char *a,
const ge25519_p3 *p);
+void ge25519_clear_cofactor(ge25519_p3 *p3);
+
int ge25519_is_canonical(const unsigned char *s);
int ge25519_is_on_curve(const ge25519_p3 *p);
int ge25519_is_on_main_subgroup(const ge25519_p3 *p);
-int ge25519_has_small_order(const unsigned char s[32]);
+int ge25519_has_small_order(const ge25519_p3 *p);
void ge25519_from_uniform(unsigned char s[32], const unsigned char r[32]);
+void ge25519_from_hash(unsigned char s[32], const unsigned char h[64]);
+
+int ge25519_from_string(unsigned char p[32],
+ const char *ctx, const unsigned char *msg,
+ size_t msg_len, int hash_alg);
+
+int ge25519_from_string_ro(unsigned char p[32],
+ const char *ctx, const unsigned char *msg,
+ size_t msg_len, int hash_alg);
+
+/*
+ Ristretto group
+ */
+
+int ristretto255_frombytes(ge25519_p3 *h, const unsigned char *s);
+
+void ristretto255_p3_tobytes(unsigned char *s, const ge25519_p3 *h);
+
+void ristretto255_from_hash(unsigned char s[32], const unsigned char h[64]);
+
/*
The set of scalars is \Z/l
where l = 2^252 + 27742317777372353535851937790883648493.
@@ -117,11 +141,18 @@ void ge25519_from_uniform(unsigned char s[32], const unsigned char r[32]);
void sc25519_invert(unsigned char recip[32], const unsigned char s[32]);
+void sc25519_negate(unsigned char neg[32], const unsigned char s[32]);
+
void sc25519_reduce(unsigned char s[64]);
+void sc25519_mul(unsigned char s[32], const unsigned char a[32],
+ const unsigned char b[32]);
+
void sc25519_muladd(unsigned char s[32], const unsigned char a[32],
const unsigned char b[32], const unsigned char c[32]);
int sc25519_is_canonical(const unsigned char s[32]);
+void ge25519_clear_cofactor(ge25519_p3 *p3);
+
#endif