From c811f7809ae22feba8f0fdb936ce529be8b84ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Ch=C3=A9ron?= Date: Fri, 10 Nov 2017 21:34:09 +0100 Subject: [PATCH] Add missing FIELD_LITERAL for RISTRETTO_FACTOR --- src/GENERATED/c/curve25519/decaf.c | 4 ++-- src/GENERATED/c/ed448goldilocks/decaf.c | 4 ++-- src/per_curve/decaf.tmpl.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/GENERATED/c/curve25519/decaf.c b/src/GENERATED/c/curve25519/decaf.c index b27328d..d3ab6ac 100644 --- a/src/GENERATED/c/curve25519/decaf.c +++ b/src/GENERATED/c/curve25519/decaf.c @@ -49,9 +49,9 @@ static const scalar_t point_scalarmul_adjustment = {{{ const uint8_t decaf_x25519_base_point[DECAF_X25519_PUBLIC_BYTES] = { 0x09 }; #define RISTRETTO_FACTOR DECAF_255_RISTRETTO_FACTOR -const gf RISTRETTO_FACTOR = {{{ +const gf RISTRETTO_FACTOR = {FIELD_LITERAL( 0x702557fa2bf03, 0x514b7d1a82cc6, 0x7f89efd8b43a7, 0x1aef49ec23700, 0x079376fa30500 -}}}; +)}; #if IMAGINE_TWIST #define TWISTED_D (-(EDWARDS_D)) diff --git a/src/GENERATED/c/ed448goldilocks/decaf.c b/src/GENERATED/c/ed448goldilocks/decaf.c index 3fdc491..2e5bb3f 100644 --- a/src/GENERATED/c/ed448goldilocks/decaf.c +++ b/src/GENERATED/c/ed448goldilocks/decaf.c @@ -49,9 +49,9 @@ static const scalar_t point_scalarmul_adjustment = {{{ const uint8_t decaf_x448_base_point[DECAF_X448_PUBLIC_BYTES] = { 0x05 }; #define RISTRETTO_FACTOR DECAF_448_RISTRETTO_FACTOR -const gf RISTRETTO_FACTOR = {{{ +const gf RISTRETTO_FACTOR = {FIELD_LITERAL( 0x42ef0f45572736, 0x7bf6aa20ce5296, 0xf4fd6eded26033, 0x968c14ba839a66, 0xb8d54b64a2d780, 0x6aa0a1f1a7b8a5, 0x683bf68d722fa2, 0x22d962fbeb24f7 -}}}; +)}; #if IMAGINE_TWIST #define TWISTED_D (-(EDWARDS_D)) diff --git a/src/per_curve/decaf.tmpl.c b/src/per_curve/decaf.tmpl.c index 6ec7cc6..9bfe4c0 100644 --- a/src/per_curve/decaf.tmpl.c +++ b/src/per_curve/decaf.tmpl.c @@ -38,9 +38,9 @@ static const scalar_t point_scalarmul_adjustment = {{{ const uint8_t decaf_x$(gf_shortname)_base_point[DECAF_X$(gf_shortname)_PUBLIC_BYTES] = { $(ser(mont_base,8)) }; #define RISTRETTO_FACTOR $(C_NS)_RISTRETTO_FACTOR -const gf RISTRETTO_FACTOR = {{{ +const gf RISTRETTO_FACTOR = {FIELD_LITERAL( $(ser(msqrt(d-1 if imagine_twist else -d,modulus,hi_bit_clear=True),gf_lit_limb_bits)) -}}}; +)}; #if IMAGINE_TWIST #define TWISTED_D (-(EDWARDS_D))