Skip to content

Commit

Permalink
Allow 0-length labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaker committed Sep 8, 2023
1 parent a29ce38 commit 049a978
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/plugins/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pub mod arkworks;
#[cfg(feature = "dalek")]
pub mod dalek;

#[cfg(feature="zkcrypto")]
#[cfg(feature = "zkcrypto")]
pub mod zkcrypto;

#[cfg(all(test, feature="arkworks", feature="dalek", feature="zkcrypto"))]
#[cfg(all(test, feature = "arkworks", feature = "dalek", feature = "zkcrypto"))]
mod tests;
4 changes: 2 additions & 2 deletions src/safe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ impl<H: DuplexHash> IOPattern<H> {
pub fn absorb(self, count: usize, label: &'static str) -> Self {
assert!(count > 0, "Count must be positive");
assert!(!label.contains(SEP_BYTE));
assert!(!label[..1].parse::<u8>().is_ok());
assert!(label.len() == 0 || !label[..1].parse::<u8>().is_ok());

Self::from_string(self.io + SEP_BYTE + &format!("A{}", count) + label)
}

pub fn squeeze(self, count: usize, label: &'static str) -> Self {
assert!(count > 0, "Count must be positive");
assert!(!label.contains(SEP_BYTE));
assert!(!label[..1].parse::<u8>().is_ok());
assert!(label.len() == 0 || !label[..1].parse::<u8>().is_ok());

Self::from_string(self.io + SEP_BYTE + &format!("S{}", count) + label)
}
Expand Down

0 comments on commit 049a978

Please sign in to comment.