~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
base/asm-common.h (x86), and knock-on: Add macros for full-size regs.
[catacomb]
/
utils
/
curve25519.sage
diff --git
a/utils/curve25519.sage
b/utils/curve25519.sage
index
24e74b1
..
6fa3cd3
100644
(file)
--- a/
utils/curve25519.sage
+++ b/
utils/curve25519.sage
@@
-222,8
+222,6
@@
assert 5*quosqrt(k(4), k(5))^2 == 4
###--------------------------------------------------------------------------
### The Montgomery ladder.
###--------------------------------------------------------------------------
### The Montgomery ladder.
-A0 = (A - 2)/4
-
def x25519(n, x1):
## Let Q = (x_1 : y_1 : 1) be an input point. We calculate
def x25519(n, x1):
## Let Q = (x_1 : y_1 : 1) be an input point. We calculate
@@
-269,7
+267,7
@@
assert x25519(x, Y[0]) == x25519(y, X[0]) == Z[0]
### Edwards curve parameters and conversion.
a = k(-1)
### Edwards curve parameters and conversion.
a = k(-1)
-d =
k(-A0/(A0 + 1)
)
+d =
-A0/(A0 + 1
)
def mont_to_ed(u, v):
return sqrt(-A - 2)*u/v, (u - 1)/(u + 1)
def mont_to_ed(u, v):
return sqrt(-A - 2)*u/v, (u - 1)/(u + 1)