arnaucube
arnaucube/ark-r1cs-stdPublic Self-hosted repository
`impl ToBytesGadget for Vec<UInt8>` (#76)

Pratyush Mishra pratyushmishra@berkeley.edu
Mon, 12 Jul 2021 12:04:22 -0700
commit

65faa3e6995b471fd4be8e43d8d9fe082057ebff

parent

6e59e02a1b13c60e5f3282a826c144100c2f9a08

2 files changed, 8 insertions(+), 0 deletions(-)

jump to
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()