math/f25519.c: Implementation for arithmetic in GF(2^255 - 19).
authorMark Wooding <mdw@distorted.org.uk>
Mon, 17 Apr 2017 23:39:24 +0000 (00:39 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 29 Apr 2017 11:29:22 +0000 (12:29 +0100)
commitee39a683a2b623a1da0747ec20f20b63470a2db6
tree25a9033a9afc0484bc3819ebc8f40ff0de617670
parentb45877de6cf776dbbd38f9d9290df80b15a46e9c
math/f25519.c: Implementation for arithmetic in GF(2^255 - 19).

There's both a fast implementation for platforms with 64-bit arithmetic,
and a slow baseline for minimal C89 platforms.  The code works better on
two's complement systems with arithmetic right shifts, but it works
portably.

  * Arithmetic shifts are implemented with hairy masking and exact
    division, but GCC notices and optimizes accordingly.

  * Two's complement is used in the conditional-swap machinery, but
    there's a fallback using multiplication if the `configure' script
    can't detect it.
configure.ac
math/Makefile.am
math/f25519.c [new file with mode: 0644]
math/f25519.h [new file with mode: 0644]
math/qfarith.h [new file with mode: 0644]
math/t/f25519 [new file with mode: 0644]
utils/curve25519.sage [new file with mode: 0644]
utils/qfarith-test [new file with mode: 0755]