From e56cebae04c07b50d2576afc3e1ed51adaa825b9 Mon Sep 17 00:00:00 2001 From: Victor Lopez Date: Mon, 27 Jul 2020 15:50:28 +0200 Subject: [PATCH 1/2] DHKE should return canonical EC point The shared secret used on the diffie-hellman protocol will be an elliptic curve point. It will be up to the user whether he wants to use the 32-byte scalar representation of the Y coordinate or perform operations with the shared secret. The motivation is to not enforce the user to reconstruct the point in case he need to perform ECC operations. --- src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 38392e0..004d217 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1504,7 +1504,6 @@ fn test_serialization_consistency() { } /// Compute a shared secret `secret ยท public` using DHKE protocol -pub fn dhke(secret: &Fr, public: &ExtendedPoint) -> Fq { - let shared: AffinePoint = public.mul(secret).into(); - shared.get_y() +pub fn dhke(secret: &Fr, public: &ExtendedPoint) -> AffinePoint { + public.mul(secret).into() } From 35edeb1d089cf119e8e470b240fc86fa93a0ad39 Mon Sep 17 00:00:00 2001 From: Victor Lopez Date: Tue, 28 Jul 2020 14:43:06 +0200 Subject: [PATCH 2/2] Version 0.3.4 bump - dhke ecc --- Cargo.toml | 2 +- RELEASES.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 0753545..4e8571b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ homepage = "https://github.com/dusk-network/jubjub" license = "MIT/Apache-2.0" name = "dusk-jubjub" repository = "https://github.com/dusk-network/jubjub" -version = "0.3.3" +version = "0.3.4" keywords = ["cryptography", "jubjub", "zk-snarks", "ecc", "elliptic-curve"] categories =["algorithms", "cryptography", "science"] edition = "2018" diff --git a/RELEASES.md b/RELEASES.md index 9139cd6..2c12304 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,7 @@ +# 0.3.4 +### Fix +- Fix `dhke` to return an elliptic curve point instead of scalar. + # 0.3.3 ### Fix - Fix `GENERATOR_NUMS` value and add tests to check it's correct.