Commit graph

1078 commits

Author SHA1 Message Date
Henry de Valence
ff0dc4a3db Merge branch 'master' into develop 2019-01-27 23:19:44 -08:00
Henry de Valence
4bdccd7b7c Merge branch 'release/1.0.3' 2019-01-27 23:18:35 -08:00
Henry de Valence
9cd4551b40 Bump patch version 2019-01-27 23:17:27 -08:00
Henry de Valence
33e7d26513 Merge branch 'add-compressed-cteq-impls' into release/1.0.3 2019-01-27 23:16:48 -08:00
Henry de Valence
5ddc30061c Implement ConstantTimeEq on compressed points. 2019-01-27 23:13:58 -08:00
Henry de Valence
6d7d94372e
Merge pull request #227 from isislovecruft/fix/weird-pub
I found a weird pub, not the kind you get cidre in.
2019-01-24 14:12:10 -08:00
Isis Lovecruft
0d23260a75
I found a weird pub, not the kind you get cidre in. 2019-01-24 21:36:00 +00:00
Henry de Valence
8e5062521f
Merge pull request #225 from isislovecruft/fix/invsqrt-doc-typos
Fix two typos in FieldElement::invsqrt documentation
2019-01-21 18:50:14 -08:00
Isis Lovecruft
4270d4ff5f
Fix two typos in FieldElement::invsqrt documentation. 2019-01-22 01:01:08 +00:00
Henry de Valence
353e3fe81a
Merge pull request #215 from hdevalence/ifma
Restructure vector backends and add a new IFMA backend
2019-01-19 21:51:13 -08:00
Henry de Valence
e3ca8961fc Fix rustdoc feature flags to compile on stable. 2019-01-18 14:19:39 -08:00
Henry de Valence
9ddbf1ba83 Add notes on the IFMA implementation. 2019-01-18 14:19:39 -08:00
Henry de Valence
dc8431429f Refactor documentation to use doc_cfg. 2019-01-18 14:19:39 -08:00
Henry de Valence
5700add507 Clean up warnings. 2019-01-18 14:19:30 -08:00
Henry de Valence
fa42708257 Change naming scheme for multiplication accumulators. 2019-01-18 14:19:30 -08:00
Henry de Valence
a84f9eafe4 Allow non_snake_case in the IFMA field and edwards modules. 2019-01-18 14:19:30 -08:00
Henry de Valence
06766bfdea Delay shuffles that cross the "Great Wall of Intel". 2019-01-18 14:19:30 -08:00
Henry de Valence
33aa544cf4 Add IFMA constants file. 2019-01-18 14:19:30 -08:00
Henry de Valence
f825426ff4 Add impl Default, Identity for ExtendedPoint, CachedPoint. 2019-01-18 14:19:30 -08:00
Henry de Valence
da62569355 Add lookup table support. 2019-01-18 14:19:30 -08:00
Henry de Valence
6cec313f16 Add impl of Sub and Neg for Edwards points. 2019-01-18 14:19:30 -08:00
Henry de Valence
6faaef21df Add mul_by_pow_2 for IFMA 2019-01-18 14:19:30 -08:00
Henry de Valence
8e38ff2859 Add Edwards doubling implementation. 2019-01-18 14:19:30 -08:00
Henry de Valence
c4617b28a9 Add squaring implementation. 2019-01-18 14:19:30 -08:00
Henry de Valence
a62571b003 Reduce field elements during conversion to vector form.
The IFMA types have tighter bounds than the u64 types.
2019-01-18 14:19:30 -08:00
Henry de Valence
3f21bb3b58 Add skeleton of parallel Edwards formulas. 2019-01-18 14:19:30 -08:00
Henry de Valence
5880fced2b Add skeleton of shuffle and blend functions. 2019-01-18 14:19:30 -08:00
Henry de Valence
d90bb779ca Delay all computations using x[0], y[0]
Since computation of the 0 term in reduction requires a multiplication with a
4-cycle latency, this ensures that the rest of the computation can start before
the 0 term is finished
2019-01-18 14:19:30 -08:00
Henry de Valence
c925c76342 Change the strategy for reducing the high half of the product. 2019-01-18 14:19:30 -08:00
Henry de Valence
607b839032 Change size of limbs in the reduction test. 2019-01-18 14:19:30 -08:00
Henry de Valence
14163131f9 Lift the reduction state of the field elements into the type system.
This splits the `FieldElement51x4` type into two types:

