xmath
2006-08-18 00:33:51 UTC
I've made a simple re-implementation of djb's curve25519
(http://cr.yp.to/ecdh.html) in plain C, using 64-bit arithmetic.
http://cds.xs4all.nl:8081/ecdh/curve25519_i64.tgz -- sources
http://cds.xs4all.nl:8081/ecdh/curve25519_i64 -- sources (expanded)
http://cds.xs4all.nl:8081/ecdh/curve25519_i64.txt -- some timings
While it's certainly not going to set new speed records, it still
performs quite well compared to generic-field implementations. For
example a GMP-implementation, even when using the low-level mpn-calls,
is still much slower than this C implementation, even when doing 64-bit
math on a 32-bit machine. The good performance and code simplicity seem
largely due to hardcoding the field (p=2^255-19).
The code should be portable to any platform with int64_t. It's also
definitely much more readable than the x86 asm version :-)
- xmath
(http://cr.yp.to/ecdh.html) in plain C, using 64-bit arithmetic.
http://cds.xs4all.nl:8081/ecdh/curve25519_i64.tgz -- sources
http://cds.xs4all.nl:8081/ecdh/curve25519_i64 -- sources (expanded)
http://cds.xs4all.nl:8081/ecdh/curve25519_i64.txt -- some timings
While it's certainly not going to set new speed records, it still
performs quite well compared to generic-field implementations. For
example a GMP-implementation, even when using the low-level mpn-calls,
is still much slower than this C implementation, even when doing 64-bit
math on a 32-bit machine. The good performance and code simplicity seem
largely due to hardcoding the field (p=2^255-19).
The code should be portable to any platform with int64_t. It's also
definitely much more readable than the x86 asm version :-)
- xmath