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
Henry de Valence
fca2cd5f95
Use the released version of subtle (oops)
2018-12-13 15:42:31 -08:00
Henry de Valence
3d6e0804de
Merge branch 'master' into develop
2018-12-13 15:39:25 -08:00
Henry de Valence
9855ba6b51
Merge branch 'release/1.0.0'
2018-12-13 15:39:06 -08:00
Henry de Valence
9b4361db8b
Finalize 1.0.0
2018-12-13 15:35:32 -08:00
Henry de Valence
6239a92055
Merge branch 'master' into develop
2018-11-18 10:47:51 -08:00
Henry de Valence
cd14527420
Merge branch 'release/1.0.0-pre.1'
2018-11-18 10:47:40 -08:00
Henry de Valence
7f63eaec60
Bump version to 1.0.0-pre.1
2018-11-18 10:44:30 -08:00
Henry de Valence
fc067303bb
Merge pull request #211 from IronCoreLabs/rand-0.6
...
Update to use Rand 0.6
2018-11-15 11:13:45 -08:00
Henry de Valence
55b96aab6d
Merge pull request #210 from DebugSteven/default-montgomerypoint
...
Default & Identity trait for MontgomeryPoint
2018-11-14 20:35:35 -08:00
DebugSteven
39145da396
implement default for MontgomeryPoint using zero byte array
2018-11-14 23:16:50 -05:00
Colt Frederickson
b5d6e94a64
Build for 0.6.0
2018-11-14 14:39:47 -07:00
DebugSteven
2adc985f63
default & identity trait for MontgomeryPoint
2018-11-14 14:43:11 -05:00
Henry de Valence
b75d528f4a
Merge branch 'master' into develop
2018-11-05 16:22:10 -08:00
Henry de Valence
d58b663ea8
Merge branch 'release/1.0.0-pre.0'
2018-11-05 16:21:57 -08:00
Henry de Valence
18a7fb360a
Bump version to 1.0.0-pre.0
2018-11-05 16:15:07 -08:00
isis agora lovecruft
5d0bdf2f21
Merge pull request #205 from dalek-cryptography/fix-subtle-traits
...
Change to subtle::ConditionallySelectable
2018-11-05 23:50:35 +00:00
isis agora lovecruft
0a1dc053d1
Merge pull request #203 from dalek-cryptography/sqrt_i
...
Refactor square root computations and Elligator
2018-11-05 23:16:59 +00:00
Henry de Valence
92a3b9db49
Change to subtle 2.0.0-pre.0
2018-11-05 15:09:50 -08:00
Henry de Valence
a116fd9679
test subtle 2.0
2018-11-05 12:06:23 -08:00
Henry de Valence
53fcd1060d
Change internal API to use ConditionallySelectable
2018-11-02 14:17:43 -07:00
Henry de Valence
b0a190bd63
Change externally-exposed API to implement ConditionallySelectable
2018-11-02 14:16:51 -07:00
Henry de Valence
2e8f3c8f41
Merge pull request #201 from tarcieri/digest-0-8
...
Update to digest 0.8 and sha2 0.8
2018-11-02 12:03:47 -07:00
Henry de Valence
77edbeb7a0
Remove generic-array build dep
2018-11-02 11:41:36 -07:00
Henry de Valence
8f605dce6d
Tweak ristretto elligator to match ristretto.group description
2018-11-01 17:41:56 -07:00
Henry de Valence
4e2fc53e5b
Refactor sqrt_ratio to return either sqrt(u/v) or sqrt(iu/v)
...
Also removes the chi function since Ristretto elligator merges it with the square root.
2018-11-01 17:37:18 -07:00
Tony Arcieri
31e8626133
Update to digest 0.8 and sha2 0.8
...
Vicariously updates to `generic-array` 0.12, however this change also
removes `generic-array` as a direct dependency, as it can be sourced
from the `digest` crate.
2018-10-19 10:44:42 -07:00
Henry de Valence
1c2d131a80
Merge branch 'master' into develop
2018-09-26 16:20:06 -07:00
Henry de Valence
137aa24f3b
Merge branch 'release/0.21.0'
2018-09-26 16:19:51 -07:00
Henry de Valence
451636b99d
Bump version
2018-09-26 16:17:44 -07:00
Henry de Valence
48960c327b
Merge pull request #199 from dalek-cryptography/serde-compressed
...
Add compressed point support for Serde.
2018-09-26 16:15:39 -07:00