Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OTRv4
libgoldilocks
Commits
d678c939
Unverified
Commit
d678c939
authored
Mar 21, 2018
by
Sofia Celi
⛸
Browse files
Get rid of 'SIGMA_ISOGENY' and 'IMAGINE_TWIST' values
#1
parent
f1cb889a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/GENERATED/c/ed448goldilocks/goldilocks.c
View file @
d678c939
...
...
@@ -26,7 +26,6 @@
#define scalar_t API_NS(scalar_t)
#define point_t API_NS(point_t)
#define precomputed_s API_NS(precomputed_s)
#define IMAGINE_TWIST 0
#define COFACTOR 4
/* Comb config: number of combs, n, t, s. */
...
...
@@ -37,8 +36,6 @@
#define GOLDILOCKS_WNAF_FIXED_TABLE_BITS 5
#define GOLDILOCKS_WNAF_VAR_TABLE_BITS 3
#define EDDSA_USE_SIGMA_ISOGENY 0
static
const
int
EDWARDS_D
=
-
39081
;
static
const
scalar_t
point_scalarmul_adjustment
=
{{{
SC_LIMB
(
0xc873d6d54a7bb0cf
),
SC_LIMB
(
0xe933d8d723a70aad
),
SC_LIMB
(
0xbb124b65129c96fd
),
SC_LIMB
(
0x00000008335dc163
)
...
...
@@ -676,20 +673,10 @@ goldilocks_bool_t API_NS(point_eq) ( const point_t p, const point_t q ) {
gf_mul
(
b
,
q
->
y
,
p
->
x
);
mask_t
succ
=
gf_eq
(
a
,
b
);
#if (COFACTOR == 8) && IMAGINE_TWIST
/* this should be removed too */
#if (COFACTOR == 8)
gf_mul
(
a
,
p
->
y
,
q
->
y
);
gf_mul
(
b
,
q
->
x
,
p
->
x
);
/* this is a very odd case to check */
#if !(IMAGINE_TWIST)
gf_sub
(
a
,
ZERO
,
a
);
#else
/* Interesting note: the 4tor would normally be rotation.
* But because of the *i twist, it's actually
* (x,y) <-> (iy,ix)
*/
/* No code, just a comment. */
#endif
succ
|=
gf_eq
(
a
,
b
);
#endif
...
...
src/generator/curve_data.py
View file @
d678c939
...
...
@@ -98,9 +98,6 @@ for curve,data in curve_data.items():
if
"cxx_ns"
not
in
data
:
data
[
"cxx_ns"
]
=
data
[
"name"
].
replace
(
"-"
,
""
)
if
"eddsa_sigma_iso"
not
in
data
:
data
[
"eddsa_sigma_iso"
]
=
0
if
"rist_base_decoded"
not
in
data
:
def
xord
(
x
):
if
isinstance
(
x
,
str
):
return
ord
(
x
)
...
...
src/per_curve/goldilocks.tmpl.c
View file @
d678c939
...
...
@@ -15,7 +15,6 @@
#define scalar_t API_NS(scalar_t)
#define point_t API_NS(point_t)
#define precomputed_s API_NS(precomputed_s)
#define IMAGINE_TWIST $(imagine_twist)
#define COFACTOR $(cofactor)
/* Comb config: number of combs, n, t, s. */
...
...
@@ -26,8 +25,6 @@
#define GOLDILOCKS_WNAF_FIXED_TABLE_BITS $(wnaf.fixed)
#define GOLDILOCKS_WNAF_VAR_TABLE_BITS $(wnaf.var)
#define EDDSA_USE_SIGMA_ISOGENY $(eddsa_sigma_iso)
static
const
int
EDWARDS_D
=
$
(
d
);
static
const
scalar_t
point_scalarmul_adjustment
=
{{{
$
(
ser
((
2
**
(
scalar_bits
-
1
+
window_bits
-
((
scalar_bits
-
1
)
%
window_bits
))
-
1
)
%
q
,
64
,
"SC_LIMB"
))
...
...
@@ -665,20 +662,10 @@ goldilocks_bool_t API_NS(point_eq) ( const point_t p, const point_t q ) {
gf_mul
(
b
,
q
->
y
,
p
->
x
);
mask_t
succ
=
gf_eq
(
a
,
b
);
#if (COFACTOR == 8) && IMAGINE_TWIST
/* this should be removed too */
#if (COFACTOR == 8)
gf_mul
(
a
,
p
->
y
,
q
->
y
);
gf_mul
(
b
,
q
->
x
,
p
->
x
);
/* this is a very odd case to check */
#if !(IMAGINE_TWIST)
gf_sub
(
a
,
ZERO
,
a
);
#else
/* Interesting note: the 4tor would normally be rotation.
* But because of the *i twist, it's actually
* (x,y) <-> (iy,ix)
*/
/* No code, just a comment. */
#endif
succ
|=
gf_eq
(
a
,
b
);
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment