Skip to content

Commit

Permalink
v1.17: [zk-token-sdk] Check that discrete log compression batch size …
Browse files Browse the repository at this point in the history
…is greater than 0 (backport of solana-labs#33699) (solana-labs#33844)

[zk-token-sdk] Check that discrete log compression batch size is greater than 0 (solana-labs#33699)

check that discrete log compression batch size is greater than 0

(cherry picked from commit 381d225)

Co-authored-by: samkim-crypto <skim13@cs.stanford.edu>
  • Loading branch information
2 people authored and anwayde committed Nov 16, 2023
1 parent b8de9d5 commit 5512e28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zk-token-sdk/src/encryption/discrete_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl DiscreteLog {
&mut self,
compression_batch_size: usize,
) -> Result<(), DiscreteLogError> {
if compression_batch_size >= TWO16 as usize {
if compression_batch_size >= TWO16 as usize || compression_batch_size == 0 {
return Err(DiscreteLogError::DiscreteLogBatchSize);
}
self.compression_batch_size = compression_batch_size;
Expand Down

0 comments on commit 5512e28

Please sign in to comment.