mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-09 07:21:29 +01:00
impl ToBytesGadget for Vec<UInt8> (#76)
This commit is contained in:
@@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
|
- [\#76](https://github.com/arkworks-rs/r1cs-std/pull/76) Implement `ToBytesGadget` for `Vec<UInt8>`.
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -116,6 +116,12 @@ impl<F: Field> ToBytesGadget<F> for [UInt8<F>] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 {
|
impl<'a, F: Field, T: 'a + ToBytesGadget<F>> ToBytesGadget<F> for &'a T {
|
||||||
fn to_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError> {
|
fn to_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError> {
|
||||||
(*self).to_bytes()
|
(*self).to_bytes()
|
||||||
|
|||||||
Reference in New Issue
Block a user