Skip to content

Commit

Permalink
size check added
Browse files Browse the repository at this point in the history
  • Loading branch information
hridambasu committed Aug 24, 2023
1 parent 2ac1bbd commit c9cc244
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/auxinfo/auxinfo_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ use crate::{
auxinfo::{info::AuxInfoPublic, participant::AuxInfoParticipant},
errors::{InternalError, Result},
messages::{AuxinfoMessageType, Message, MessageType},
parameters::ELL,
participant::{InnerProtocolParticipant, ProtocolParticipant},
protocol::{Identifier, ParticipantIdentifier},
};
use libpaillier::unknown_order::BigNumber;
use merlin::Transcript;
use rand::{CryptoRng, RngCore};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -123,6 +125,9 @@ impl CommitmentScheme {
// Public parameters in this decommit must be consistent with each other
scheme.clone().public_key.verify(context)?;

let lower_bound = BigNumber::one() << ELL;
assert!(scheme.public_key.params().scheme().modulus() >= &lower_bound);

// Owner must be consistent across message, public keys, and decommit
if scheme.public_key.participant() != scheme.pid {
error!(
Expand Down

0 comments on commit c9cc244

Please sign in to comment.