From f127e7d09a597b06b60dd0854aa0935d05180b9d Mon Sep 17 00:00:00 2001 From: Victor Lopez Date: Mon, 7 Jun 2021 15:35:10 +0200 Subject: [PATCH] Add `add_affine_to_circuit_description`to composer Resolves #534 --- CHANGELOG.md | 6 ++++++ Cargo.toml | 2 +- src/constraint_system/ecc/mod.rs | 13 +++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9d0ae82d..77133f92c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.8.1] - 07-06-21 + +### Added + +- Add `add_affine_to_circuit_description` to composer [#534](https://github.com/dusk-network/plonk/issues/534) + ## [0.8.0] - 03-05-21 ### Added diff --git a/Cargo.toml b/Cargo.toml index 5363b3923..216d2421b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dusk-plonk" -version = "0.8.0" +version = "0.8.1" authors = ["Kevaundray Wedderburn ", "Luke Pearson ", "CPerezz "] diff --git a/src/constraint_system/ecc/mod.rs b/src/constraint_system/ecc/mod.rs index ca872384f..a52ffdece 100644 --- a/src/constraint_system/ecc/mod.rs +++ b/src/constraint_system/ecc/mod.rs @@ -69,6 +69,19 @@ impl StandardComposer { point } + /// Add the provided affine point as a circuit description and return its + /// constrained witness value + pub fn add_affine_to_circuit_description( + &mut self, + affine: dusk_jubjub::JubJubAffine, + ) -> Point { + // Not using individual gates because one of these may be zero + let x = self.add_witness_to_circuit_description(affine.get_x()); + let y = self.add_witness_to_circuit_description(affine.get_y()); + + Point { x, y } + } + /// Asserts that a [`Point`] in the circuit is equal to a known public /// point. pub fn assert_equal_public_point(