Commit Graph

139 Commits

Author SHA1 Message Date
Henry de Valence 928989ab04 Add bad encoding test vectors 2019-04-19 16:35:03 -04:00
Henry de Valence 4e51bef1ad Add test that the computed value encodes correctly 2019-04-19 13:24:50 -07:00
Filippo Valsorda 5140be0fdf Update ristretto255_test.go
Co-Authored-By: hdevalence <hdevalence@hdevalence.ca>
2019-04-19 13:24:50 -07:00
Filippo Valsorda ef9acd2bbd Update ristretto255_test.go
Co-Authored-By: hdevalence <hdevalence@hdevalence.ca>
2019-04-19 13:24:50 -07:00
Filippo Valsorda 72e5a6cd76 Update ristretto255_test.go
Co-Authored-By: hdevalence <hdevalence@hdevalence.ca>
2019-04-19 13:24:50 -07:00
Filippo Valsorda fe9b4d0a2a Update ristretto255_test.go
Co-Authored-By: hdevalence <hdevalence@hdevalence.ca>
2019-04-19 13:24:50 -07:00
Henry de Valence 68ecd88eb2 Update the small-multiples encoding to check additions. 2019-04-19 13:24:50 -07:00
Henry de Valence c722cc47ae Add encoding test vectors from the spec. 2019-04-19 13:24:50 -07:00
Filippo Valsorda 8cd2a841fc internal/radix51: add a "weird" testing/quick generation strategy
Aiming to hit edge cases.
2019-04-19 13:14:32 -07:00
Filippo Valsorda 82132719a1 ristretto255: minor docs cleanup 2019-04-19 13:14:32 -07:00
Filippo Valsorda 1849461667 ristretto255: fix Encode 2019-04-19 13:14:32 -07:00
Filippo Valsorda 50d9eb21ae ristretto255: make Encode an append API 2019-04-19 13:14:32 -07:00
Filippo Valsorda 118379a17a ristretto255: check element minimality by comparing Bytes output 2019-04-19 13:14:32 -07:00
Henry de Valence 363fa10df6
Merge pull request #19 from gtank/add-ristretto-add-sub
implement Add, Sub, Neg for ed25519 and ristretto255 points.
2019-04-19 12:59:09 -07:00
Henry de Valence 2691d4b60c Move comment inside function 2019-04-19 12:58:47 -07:00
Filippo Valsorda c7fb661a85
ristretto255: add docs for Add, Sub, Neg 2019-04-19 15:47:14 -04:00
Henry de Valence cc27ee0ee3 implement Add, Sub, Neg for ed25519 and ristretto255 points. 2019-04-19 11:47:12 -07:00
George Tankersley 1a1e45849a ristretto255: add Encode test 2019-04-19 13:12:37 -04:00
George Tankersley b5155ea127 ristretto255: remove encoded basepoint from main ristretto file 2019-04-19 13:12:37 -04:00
George Tankersley 43dee3dc5c ristretto255: add basepoint test for Decode 2019-04-19 13:12:37 -04:00
George Tankersley e3f2dac2eb ristretto255: add test for feSqrtRatio 2019-04-19 13:12:37 -04:00
George Tankersley b6eb459f56 ristretto255: implement Encode and Decode 2019-04-19 13:12:37 -04:00
Filippo Valsorda 88aa823cd0 internal/group: rename to internal/edwards25519 2019-04-19 12:40:08 -04:00
Filippo Valsorda 7f2b08f212 internal/group: restore ScalarMult code 2019-04-19 12:40:08 -04:00
Filippo Valsorda 1071cc55d9 internal/radix51: rename lightReduce to carryPropagate and touch up docs 2019-04-19 12:40:08 -04:00
Filippo Valsorda 294e169e12 internal/radix51: add benchmarks 2019-04-19 12:16:43 -04:00
Filippo Valsorda 6078ef5b5f all: add go.mod 2019-04-19 12:16:43 -04:00
Filippo Valsorda 481a734fe8 internal/radix51: test that operations don't exceed bounds 2019-04-19 12:16:43 -04:00
Filippo Valsorda d4456f99c1 internal/radix51: make Generate produce random light-reduced elements 2019-04-19 12:16:43 -04:00
Filippo Valsorda 5382f6dbc9 internal/radix51: simplify lightReduce 2019-04-19 12:16:43 -04:00
Filippo Valsorda 8fdc84d186 Merge https://github.com/gtank/ed25519
Drop elliptic.Curve code, update import paths, and adapt to the new
FromBytes API. The tests in ed25519_test.go will require rescuing from
the git history.
2019-03-30 22:22:42 -04:00
Filippo Valsorda c37f1d8359 internal/radix51: minor tests cleanup 2019-03-30 22:12:39 -04:00
Filippo Valsorda 620415daa4 internal/radix51: make reduction an invariant and unexport Reduce
Now every operation returns a light-reduced value, so the reduction is
an invariant, and there's no need to ever explicitly call Reduce.

Safety!
2019-03-30 22:12:39 -04:00
Filippo Valsorda ce6d218ef3 internal/radix51: actually apply go:noescape 2019-03-30 22:12:39 -04:00
Dimitris Apostolou 09d9129779 all: fix typos 2019-03-30 21:29:01 -04:00
George Tankersley 71368c02ff internal/radix51: test field encoding roundtrip with fixed vectors 2019-03-30 21:23:15 -04:00
Filippo Valsorda 1e528602b8 internal/radix51: rename AppendBytes to Bytes 2019-03-30 21:23:15 -04:00
Filippo Valsorda c9d2135504 internal/radix51: rewrite FromBytes and AppendBytes with encoding/binary 2019-03-30 21:23:15 -04:00
Filippo Valsorda d23de5461e internal/radix51: add docs and some light readability refactors 2019-03-30 21:23:15 -04:00
Filippo Valsorda 010995eaa9 internal/radix51: remove unused (and a bit broken) SetInt
It would return an invalid element if the input was greater than 2^54 - 1.
2019-03-30 21:23:15 -04:00
Filippo Valsorda 22cdf749a2 internal/radix51: refactor ToBig and FromBig 2019-03-30 21:23:15 -04:00
Filippo Valsorda 2a0f4ba3cc internal/radix51: replace ToBytes with AppendBytes 2019-03-30 21:23:15 -04:00
George Tankersley 382beb7062 internal/radix51: fix aliasing bug in CondNeg (#21) 2019-03-24 20:32:49 -04:00
Filippo Valsorda ec44dec9b8 internal/radix51: actually, uhm, check the result of TestAliasing 2019-03-15 17:37:41 -04:00
George Tankersley ea3deb459c radix51: change API of FromBytes and ToBytes to use slices 2019-03-02 21:40:51 -05:00
Filippo Valsorda a68796f011 internal/radix51: test all combinations of argument and receiver aliasing 2019-03-02 19:44:59 -05:00
Henry de Valence 5758cbf76c internal/radix51: add property-based tests that multiplication distributes over addition
Closes #12
2019-03-02 19:44:59 -05:00
George Tankersley 4ac00273fd radix51: use go1.12 intrinsics for 128-bit multiplications 2019-02-19 18:36:55 -05:00
Filippo Valsorda 6b0cdf071a internal/radix51: define a mask64Bits constant 2019-01-28 10:53:34 -05:00
Filippo Valsorda 032d7f64e8 internal/group: set Z to 1, not 0 in FromAffine 2019-01-28 10:53:34 -05:00