- `F51x4Reduced` (with reduced limbs)
- `F51x4Unreduced` (with unreduced limbs)

The reduction is implemented as a `From` impl to convert one type to the other.

The output of a multiplication is now a `F51x4Unreduced`.  The reason is that
the inputs to IFMA operations must be at most 52 bits, so it's not possible to
perform an addition of (51+epsilon)-bit values and still be small enough to be
used as an input to multiplication.  So, it doesn't make sense to perform a
reduction at the end of a multiplication, because the reduced values will be
fed into an addition or subtraction, which then needs to be re-reduced.
2019-01-18 14:19:30 -08:00
Henry de Valence
ff49673214 Add impl Mul<(u32, u32, u32, u32)> for FieldElement51x4. 2019-01-18 14:19:30 -08:00
Henry de Valence
70199d6094 Add impl Mul<FieldElement51x4> for FieldElement51x4. 2019-01-18 14:19:30 -08:00
Henry de Valence
aa73d7b1bc Add a FieldElement51x4 type. 2019-01-18 14:19:30 -08:00
Henry de Valence
3233e2eac6 Fix: cfg_target_feature is stable since 1.27. 2019-01-18 14:19:20 -08:00
Henry de Valence
be77af1cd8 Remove unnecessary feature gate.
The vector backend doesn't generate constants in build.rs, so this isn't necessary.
2019-01-18 14:18:55 -08:00
Henry de Valence
e91cc685b1 Don't generate unused constants in build.rs. 2019-01-18 14:15:28 -08:00
Henry de Valence
47a164da4d Replace avx2_backend with simd_backend (autoselects AVX2/IFMA) 2019-01-18 01:52:17 -08:00
Henry de Valence
9ed2128a10 Add stub code for IFMA intrinsics in Rust. 2019-01-18 01:52:17 -08:00
Henry de Valence
0a97f5fe8c Don't compile the serial scalar_mul when using the vector one. 2019-01-18 01:52:07 -08:00
Henry de Valence
f1d2b5182b Restructure source tree into serial and vector backends.
This begins to attempt to restructure the source tree so that the common parts
are common and the different parts are different.

The backend is now split into two parts:
- serial (containing the implementation using serial formulas and mixed-model arithmetic).
- vector (containing the implementation using parallel formulas and single-model arithmetic).

The serial scalar_mul tree is now under backend::serial::scalar_mul.
The avx2 scalar_mul tree is now under backend::avx2::scalar_mul.
2019-01-18 01:49:40 -08:00
Henry de Valence
94cb3e7842 Rename field types based on radix.
`FieldElement32` -> `FieldElement2625`
`FieldElement64` -> `FieldElement51`
`Scalar32` -> `Scalar29`
`Scalar64` -> `Scalar52`

This naming is more accurate and would let us add an ADX backend later.
2019-01-17 22:21:55 -08:00
Henry de Valence
4814242d00 Merge branch 'master' into develop 2019-01-17 19:26:50 -08:00
Henry de Valence
3564d18ff8 Merge branch 'release/1.0.2' 2019-01-17 19:26:35 -08:00
Henry de Valence
0328fb1342 Bump patch version 2019-01-17 19:25:34 -08:00
Henry de Valence
f48980cb5b
Merge pull request #223 from hdevalence/ristretto-fix
Fix variable naming in Ristretto decoding formulas
2019-01-16 17:54:23 -08:00
Henry de Valence
e6f27ca996 Fix Ristretto variable naming in decoding function
The code swaps u_1 and u_2 relative to the formulas (probably when doing the change for a=-1)
2019-01-13 18:01:00 -08:00
Henry de Valence
78cc7748d7 Merge branch 'master' into develop 2018-12-13 15:45:22 -08:00
Henry de Valence
7de65dc32c Merge branch 'release/1.0.1' 2018-12-13 15:45:09 -08:00
Henry de Valence
5d4b5cb2a4 Bump version to 1.0.1 2018-12-13 15:43:26 -08:00