From 65faa3e6995b471fd4be8e43d8d9fe082057ebff Mon Sep 17 00:00:00 2001 From: Pratyush Mishra Date: Mon, 12 Jul 2021 12:04:22 -0700 Subject: [PATCH] `impl ToBytesGadget for Vec` (#76) --- CHANGELOG.md | 2 ++ src/bits/mod.rs | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 554e6fb..a4cc19d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ ### Features +- [\#76](https://github.com/arkworks-rs/r1cs-std/pull/76) Implement `ToBytesGadget` for `Vec`. + ### Improvements ### Bug Fixes diff --git a/src/bits/mod.rs b/src/bits/mod.rs index 3878c84..94ad5fa 100644 --- a/src/bits/mod.rs +++ b/src/bits/mod.rs @@ -116,6 +116,12 @@ impl ToBytesGadget for [UInt8] { } } +impl ToBytesGadget for Vec> { + fn to_bytes(&self) -> Result>, SynthesisError> { + Ok(self.clone()) + } +} + impl<'a, F: Field, T: 'a + ToBytesGadget> ToBytesGadget for &'a T { fn to_bytes(&self) -> Result>, SynthesisError> { (*self).to_bytes()