`impl ToBytesGadget for Vec<UInt8>` (#76)
Pratyush Mishra pratyushmishra@berkeley.edu
Mon, 12 Jul 2021 12:04:22 -0700
2 files changed,
8 insertions(+),
0 deletions(-)
M
CHANGELOG.md
→
CHANGELOG.md
@@ -6,6 +6,8 @@ ### Breaking changes
### Features +- [\#76](https://github.com/arkworks-rs/r1cs-std/pull/76) Implement `ToBytesGadget` for `Vec<UInt8>`. + ### Improvements ### Bug Fixes
M
src/bits/mod.rs
→
src/bits/mod.rs
@@ -116,6 +116,12 @@ Ok(self.to_vec())
} } +impl<F: Field> ToBytesGadget<F> for Vec<UInt8<F>> { + fn to_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError> { + Ok(self.clone()) + } +} + impl<'a, F: Field, T: 'a + ToBytesGadget<F>> ToBytesGadget<F> for &'a T { fn to_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError> { (*self).to_bytes()