http://mmgen-wallet.i2p/project/mmgen/mmgen-wallet/src/e025f2704fca8dfb9ea49126b489fd852d944ee7/mmgen/contrib/ed25519.py
= 0: x = q-x return x By = 4 * inv(5) Bx = xrecover(By) B = [Bx%q, By%q] def edwards(P, Q): x1 = P[0] y1 = P[1] x2 = Q[0] y2 = Q[1] x3 = (x1*y2+x2*y1) * inv(1+d*x1*x2*y1*y2) y3 = (y1*y2+x1*x2) * inv(1-d*x1*x2*y1*y2) return [x3%q, y3%q] def scalarmult(P, e): if e == 0: return [0, 1] Q = scalarmult(P, e//2) Q = edwards(Q, Q) if e & 1: Q = edwards(Q, P) return Q def encodepoint(P): x = P[0] y = P[1] bits = [(y >> i) & 1 for i in range(b-1)] + [x & 1] return bytes([sum(bits[i * 8 + j] <<...