-
Notifications
You must be signed in to change notification settings - Fork 11
Implement ProjectivePoint
and improved docs.
#56
Commits on Jul 4, 2019
-
Define
ProjectivePoint
struct and implementDebug
for itA `ProjectivePoint` represents a point on the Doppio Curve expressed over the Twisted Edwards Projective Coordinates eg. (X, Y, Z).
Configuration menu - View commit details
-
Copy full SHA for c86ecb7 - Browse repository at this point
Copy the full SHA c86ecb7View commit details -
Implement Default and Identity traits for
ProjectivePoint
`Default` returns the `Identity` impl for `ProjectivePoint` which gives back: (0,1,1)
Configuration menu - View commit details
-
Copy full SHA for 08a23d9 - Browse repository at this point
Copy the full SHA 08a23d9View commit details -
Implement Into trait for ProjectivePoint
This performs the conversion from a ProjectivePoint into an `EdwardsPoint` one.
Configuration menu - View commit details
-
Copy full SHA for a683322 - Browse repository at this point
Copy the full SHA a683322View commit details -
Implement
From
trait forProjectivePoint
- Allows us to perform the conversion from an `EdwardsPoint` to a `ProjectivePoint`. Given (X:Y:T:Z) in εε, passing to ε is cost-free by simply ignoring `T`. Twisted Edwards Curves Revisited - Huseyin Hisil, Kenneth Koon-Ho Wong, Gary Carter, and Ed Dawson, Section 3.
Configuration menu - View commit details
-
Copy full SHA for f784267 - Browse repository at this point
Copy the full SHA f784267View commit details -
Implement Point Doubling for
ProjectivePoint
Source: 2008 Hisil–Wong–Carter–Dawson, http://eprint.iacr.org/2008/522, Section 3.1. Cost: 3M+ 4S+ +7a + 1D
Configuration menu - View commit details
-
Copy full SHA for cec2468 - Browse repository at this point
Copy the full SHA cec2468View commit details -
Configuration menu - View commit details
-
Copy full SHA for d56cb5a - Browse repository at this point
Copy the full SHA d56cb5aView commit details -
Add tests for conversions between Projective and Extended
These conevrsions are implemented on the `From` trait implementations.
Configuration menu - View commit details
-
Copy full SHA for bdb0117 - Browse repository at this point
Copy the full SHA bdb0117View commit details
Commits on Jul 5, 2019
-
Configuration menu - View commit details
-
Copy full SHA for dc3f4ff - Browse repository at this point
Copy the full SHA dc3f4ffView commit details -
Implement
Neg
forProjectivePoint
The neg operation perfoms the Negation over Twisted Edwards Projective Coordinates, giving back (-X, Y, Z) as a result.
Configuration menu - View commit details
-
Copy full SHA for 0db4294 - Browse repository at this point
Copy the full SHA 0db4294View commit details -
Implement
Add
forProjectivePoint
This implementation executes the point addition operation over the Doppio Curve between two points expressed on Porjective Twisted Edwards Coordinates.
Configuration menu - View commit details
-
Copy full SHA for 33666d0 - Browse repository at this point
Copy the full SHA 33666d0View commit details -
Configuration menu - View commit details
-
Copy full SHA for f9fcc41 - Browse repository at this point
Copy the full SHA f9fcc41View commit details -
Implement tests for
ProjectivePoint
negationTested: - Random point negation. - Identity negation.
Configuration menu - View commit details
-
Copy full SHA for 809d7d1 - Browse repository at this point
Copy the full SHA 809d7d1View commit details -
Define testing Point values in Projective Coordinates
On this way, we don't need to use Point conversions on every test (which are already being tested on other tests).
Configuration menu - View commit details
-
Copy full SHA for 3a4aabf - Browse repository at this point
Copy the full SHA 3a4aabfView commit details -
[WIP] Implement tests for Projective Point addition
Tests are failing, so we will review the paper again to see what we are missing.
Configuration menu - View commit details
-
Copy full SHA for 529fadd - Browse repository at this point
Copy the full SHA 529faddView commit details -
Implement
Add
forFieldElement
by valueThis implementation calls to the `Add<&'a FieldElement> for &'b FieldElement`. The implementation intends to make the point implementations easier, avoiding the &(&(&())) problem.
Configuration menu - View commit details
-
Copy full SHA for ea7dc37 - Browse repository at this point
Copy the full SHA ea7dc37View commit details -
Implement Traits for
FieldElement
without referencesThe implementation intends to make the point implementations easier, avoiding the &(&(&())) problem. Traits implemented: - Add - Sub - Mul - Neg This closes #47 on the field part.
Configuration menu - View commit details
-
Copy full SHA for ba752d3 - Browse repository at this point
Copy the full SHA ba752d3View commit details -
Improve docs for
Mul
implementationAdded a short description about how the mul function works. And which usage makes of the Montgomery Reduction.
Configuration menu - View commit details
-
Copy full SHA for 121b903 - Browse repository at this point
Copy the full SHA 121b903View commit details -
Implement
Add
forScalar
for non-reference valuesThe implementation intends to make the point implementations easier, avoiding the &(&(&())) problem mentioned on #47.
Configuration menu - View commit details
-
Copy full SHA for adddfeb - Browse repository at this point
Copy the full SHA adddfebView commit details -
The implementation intends to make the point implementations easier, avoiding the &(&(&())) problem mentioned on #47 .
Configuration menu - View commit details
-
Copy full SHA for 1a131a1 - Browse repository at this point
Copy the full SHA 1a131a1View commit details -
Implement
Neg
forScalar
and&Scalar
Following the guidelines specified on #47 , negate trait is implemented for Scalar and a reference of it. Performs the negation operation over the modular field formed by the prime of the sub-group.
Configuration menu - View commit details
-
Copy full SHA for cd2eb27 - Browse repository at this point
Copy the full SHA cd2eb27View commit details -
The identity function implemented for `Scalar` returns the identity element of the field = `1 (mod l)`.
Configuration menu - View commit details
-
Copy full SHA for 3aab967 - Browse repository at this point
Copy the full SHA 3aab967View commit details -
Square performs the operation `a^2` for whatever element of the field generated by the prime of the sub-group. NOTE: Here we don't implement it fo `Scalar` also (as said in #47) because it only has one operator, se we are not winning anything.
Configuration menu - View commit details
-
Copy full SHA for 286dfa2 - Browse repository at this point
Copy the full SHA 286dfa2View commit details -
Refactor
Mul
tests forScalar
implementationRefactored some of the tests of the `Scalar` tests mod. According to the new `ops` trait implementations.
Configuration menu - View commit details
-
Copy full SHA for bf8f861 - Browse repository at this point
Copy the full SHA bf8f861View commit details -
Implement tests for squaring impl for
Scalar
- Squaring a random Scalar. - Square the identity element. - Square the null element. All passed.
Configuration menu - View commit details
-
Copy full SHA for aaf23ae - Browse repository at this point
Copy the full SHA aaf23aeView commit details -
Improve
Identity
trait def and createSquare
trait.Created `Square` trait since it's an operation that has to be performed a lot of times for different elements of the lib such as: - FieldElement - Scalar
Configuration menu - View commit details
-
Copy full SHA for fbf52c4 - Browse repository at this point
Copy the full SHA fbf52c4View commit details -
Implement
square_internal()
forFieldElement
This operation returns a double_precision result expressed on: `[u128; 9]` with the result of the squaring.
Configuration menu - View commit details
-
Copy full SHA for 7c16654 - Browse repository at this point
Copy the full SHA 7c16654View commit details
Commits on Jul 6, 2019
-
Implement tests for
Square
impl for&FieldElement
Implemented tests for - Random FieldElement squaring. - Identity element squaring. - Null element squaring.
Configuration menu - View commit details
-
Copy full SHA for f718b6e - Browse repository at this point
Copy the full SHA f718b6eView commit details -
Fix doc-comments & Change internal fn visibility for Scalar
Since there's not any need for the final user for using the internal functions (even it can be a problem if hasn't the knowledge of what they do), the visibility of them has been hidden/reduced to it's module only using `(self)`.
Configuration menu - View commit details
-
Copy full SHA for 454471c - Browse repository at this point
Copy the full SHA 454471cView commit details -
Fix doc-comments & Change internal fn visibility for Scalar & FieldEl…
…ement Since there's not any need for the final user for using the internal functions (even it can be a problem if hasn't the knowledge of what they do), the visibility of them has been hidden/reduced to it's module only using `(self)`.
Configuration menu - View commit details
-
Copy full SHA for 789690a - Browse repository at this point
Copy the full SHA 789690aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3996fe6 - Browse repository at this point
Copy the full SHA 3996fe6View commit details -
Add
#[cfg(test)]
foredwards.rs
tests moduleThis makes that edwards tests will only be run if `cargo test` is executed, but will never be executed when `cargo build` is executed.
Configuration menu - View commit details
-
Copy full SHA for 7fde279 - Browse repository at this point
Copy the full SHA 7fde279View commit details -
Benchmark all
FieldElement
andScalar
basic ops.Refactored and re-ordered all of the Criterion tests in oder to improve them.
Configuration menu - View commit details
-
Copy full SHA for 646dc10 - Browse repository at this point
Copy the full SHA 646dc10View commit details -
Implement Benchmarks for Twisted Edwards Extended Coordinates Point ops
Refactored and re-ordered all of the Criterion tests in oder to improve them.
Configuration menu - View commit details
-
Copy full SHA for eb66db5 - Browse repository at this point
Copy the full SHA eb66db5View commit details -
Implement Point Addition for
ProjectivePoint
.Following guidelines of #47 we've implemented addition for reference, and non-reference ProjectivePoints.
Configuration menu - View commit details
-
Copy full SHA for 9aceeab - Browse repository at this point
Copy the full SHA 9aceeabView commit details -
Add debug_assert macro on
half()
function for FieldElementThis is intended to prevent users to try to use numbers greater than 260 as exp.
Configuration menu - View commit details
-
Copy full SHA for f2b3ac6 - Browse repository at this point
Copy the full SHA f2b3ac6View commit details -
Implement
Sub
forProjectivePoint
Note that the sub implementation is just the addition but negating the second point. The trait has been implemented following #47 suggestions.
Configuration menu - View commit details
-
Copy full SHA for a842a00 - Browse repository at this point
Copy the full SHA a842a00View commit details -
Declare DoubleAndAdd trait on edwards.rs
This trait intends to be the generical one for the double_and_add algorithm for the different types of points on the Doppio curve.
Configuration menu - View commit details
-
Copy full SHA for 3e6dfff - Browse repository at this point
Copy the full SHA 3e6dfffView commit details -
Create
Double
op trait and impl forEdwardsPoint
Created `Double` trait since it will be used by all of the different Point Coordinates declared on this library.
Configuration menu - View commit details
-
Copy full SHA for b0d9bd6 - Browse repository at this point
Copy the full SHA b0d9bd6View commit details
Commits on Jul 7, 2019
-
Implemented `double_and_add()` as a generic fn for types that implement `Add`, `Double`, `Identity` and `Clone`.
Configuration menu - View commit details
-
Copy full SHA for d258b66 - Browse repository at this point
Copy the full SHA d258b66View commit details -
Move traits and impl Double on traits.rs
Added a math module inside of tratis.rs file.
Configuration menu - View commit details
-
Copy full SHA for 282ea8a - Browse repository at this point
Copy the full SHA 282ea8aView commit details -
Define
Half
trait ontraits.rs
.Since various types implement it, it's better to implement half operation as a trait and impl it for the types that need it.
Configuration menu - View commit details
-
Copy full SHA for fe6e5b4 - Browse repository at this point
Copy the full SHA fe6e5b4View commit details -
Implement
Half
trait forFieldElement
Made the implementation for `&FieldElement`.
Configuration menu - View commit details
-
Copy full SHA for f112b0b - Browse repository at this point
Copy the full SHA f112b0bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8144f5a - Browse repository at this point
Copy the full SHA 8144f5aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ad497a - Browse repository at this point
Copy the full SHA 1ad497aView commit details -
Impl
Div
trait for&FieldElement
Performs the op: `x / y (mod l)`. Since on modular fields we don't divide, the equivanelnt op is: `x * (y^-1 (mod l))`, which is equivalent to the naive division but for Finite Fields.
Configuration menu - View commit details
-
Copy full SHA for 6fbbbb8 - Browse repository at this point
Copy the full SHA 6fbbbb8View commit details -
Implement
Div
for non reference FieldElementThis follows #47 guidelines. Performs the op: `x / y (mod l)`. Since on modular fields we don't divide, the equivanelnt op is: `x * (y^-1 (mod l))`, which is equivalent to the naive division but for Finite Fields.
Configuration menu - View commit details
-
Copy full SHA for e7104d7 - Browse repository at this point
Copy the full SHA e7104d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 991b605 - Browse repository at this point
Copy the full SHA 991b605View commit details
Commits on Jul 8, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 51b6eec - Browse repository at this point
Copy the full SHA 51b6eecView commit details -
Implement test for
Div
impl forFieldElement
Implemented a test where we compute the EDWARDS_D constant value which equals: `(-86649/86650) mod l`. This completely verifies that the trait impl is working when performing `x*inverse_mod(y, l) mod l`.
Configuration menu - View commit details
-
Copy full SHA for d7caad3 - Browse repository at this point
Copy the full SHA d7caad3View commit details -
Add assert! check in
two_pow_k()
In order to avoid errors on end-users site, change the debug_assert! by assert! to make the lib panic.
Configuration menu - View commit details
-
Copy full SHA for d700910 - Browse repository at this point
Copy the full SHA d700910View commit details -
Implement FieldElement security checks not only for debug builds.
In order to avoid end-user implementation errors, add `assert!` for `debug_assert!` statements. This has been done on: - Div impl when dividing by zero. - Half if the input is not even.
Configuration menu - View commit details
-
Copy full SHA for 17b3cc4 - Browse repository at this point
Copy the full SHA 17b3cc4View commit details -
Impl assert! instead of debug_assert! for Scalars
This is done to avoid errors on final user implementations.
Configuration menu - View commit details
-
Copy full SHA for d10c467 - Browse repository at this point
Copy the full SHA d10c467View commit details -
Configuration menu - View commit details
-
Copy full SHA for 999d46e - Browse repository at this point
Copy the full SHA 999d46eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8450e4f - Browse repository at this point
Copy the full SHA 8450e4fView commit details
Commits on Jul 9, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 38bf29a - Browse repository at this point
Copy the full SHA 38bf29aView commit details -
Configuration menu - View commit details
-
Copy full SHA for a20ed03 - Browse repository at this point
Copy the full SHA a20ed03View commit details -
Implement
two_pow_k()
for&Scalar
This function provides support to some `edwards.rs` functions as well as it is also a way of constructing an Scalar. The function is inlined and documented.
Configuration menu - View commit details
-
Copy full SHA for 9ba89d0 - Browse repository at this point
Copy the full SHA 9ba89d0View commit details -
Impl
mul_by_pow_2()
for&EdwardsPoint
The function multiplies an `EdwardsPoint` for an Scalar in the form: `2^x`.
Configuration menu - View commit details
-
Copy full SHA for a08f203 - Browse repository at this point
Copy the full SHA a08f203View commit details -
Impl
mul_by_cofactor()
for&EdwardsPoint
This function returns the given `EdwardsPoint` multiplied by the cofactor `h = 8`.
Configuration menu - View commit details
-
Copy full SHA for dafd791 - Browse repository at this point
Copy the full SHA dafd791View commit details -
Configuration menu - View commit details
-
Copy full SHA for afd5db0 - Browse repository at this point
Copy the full SHA afd5db0View commit details
Commits on Jul 10, 2019
-
Define generic Edwards functions on
edwards.rs
As did in d258b66, we have implemented functions that are generic for all of the Edwards Points for generic traits. In this case, we've done it for: - `mul_by_cofactor()` - `mul_by_pow_2()`
Configuration menu - View commit details
-
Copy full SHA for e407f46 - Browse repository at this point
Copy the full SHA e407f46View commit details -
Configuration menu - View commit details
-
Copy full SHA for 812f397 - Browse repository at this point
Copy the full SHA 812f397View commit details -
Implement Double trait for
&ProjectivePoint
.Refactored all of the test and ignored the ones non- working until we find the errors.
Configuration menu - View commit details
-
Copy full SHA for 0e8f659 - Browse repository at this point
Copy the full SHA 0e8f659View commit details -
Implement
Mul
trait for&ProjectiveEdwards
.This closes the development part of #32. Scalar multiplication: compute `Scalar * self`. This implementation uses the algorithm: `add_and_doubling` which is the standard one for this operations and also adds less constraints on R1CS. Hankerson, Darrel; Vanstone, Scott; Menezes, Alfred (2004). Guide to Elliptic Curve Cryptography. Springer Professional Computing. New York: Springer-Verlag.
Configuration menu - View commit details
-
Copy full SHA for d698aaa - Browse repository at this point
Copy the full SHA d698aaaView commit details -
Merge branch 'docs' into provective_edws
Accepted incoming changes to `field.rs` file.
Configuration menu - View commit details
-
Copy full SHA for 463d85d - Browse repository at this point
Copy the full SHA 463d85dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ca65356 - Browse repository at this point
Copy the full SHA ca65356View commit details -
Configuration menu - View commit details
-
Copy full SHA for 526b858 - Browse repository at this point
Copy the full SHA 526b858View commit details -
Configuration menu - View commit details
-
Copy full SHA for c93ec53 - Browse repository at this point
Copy the full SHA c93ec53View commit details -
Impl assert! statement on
inverse
In order to avoid end-user errors, we check that the divisor != 0.
Configuration menu - View commit details
-
Copy full SHA for 45effe9 - Browse repository at this point
Copy the full SHA 45effe9View commit details -
Impl Benchmarks for
ProjectivePoint
vsEdwardsPoint
This closes #49. Benchmarks are done for all of the ops traits implemented for each type. Operations have been performed with the same inputs.
Configuration menu - View commit details
-
Copy full SHA for 97aa478 - Browse repository at this point
Copy the full SHA 97aa478View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e3cb6b - Browse repository at this point
Copy the full SHA 6e3cb6bView commit details