diff options
author | Niels Möller <nisse@lysator.liu.se> | 2014-09-06 17:20:10 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2014-09-06 17:20:10 +0200 |
commit | df7b4aca92b3cdbb324a833e1faaa59f532efb77 (patch) | |
tree | c6fda1ef26956c1952f48473acee00088d6a5a22 /misc | |
parent | 9802640c80d7f08a3cf610f00817280aa4dcdc83 (diff) | |
download | nettle-df7b4aca92b3cdbb324a833e1faaa59f532efb77.tar.gz |
Output points also for the Ed25519 curve.
Diffstat (limited to 'misc')
-rw-r--r-- | misc/ecc-ref.gp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/misc/ecc-ref.gp b/misc/ecc-ref.gp index 7ef73259..d963e990 100644 --- a/misc/ecc-ref.gp +++ b/misc/ecc-ref.gp @@ -118,4 +118,14 @@ if (S != ellpow(curve25519, B, a), error("curve25519 dh error")); print("curve25519"); out(a, A, b, B, S); +/* Convert point on curve25519 to a point on the twisted edwards curve */ +beta = -sqrt(Mod(-486664, p25519)); +ed25519(p) = [p[1] * beta / p[2], (p[1] - 1) / (p[1] + 1)]; + +Ae = ed25519(A); +Be = ed25519(B); +Se = ed25519(S); +print("ed25519"); +out(a, Ae, b, Be, Se); + quit |