Skip to content

Commit ca94681

Browse files
author
Cathie Yun
committed
remove InvalidBitSize limitations to allow one-hot vectors
1 parent 6321b57 commit ca94681

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

benches/range_proof.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use merlin::Transcript;
1313
use bulletproofs::RangeProof;
1414
use bulletproofs::{BulletproofGens, PedersenGens};
1515

16-
static AGGREGATION_SIZES: [usize; 5] = [1024, 2048, 4096, 8192, 16384];
16+
static AGGREGATION_SIZES: [usize; 8] = [1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072];
1717

1818
fn create_aggregated_rangeproof_helper(n: usize, c: &mut Criterion) {
1919
let label = format!("Aggregated {}-bit rangeproof creation", n);

src/range_proof/mod.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,9 @@ impl RangeProof {
355355

356356
// First, replay the "interactive" protocol using the proof
357357
// data to recompute all challenges.
358-
if !(n == 8 || n == 16 || n == 32 || n == 64) {
359-
return Err(ProofError::InvalidBitsize);
360-
}
358+
// if !(n == 8 || n == 16 || n == 32 || n == 64) {
359+
// return Err(ProofError::InvalidBitsize);
360+
// }
361361
if bp_gens.gens_capacity < n {
362362
return Err(ProofError::InvalidGeneratorsLength);
363363
}
@@ -688,6 +688,11 @@ mod tests {
688688
}
689689
}
690690

691+
#[test]
692+
fn create_and_verify_n_1_m_1024() {
693+
singleparty_create_and_verify_helper(1, 1024);
694+
}
695+
691696
#[test]
692697
fn create_and_verify_n_32_m_1() {
693698
singleparty_create_and_verify_helper(32, 1);

src/range_proof/party.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ impl Party {
4141
v_blinding: Scalar,
4242
n: usize,
4343
) -> Result<PartyAwaitingPosition<'a>, MPCError> {
44-
if !(n == 8 || n == 16 || n == 32 || n == 64) {
45-
return Err(MPCError::InvalidBitsize);
46-
}
44+
// if !(n == 8 || n == 16 || n == 32 || n == 64) {
45+
// return Err(MPCError::InvalidBitsize);
46+
// }
4747
if bp_gens.gens_capacity < n {
4848
return Err(MPCError::InvalidGeneratorsLength);
4949
}

0 commit comments

Comments
 (0)