Henry de Valence
5a58f42155
Point to https://ristretto.group since our notes live there now.
2018-07-20 12:24:28 -07:00
Henry de Valence
6eb876f3cb
Fix doctests (missed during merge)
2018-07-20 11:50:42 -07:00
Henry de Valence
bb50700d77
Merge pull request #163 from hdevalence/fallible-multiscalar-mul
...
Allow Options in the VartimeMultiscalarMul trait
2018-07-20 11:28:19 -07:00
Isis Lovecruft
6f82c30a88
Fix doctests for From<u64> for Scalar.
2018-07-20 04:45:06 +00:00
Isis Lovecruft
4d390fbd94
Merge remote-tracking branch 'hdevalence/scalar-from-impls' into develop
2018-07-20 01:09:44 +00:00
Isis Lovecruft
9105d0977a
Merge remote-tracking branch 'hdevalence/more-pre-1.0-cleanups' into develop
2018-07-20 00:15:12 +00:00
Isis Lovecruft
e5d3f8f72e
Merge branch 'feature/148-cleanup-for-1.0.0-pre.0_1' into develop
2018-07-20 00:09:21 +00:00
Isis Lovecruft
73a5f4711a
Remove unnecessary extern crate sha2 from test code.
2018-07-20 00:06:31 +00:00
Isis Lovecruft
7b22fe6e87
Change the wording on the Scalar::as_bytes() docstring.
2018-07-20 00:04:25 +00:00
Henry de Valence
1e74cb3e56
Replace Scalar::from_u64 with From impls
...
Unfortunately, Rust selects `i32` as the type for an integer literal
when the literal has no other type constraints. This means that someone
cannot write `Scalar::from(1)`, as Rust will choose `i32` as the type for
`1`, and we don't `impl From<i32> for Scalar`.
We could implement `From` conversions for signed integers, but since
`Scalar` operations should be constant-time by default, this would
require us to extract the sign bit of the integer and use it to
conditionally select between the positive and negative of Scalar
constructed from the value bits. This is more expensive than the
unsigned operation, and I don't think it's what anyone really wants.
Making API consumers specify that their literals are unsigned is
slightly annoying, but better than the above alternative.
It would also be nice to change `Scalar::from_hash` to be
`impl<D: Digest<OutputSize = U64>> From<D> for Scalar`,
but this isn't currently allowed by Rust (since that `impl` "could"
conflict with the `impl From<u8>` if someone decided that `u8` should
`impl Digest`).
2018-07-19 08:39:09 -07:00
Henry de Valence
b4db0afe18
Allow Options in the VartimeMultiscalarMul trait
...
This changes the primary function for the `VartimeMultiscalarMul` trait
to an `optional_multiscalar_mul` trait that accepts
`Option<Self::Point>` (and returns `None` if any input points are
`None`).
The existing `vartime_multiscalar_mul` is changed to be a wrapper around
this function to avoid code duplication. This may result in an
extra copy of each input point, but that cost is probably not
significant compared to the cost of the multiscalar multiplication.
The motivation is to allow performing multiscalar multiplications with
inline decompression. Currently, API consumers have to allocate
temporary buffers for all of their points, decompress into those
buffers, then pass (iterators over) those buffers into the multiscalar
multiplication code, which then creates new buffers for lookup tables.
2018-07-17 08:19:48 -07:00
Henry de Valence
7bbf7495b0
Change VartimeMultiscalarMul docs to use vartime_
2018-07-16 22:54:45 -07:00
Henry de Valence
dfc9e7c0b7
fixup extendedpoint validity check
2018-07-16 22:28:22 -07:00
Henry de Valence
0c58de0367
it wouldn't be
2018-07-16 22:22:58 -07:00
Henry de Valence
f7f3f79da8
Add missing Ristretto vartime-double-base fn
2018-07-16 22:22:21 -07:00
Henry de Valence
5bb6cd42a2
we won't remove this function
2018-07-16 22:13:40 -07:00
Henry de Valence
bc731f9d79
Remove fixme notes from FieldElement code
2018-07-16 22:11:48 -07:00
Henry de Valence
8d46eacd2c
Clarify wording on the nightly feature and CT
...
Closes #147
2018-07-16 21:56:28 -07:00
Henry de Valence
ca8c46220b
Add safety notes to the README
2018-07-16 21:56:28 -07:00
Henry de Valence
e0b7af8957
Merge pull request #161 from isislovecruft/fix/160-alloc-import
...
Fix alloc import
2018-07-16 21:55:37 -07:00
Isis Lovecruft
46c98224f5
Remove erroneous and extraneous alloc import from edwards module.
...
The "alloc" feature doesn't compile otherwise.
* FIXES #160 .
2018-07-17 00:28:04 +00:00
Isis Lovecruft
74a28559c4
Add example code for Scalar.to_bytes() and Scalar.as_bytes().
2018-07-17 00:22:34 +00:00
Isis Lovecruft
ff16e93102
Add doctest for Scalar::from_hash().
2018-07-17 00:21:37 +00:00
Isis Lovecruft
61daa9dce6
Add a doctest for Scalar::from_u64().
2018-07-06 00:12:35 +00:00
Isis Lovecruft
3854eb0fd8
Remove extra line and unneeded XXX comment from Scalar::hash_from_bytes.
2018-07-06 00:10:41 +00:00
Isis Lovecruft
37935674eb
Add doctest for Scalar::random().
2018-07-06 00:10:21 +00:00
Henry de Valence
87a1815b40
Merge pull request #155 from isislovecruft/feature/148-cleanup-for-1.0.0-pre.0
...
some pre-1.0.0 cleanup
2018-07-05 14:29:01 -07:00
Henry de Valence
fa904c2c42
Add note on backend selection requirement
2018-07-05 13:39:29 -07:00
Henry de Valence
5b009a033e
Remove extra line in doctest
2018-07-05 13:34:14 -07:00
Henry de Valence
0ab60b93ee
Update wording on Scalar::invert to use self
2018-07-05 13:34:02 -07:00
Henry de Valence
b70b32a0c5
Change Scalar example to use the hasher functions
2018-07-05 13:27:09 -07:00
Henry de Valence
f6f20f4598
Merge pull request #152 from isislovecruft/feature/update-rand-0.5.3
...
Update rand dependency to 0.5.3.
2018-07-05 11:52:46 -07:00
Isis Lovecruft
f43f4f9770
Update year in copyright notices to 2018.
2018-07-05 00:30:27 +00:00
Isis Lovecruft
03154d47ec
Add an example doctest for Scalar.invert().
2018-07-05 00:30:27 +00:00
Isis Lovecruft
faf8609246
Copy the inversions of 0 warning to the invert() method.
2018-07-05 00:14:55 +00:00
Isis Lovecruft
626e070896
Document Scalar contructors with doctests.
2018-07-04 23:57:04 +00:00
Isis Lovecruft
5b263dabd0
Line wrap some docstrings in scalar.rs.
2018-07-04 21:43:13 +00:00
Isis Lovecruft
b3da93b069
Clarify README documentation on nightly-only features.
2018-07-04 21:36:57 +00:00
Isis Lovecruft
f4669c8b4d
Move the Scalar constructor documentation to the module level.
2018-07-04 21:29:36 +00:00
Isis Lovecruft
1b52b4b7b7
Thank Sean Bowe and Daira Hopwood in the README.
2018-07-04 20:59:37 +00:00
Isis Lovecruft
4a54f66a48
Move documentation of yolocrypto feature in README.
2018-07-04 20:54:05 +00:00
Isis Lovecruft
ebf0801dfc
Update warning statement on production readiness in README.
2018-07-04 20:50:22 +00:00
Isis Lovecruft
11aa71fb8d
Merge remote-tracking branch 'ebfull/sequential-montgomery-trick' into develop
2018-07-04 20:24:19 +00:00
Isis Lovecruft
3dbfad2f7a
Update rand dependency to 0.5.
2018-07-04 20:16:31 +00:00
Henry de Valence
77fac96a2c
Merge pull request #153 from isislovecruft/feature/update-subtle-0.7.0
...
Bump subtle dependency to 0.7.0.
2018-07-04 13:15:31 -07:00
Isis Lovecruft
b214e6e796
Bump subtle dependency to 0.7.0.
2018-07-04 19:56:16 +00:00
Henry de Valence
ce3595f642
Merge pull request #151 from ebfull/fix-mont-constant-comment
...
Fix adjustment factor comment
2018-07-02 14:14:10 -07:00
Sean Bowe
61d6d89cd8
Fix comment describing Montgomery adjustment factor's value.
2018-07-02 10:41:45 -06:00
Sean Bowe
c4f86b231c
Only test debug assertion in batch_invert when debug assertions are enabled.
2018-07-01 15:07:04 -06:00
Sean Bowe
02af12b81a
Replace batch inversion for FieldElement with sequential variant of Montgomery's trick.
2018-07-01 15:07:04 -06:00