From e3e7611a37f66dbb92e221568016082889202cd2 Mon Sep 17 00:00:00 2001 From: jacobkaufmann Date: Mon, 25 Mar 2024 15:32:08 -0600 Subject: [PATCH] feat(bindings/rust): add constructor for affine points --- bindings/rust/src/pippenger-no_std.rs | 4 ++++ bindings/rust/src/pippenger.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/bindings/rust/src/pippenger-no_std.rs b/bindings/rust/src/pippenger-no_std.rs index c316e87a..2f049e8c 100644 --- a/bindings/rust/src/pippenger-no_std.rs +++ b/bindings/rust/src/pippenger-no_std.rs @@ -46,6 +46,10 @@ macro_rules! pippenger_mult_impl { self.points.as_slice() } + pub fn new(points: &[$point_affine]) -> Self { + Self { points: Vec::from(points) } + } + pub fn from(points: &[$point]) -> Self { let npoints = points.len(); let mut ret = Self { diff --git a/bindings/rust/src/pippenger.rs b/bindings/rust/src/pippenger.rs index bdaec95a..7878994b 100644 --- a/bindings/rust/src/pippenger.rs +++ b/bindings/rust/src/pippenger.rs @@ -69,6 +69,10 @@ macro_rules! pippenger_mult_impl { self.points.as_slice() } + pub fn new(points: &[$point_affine]) -> Self { + Self { points: Vec::from(points) } + } + pub fn from(points: &[$point]) -> Self { let npoints = points.len(); let mut ret = Self {