Skip to content

Instantly share code, notes, and snippets.

@doctorevil
doctorevil / curve25519.py
Created March 13, 2014 02:51
curve25519 ec-kcdsa python impl
# a pedagogical implementation of curve25519 with ec-kcdsa
# coded by doctorevil to validate nxt's port of Matthijs van Duin's implementation
# warning: this implementation is not timing attack resistant
# ec arithmetic equations from http://hyperelliptic.org/EFD/g1p/auto-montgom.html
from hashlib import sha256
from ecdsa.numbertheory import square_root_mod_prime, SquareRootError, inverse_mod
CURVE_P = 2**255 - 19
CURVE_A = 486662
@doctorevil
doctorevil / review.md
Last active February 13, 2021 15:30
NXT Crypto Review of Curve25519.java & Crypto.java

Crypto Review of Curve25519.java & Crypto.java

By DoctorEvil on Nextcoin.org

Sponsored by MSIN on BitcoinTalk.org

TL;DR

NXT's Crypto.java and Curve25519.java look kosher aside from a signing bug that is currently being worked around.

General Methodology