Skip to content

Commit

Permalink
Fix features for cipher and clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
moCello committed Mar 1, 2024
1 parent 6aa9a86 commit ce7cf66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cipher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ use bytecheck::CheckBytes;
use rkyv::{Archive, Deserialize, Serialize};

#[cfg(feature = "zk")]
pub use zk::{decrypt, encrypt};
pub(crate) use zk::{decrypt, encrypt};

const MESSAGE_CAPACITY: usize = 2;
const CIPHER_SIZE: usize = MESSAGE_CAPACITY + 1;
Expand Down
4 changes: 2 additions & 2 deletions src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Domain {

fn io_pattern<R: AsRef<[T]>, T>(
domain: Domain,
input: &Vec<R>,
input: &[R],
output_len: usize,
) -> Result<Vec<Call>, Error> {
let mut io_pattern = Vec::new();
Expand Down Expand Up @@ -124,7 +124,7 @@ impl<R: AsRef<[BlsScalar]>> Hash<R> {
sponge.absorb(input.as_ref().len(), input)?;
}
// squeeze the output
sponge.squeeze(self.output_len as usize)?;
sponge.squeeze(self.output_len)?;

// return the result
Ok(sponge.finish()?)
Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ pub use hash::{Domain, Hash};
#[cfg(feature = "cipher")]
mod cipher;
#[cfg(feature = "cipher")]
pub use cipher::PoseidonCipher;
#[cfg(feature = "cipher")]
#[cfg(feature = "zk")]
pub use cipher::{
zk::decrypt as decrypt_gadget, zk::encrypt as encrypt_gadget,
PoseidonCipher,
};

0 comments on commit ce7cf66

Please sign in to comment.