diff --git a/src/convert.rs b/src/convert.rs index dbeaa4fe..a8cfead9 100644 --- a/src/convert.rs +++ b/src/convert.rs @@ -134,6 +134,16 @@ impl, F: Field, const N: usize> ToBytesGadget for [T; N] } } +impl ToBytesGadget for () { + fn to_bytes_le(&self) -> Result>, SynthesisError> { + Ok(Vec::new()) + } + + fn to_non_unique_bytes_le(&self) -> Result>, SynthesisError> { + Ok(Vec::new()) + } +} + /// Specifies how to convert a variable of type `Self` to variables of /// type `FpVar` pub trait ToConstraintFieldGadget { diff --git a/src/eq.rs b/src/eq.rs index a773b8bc..fb3fa697 100644 --- a/src/eq.rs +++ b/src/eq.rs @@ -86,7 +86,7 @@ impl + R1CSVar, F: PrimeField> EqGadget for [T] { #[tracing::instrument(target = "r1cs", skip(self, other))] fn is_eq(&self, other: &Self) -> Result, SynthesisError> { assert_eq!(self.len(), other.len()); - if self.is_empty() { + if self.is_empty() & other.is_empty() { Ok(Boolean::TRUE) } else { let mut results = Vec::with_capacity(self.len());