pyca / ed25519

Optimized version of the reference implementation of Ed25519
Creative Commons Zero v1.0 Universal
34 stars 22 forks source link

Switch to extended coordinates #14

Closed gnprice closed 11 years ago

gnprice commented 11 years ago

This makes things faster; about 39x faster for verification on my machine.

We pass to homogeneous coordinates and add an auxiliary coordinate, so a point P = (x, y) is represented now as (X : Y : Z : T), where x = X/Z, y = Y/Z, xy = T/Z. The homogeneous coordinates allow us to avoid any inversion in the Edwards addition, and the auxiliary coordinate T saves another multiply or so.

Patch supplied by Mike Hamburg mike@shiftleft.org against upstream ed25519.py. He released his modifications into the public domain. I rebased and added the short comment and this commit message.