Fork of https://filippo.io/edwards25519 with unsafe faster operations. https://filippo.io/edwards25519
Go to file
Filippo Valsorda c882e8e8ab edwards25519: rewrite amd64 assembly with avo
Mapping almost 1:1 from generic Go lines to Avo lines.

Again a little faster, as a treat. (Probably due to better pipelining of
the reduction chains.)

name                    old time/op  new time/op  delta
Add-4                   7.87ns ± 2%  7.93ns ± 1%    ~     (p=0.065 n=10+9)
Mul-4                   18.9ns ± 2%  18.4ns ± 1%  -2.20%  (p=0.000 n=10+9)
Mul32-4                 7.22ns ± 1%  7.19ns ± 1%    ~     (p=0.128 n=10+9)
BasepointMul-4          21.4µs ± 1%  21.1µs ± 1%  -1.54%  (p=0.000 n=10+10)
ScalarMul-4             67.3µs ± 2%  67.2µs ± 1%    ~     (p=0.579 n=10+10)
VartimeDoubleBaseMul-4  62.5µs ± 2%  62.9µs ± 1%    ~     (p=0.436 n=10+10)
MultiscalarMulSize8-4    246µs ± 0%   246µs ± 1%    ~     (p=0.631 n=10+10)
2021-04-05 15:05:07 -04:00
.github/workflows .github/workflows: add GitHub Actions tests (#1) 2020-11-23 05:40:35 +01:00
asm edwards25519: rewrite amd64 assembly with avo 2021-04-05 15:05:07 -04:00
edwards25519.go edwards25519: panic if an uninitialized Point is used 2020-12-17 19:15:22 +01:00
edwards25519_test.go edwards25519: document why this can't implement X25519 2021-01-31 15:10:24 +01:00
fe.go edwards25519: remove Go 1.12 compatibility hack 2021-04-05 15:05:07 -04:00
fe_alias_test.go edwards25519: hide FieldElement and (*Point).ExtendedCoords 2020-11-23 05:27:48 +01:00
fe_amd64.go edwards25519: rewrite amd64 assembly with avo 2021-04-05 15:05:07 -04:00
fe_amd64.s edwards25519: rewrite amd64 assembly with avo 2021-04-05 15:05:07 -04:00
fe_amd64_noasm.go edwards25519: rewrite amd64 assembly with avo 2021-04-05 15:05:07 -04:00
fe_arm64.go edwards25519: rewrite amd64 assembly with avo 2021-04-05 15:05:07 -04:00
fe_arm64.s edwards25519: refactor feMulGeneric and feSquareGeneric 2021-04-05 15:05:07 -04:00
fe_arm64_noasm.go edwards25519: rewrite amd64 assembly with avo 2021-04-05 15:05:07 -04:00
fe_bench_test.go edwards25519: hide FieldElement and (*Point).ExtendedCoords 2020-11-23 05:27:48 +01:00
fe_generic.go edwards25519: refactor feMulGeneric and feSquareGeneric 2021-04-05 15:05:07 -04:00
fe_test.go edwards25519: rewrite amd64 assembly with avo 2021-04-05 15:05:07 -04:00
go.mod all: expose edwards25519, base, and scalar packages 2020-08-27 00:35:09 -04:00
LICENSE all: flatten the package and make FieldElement opaque 2020-09-28 14:18:44 +02:00
README.md README: add pkg.go.dev link 2020-11-23 14:39:08 +01:00
scalar.go edwards25519: add (*Scalar).MultiplyAdd 2020-12-03 17:32:03 -05:00
scalar_alias_test.go edwards25519: test the invariant that Scalars are always reduced 2020-11-23 00:08:28 +01:00
scalar_test.go edwards25519: add TestScalarSetBytesWithClamping 2020-12-12 14:27:59 +01:00
scalarmult.go edwards25519: fix ScalarMult when receiver is not the identity (#12) 2021-02-03 23:49:06 +01:00
scalarmult_test.go edwards25519: fix ScalarMult when receiver is not the identity (#12) 2021-02-03 23:49:06 +01:00
table_constants.go edwards25519: hide FieldElement and (*Point).ExtendedCoords 2020-11-23 05:27:48 +01:00
tables.go edwards25519: rename ProjP3 to Point and unexport other point types 2020-09-28 14:18:44 +02:00
tables_test.go edwards25519: remove (*Point).Identity and (*Point).Generator 2020-11-23 04:58:26 +01:00

filippo.io/edwards25519

import "filippo.io/edwards25519"

This library implements the edwards25519 elliptic curve, exposing the necessary APIs to build a wide array of higher-level primitives. Read the docs at pkg.go.dev/filippo.io/edwards25519.

The code is originally derived from Adam Langley's internal implementation in the Go standard library, and includes George Tankersley's performance improvements. It was then further developed by Henry de Valence for use in ristretto255.

Most users don't need this package, and should instead use crypto/ed25519 for signatures, golang.org/x/crypto/curve25519 for Diffie-Hellman, or github.com/gtank/ristretto255 for prime order group logic. However, for anyone currently using a fork of crypto/ed25519/internal/edwards25519 or github.com/agl/edwards25519, this package should be a safer, faster, and more powerful alternative.

Since this package is meant to curb proliferation of edwards25519 implementations in the Go ecosystem, it welcomes requests for new APIs or reviewable performance improvements.