Commit Graph

148 Commits

Author SHA1 Message Date
Henry de Valence 596a79126e internal/ed25519: use twoD 2019-05-08 14:54:33 -07:00
Henry de Valence c56a898ecf internal/ed25519: add tests for multi-model point types. 2019-05-08 14:54:33 -07:00
Henry de Valence 158f91f02f internal/ed25519: add multi-model point types. 2019-05-08 14:54:33 -07:00
Henry de Valence 070fa146ec internal/scalar: add constant-time signed radix 16
Closes #10
2019-05-08 14:42:51 -07:00
Henry de Valence f2b1a09ecb internal/scalar: add non-adjacent form
Closes #13

This code is adapted from code I wrote for curve25519-dalek.
2019-05-08 14:42:51 -07:00
George Tankersley 94a47ae390 internal/scalar: don't zero memory that is about to be copied over 2019-04-19 17:15:16 -04:00
George Tankersley 7803101170 internal/scalar: add scalar field implementation 2019-04-19 17:15:16 -04:00
Filippo Valsorda 675dee67e6 ristretto255: do not modify the receiver if Decode fails 2019-04-19 17:11:44 -04:00
Filippo Valsorda 971fdbf516 ristretto255: add TestRistrettoFromUniformBytesTestVectors 2019-04-19 13:52:37 -07:00
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