aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Hamburg <mike@shiftleft.org>2017-05-24 15:58:43 -0700
committerMike Hamburg <mike@shiftleft.org>2017-05-24 15:58:43 -0700
commit513e6460817b9503f3e3cf94d1079b643f3528f0 (patch)
tree3fa1504f09f3cdf2e7ecf8d7447d78b7b90a0370
parentbetter test (diff)
downloadgoldilocks-513e6460817b9503f3e3cf94d1079b643f3528f0.tar.xz
goldilocks-513e6460817b9503f3e3cf94d1079b643f3528f0.zip
restore declaration of deisogenize which was causing build failure in gcc
-rw-r--r--src/GENERATED/c/curve25519/decaf.c17
-rw-r--r--src/GENERATED/c/ed448goldilocks/decaf.c17
-rw-r--r--src/per_curve/decaf.tmpl.c9
3 files changed, 41 insertions, 2 deletions
diff --git a/src/GENERATED/c/curve25519/decaf.c b/src/GENERATED/c/curve25519/decaf.c
index 192b95e..03d00d8 100644
--- a/src/GENERATED/c/curve25519/decaf.c
+++ b/src/GENERATED/c/curve25519/decaf.c
@@ -126,6 +126,15 @@ void API_NS(deisogenize) (
mask_t toggle_hibit_s,
mask_t toggle_hibit_t_over_s,
mask_t toggle_rotation
+);
+
+void API_NS(deisogenize) (
+ gf_s *__restrict__ s,
+ gf_s *__restrict__ minus_t_over_s,
+ const point_t p,
+ mask_t toggle_hibit_s,
+ mask_t toggle_hibit_t_over_s,
+ mask_t toggle_rotation
) {
#if COFACTOR == 4 && !IMAGINE_TWIST
(void) toggle_rotation;
@@ -1411,7 +1420,13 @@ void decaf_x25519_derive_public_key (
point_t p;
API_NS(precomputed_scalarmul)(p,API_NS(precomputed_base),the_scalar);
- /* Isogenize to Montgomery curve */
+ /* Isogenize to Montgomery curve.
+ *
+ * Why isn't this just a separate function, eg decaf_encode_like_x25519?
+ * Basically because in general it does the wrong thing if there is a cofactor
+ * component in the input. In this function though, there isn't a cofactor
+ * component in the input.
+ */
gf_invert(p->t,p->x); /* 1/x */
gf_mul(p->z,p->t,p->y); /* y/x */
gf_sqr(p->y,p->z); /* (y/x)^2 */
diff --git a/src/GENERATED/c/ed448goldilocks/decaf.c b/src/GENERATED/c/ed448goldilocks/decaf.c
index d90f758..866c63d 100644
--- a/src/GENERATED/c/ed448goldilocks/decaf.c
+++ b/src/GENERATED/c/ed448goldilocks/decaf.c
@@ -126,6 +126,15 @@ void API_NS(deisogenize) (
mask_t toggle_hibit_s,
mask_t toggle_hibit_t_over_s,
mask_t toggle_rotation
+);
+
+void API_NS(deisogenize) (
+ gf_s *__restrict__ s,
+ gf_s *__restrict__ minus_t_over_s,
+ const point_t p,
+ mask_t toggle_hibit_s,
+ mask_t toggle_hibit_t_over_s,
+ mask_t toggle_rotation
) {
#if COFACTOR == 4 && !IMAGINE_TWIST
(void) toggle_rotation;
@@ -1411,7 +1420,13 @@ void decaf_x448_derive_public_key (
point_t p;
API_NS(precomputed_scalarmul)(p,API_NS(precomputed_base),the_scalar);
- /* Isogenize to Montgomery curve */
+ /* Isogenize to Montgomery curve.
+ *
+ * Why isn't this just a separate function, eg decaf_encode_like_x448?
+ * Basically because in general it does the wrong thing if there is a cofactor
+ * component in the input. In this function though, there isn't a cofactor
+ * component in the input.
+ */
gf_invert(p->t,p->x); /* 1/x */
gf_mul(p->z,p->t,p->y); /* y/x */
gf_sqr(p->y,p->z); /* (y/x)^2 */
diff --git a/src/per_curve/decaf.tmpl.c b/src/per_curve/decaf.tmpl.c
index ab4773f..776488c 100644
--- a/src/per_curve/decaf.tmpl.c
+++ b/src/per_curve/decaf.tmpl.c
@@ -115,6 +115,15 @@ void API_NS(deisogenize) (
mask_t toggle_hibit_s,
mask_t toggle_hibit_t_over_s,
mask_t toggle_rotation
+);
+
+void API_NS(deisogenize) (
+ gf_s *__restrict__ s,
+ gf_s *__restrict__ minus_t_over_s,
+ const point_t p,
+ mask_t toggle_hibit_s,
+ mask_t toggle_hibit_t_over_s,
+ mask_t toggle_rotation
) {
#if COFACTOR == 4 && !IMAGINE_TWIST
(void) toggle_rotation;