Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nettle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Wim Lewis
nettle
Commits
2d4b582e
Commit
2d4b582e
authored
Jan 27, 2015
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
Fix comment on the ecc_add_ehh formulas.
parent
f8870f78
Branches
require-gnu-make
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ecc-add-ehh.c
+6
-6
6 additions, 6 deletions
ecc-add-ehh.c
with
6 additions
and
6 deletions
ecc-add-ehh.c
+
6
−
6
View file @
2d4b582e
...
@@ -55,25 +55,25 @@ ecc_add_ehh (const struct ecc_curve *ecc,
...
@@ -55,25 +55,25 @@ ecc_add_ehh (const struct ecc_curve *ecc,
#define z3 (r + 2*ecc->p.size)
#define z3 (r + 2*ecc->p.size)
/* Formulas (from djb,
/* Formulas (from djb,
http://www.hyperelliptic.org/EFD/g1p/auto-edwards-projective.html#
doubling-dbl
-2007-bl):
http://www.hyperelliptic.org/EFD/g1p/auto-edwards-projective.html#
addition-add
-2007-bl):
Computation Operation Live variables
Computation Operation Live variables
C = x1*x2 mul C
C = x1*x2 mul C
D = y1*y2 mul C, D
D = y1*y2 mul C, D
T = (x1+y1)(x2+y2) - C - D
C, D, T
T = (x1+y1)(x2+y2) - C - D
, mul
C, D, T
E = b*C*D 2 mul C, E, T (Replace C <-- D - C)
E = b*C*D 2 mul C, E, T (Replace C <-- D - C)
A = z1*z2 mul A, C, E, T
A = z1*z2 mul A, C, E, T
B = A^2 sqr A, B, C, E, T
B = A^2 sqr A, B, C, E, T
F = B - E A, B, C, E, F, T
F = B - E A, B, C, E, F, T
G = B + E A, C, F, G, T
G = B + E A, C, F, G, T
x3 = A*F*T
3
mul A, C, G
x3 = A*F*T
2
mul A, C, G
y3 = A*G*(D-C) 2 mul F, G
y3 = A*G*(D-C) 2 mul F, G
z3 = F*G mul
z3 = F*G mul
But when working with the twist curve, we
need to the factor
But when working with the twist curve, we
have to negate the
x1*x2. We need to switch sign in y3 expressions,
a
n
d
swap F and
factor C = x1*x2. We change subtract to
a
d
d
in the y3
G.
expression, and swap F and
G.
*/
*/
#define C scratch
#define C scratch
#define D (scratch + ecc->p.size)
#define D (scratch + ecc->p.size)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment