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
Sean Bowe
6294c02b52
Replace batch inversion implementation for Scalar with sequential variant of Montgomery's trick.
2018-07-01 15:07:04 -06:00
Sean Bowe
611fc40318
Add test that an empty vector field inversion returns one.
2018-06-30 16:29:02 -06:00
Sean Bowe
11b1dc142f
Add test for behavior of Scalar::batch_invert().
2018-06-30 09:49:54 -06:00
Henry de Valence
16f39c82e5
Remove yolocrypto from avx2_backend
2018-06-18 13:32:04 -07:00
Henry de Valence
d791047aac
Rewrite notes and documentation.
2018-06-18 13:22:03 -07:00
Henry de Valence
15f97221ba
Suppress extraneous warnings
2018-06-15 13:44:31 -07:00
Henry de Valence
7198719419
Document bounds on FieldElement32x4 functions
2018-06-15 13:36:38 -07:00
Henry de Valence
9f5bd8c4c0
Rename reduce32 to reduce and have it return its result.
...
This means that all FieldElement32x4 operations return values, vs mutating interior state.
2018-06-14 15:54:36 -07:00
Henry de Valence
bab1ebbeb8
Replace scale_by_curve_constants by a Mul<(u32,u32,u32,u32)> impl
2018-06-14 15:42:20 -07:00
Henry de Valence
6ef9e9dcfb
Make publicity a little more consistent
2018-06-14 15:22:16 -07:00
Henry de Valence
97292fef91
Move packing functions to top of the module
2018-06-14 15:21:51 -07:00
Henry de Valence
4dc219910a
Move blend_lanes into the blend function
2018-06-14 15:13:53 -07:00
Henry de Valence
64b1b481ba
Rewrite diff_sum in terms of shuffle, blend, negate
2018-06-14 14:59:11 -07:00
Henry de Valence
fe51adad31
Don't expose u32x8 unpacking functions
2018-06-14 14:32:13 -07:00
Henry de Valence
c46ec9638c
Add documentation
2018-06-14 14:23:24 -07:00
Henry de Valence
eea3eadf5b
Replace special-case swap_{AB,CD} methods with general shuffles
2018-06-14 14:23:24 -07:00
Henry de Valence
02296fafb5
Delete unused constant
2018-06-14 14:23:24 -07:00
Henry de Valence
25d9f3f6ca
Eliminate vector constants from edwards module
2018-06-14 14:23:24 -07:00
Henry de Valence
cc8728b2a6
Add comment about rustc-constant-info to blend function
2018-06-14 14:23:24 -07:00
Henry de Valence
28f10bc183
Change Lanes::ALL to Lanes::ABCD for consistency
2018-06-14 14:23:24 -07:00
Henry de Valence
794ed5c8e3
Rewrite the doubling horrorshow
2018-06-14 14:23:24 -07:00
Henry de Valence
30a2b01c05
Add more selectors to the Lanes enum
2018-06-14 14:19:46 -07:00
Henry de Valence
64cb999866
Make platform-vector lanes constants private
2018-06-14 14:19:26 -07:00
Henry de Valence
00d8b6ea4f
Change negate_D, negate_D_lazy to impl Neg, negate_lazy
2018-06-14 14:17:36 -07:00
Henry de Valence
14ce6d3da6
Add a shuffling abstraction for FieldElement32x4
2018-06-14 14:10:37 -07:00
Henry de Valence
c8dc2a6418
Implement addition for FieldElement32x4
2018-06-14 14:10:32 -07:00
Henry de Valence
bd1e3c5f3e
some rustfmt changes
2018-06-14 14:05:52 -07:00
Isis Lovecruft
9a89a217f8
Merge remote-tracking branch 'dalek/multiscalar-trait-without-precomputation_r1' into develop
2018-05-15 20:23:05 +00:00
Henry de Valence
bbb64312f7
Use rand 0.5
...
Requires `0.5.0-pre.2`, which adds `impl CryptoRng for OsRng`.
2018-05-15 12:30:28 -07:00
Henry de Valence
bab642c5af
Add doc comments
2018-05-15 11:33:38 -07:00
Henry de Valence
2eed24109e
Move double-base scmul to the EdwardsPoint type
2018-05-15 11:33:38 -07:00
Henry de Valence
149c5004e8
Use multiscalar traits for the backend implementations.
2018-05-15 11:33:38 -07:00
Henry de Valence
e3bf9b0213
Add MultiscalarMul and VartimeMultiscalarMul traits.
...
These traits have the same interface, but with different names, so that it's
not possible to use them interchangeably. (Constant-time and variable-time
routines should not be used interchangeably).
This commit changes the external API to use these traits, replacing
```
edwards::multiscalar_mul
edwards::vartime::multiscalar_mul
```
with
```
EdwardsPoint::multiscalar_mul (as an impl)
EdwardsPoint::vartime_multiscalar_mul (as an impl)
```
and similarly for Ristretto.
Refactoring the backend is for a later commit.
Multiscalar multiplication with precomputation is for a later commit.
The `edwards::vartime` module is retained since it's used for
`vartime_double_base_scalar_mul`.
It should be subsumed into the precomputation API in a later commit.
2018-05-15 11:33:38 -07:00
Henry de Valence
34c43c20a9
Rework backend selection code.
...
Each backend can now be selected by an individual feature:
- `u32_backend` for `backend::u32`;
- `u64_backend` for `backend::u64`;
- `avx2_backend` for `backend::avx2`;
The `u64_backend` is selected by default, since most people use X64 and we have
no way to select based on target (see discussion in #126 ). However, these
changes mean that it is possible to select the backend explicitly, and if we
had the ability to select target-default features, we could do so easily.
2018-05-14 17:43:54 -07:00
Henry de Valence
9b6c932635
Rename 'precomputed_tables' to the more accurate 'stage2_build'
2018-05-14 15:41:45 -07:00
Henry de Valence
62bb6b79a1
Merge pull request #134 from Mandragorian/feature-scalar-traits
...
Implement Product and Sum traits
2018-05-03 13:56:45 -07:00
mandragore
96d2fe4905
Implement Sum trait for RistrettoPoint
...
Closes #131 .
2018-05-03 03:42:37 +03:00
mandragore
aff69a58a4
Implement Sum trait for EdwardsPoint
2018-05-03 03:42:37 +03:00
Henry de Valence
185bbd3da8
Fix build on recent nightlies (was broken due to type inference failure)
2018-05-02 17:30:10 -07:00
mandragore
01fd44ffd2
Remove trailing whitespaces
2018-05-02 23:53:52 +03:00
mandragore
3ab087ea7f
Implement Sum trait for Scalar
2018-05-02 23:53:49 +03:00
mandragore
afffe962f9
Implement Product trait for Scalar
2018-05-02 23:53:24 +03:00
Henry de Valence
285e57f2ff
Merge pull request #128 from hdevalence/feature/avx2-docs
...
Update docs for AVX2 backend
2018-04-08 17:16:05 -07:00
Henry de Valence
67ba201835
Update AVX2 documentation
2018-04-08 16:59:57 -07:00
Henry de Valence
6bb2c02a1f
Merge pull request #127 from hdevalence/feature/generalize-naf
...
Generalize NAF code to wider window sizes.
2018-04-08 16:39:45 -07:00
Henry de Valence
1464c4101d
change LSB to least significant bit
2018-04-08 16:29:54 -07:00
Henry de Valence
9fc5602ce7
Split AVX2 docs into markdown file
2018-04-08 15:15:23 -07:00
Henry de Valence
68bbd1bd03
Document algorithm for NAFs
2018-04-06 12:11:59 -07:00