proofs::ProofOfShuffleOfCommitments Class Reference

Performs a proof of shuffle of commitments. It is an implementation of the Verfication class. More...

#include <proofofshuffleofcommitments.hpp>

+ Inheritance diagram for proofs::ProofOfShuffleOfCommitments:
+ Collaboration diagram for proofs::ProofOfShuffleOfCommitments:

Public Member Functions

 ProofOfShuffleOfCommitments (bool &readingWasOK, XmlConfig *config, std::vector< uint8_t > prefix, unsigned int nZero, arithm::ArrayOfElmts pedersen, verifierUtils::ByteTree *commitmentFSproof, verifierUtils::ByteTree *replyFSproof)
 Creates an instance of a Verification class by setting its two attributes.
bool isEverythingOK ()
 Checks that the mix-servers commited themselves correctly and knew how to this.
- Public Member Functions inherited from proofs::Verification
 Verification (XmlConfig *config, std::vector< uint8_t > prefix, unsigned int nZero)
 Creates an instance of a Verification class by setting its two attributes.
arithm::ArrayOfElmts randomExponents (verifierUtils::ByteTree *bts, std::vector< uint8_t > &s)
 Used to compute a random exponents vector according to the specification.
arithm::Elmt getChallenge (std::vector< uint8_t > s)
 Returns a challenge computed from the original seed s and a bytetree.
arithm::ArrayOfElmts getGenerators ()
 Returns the h attribute.

Private Attributes

arithm::ArrayOfElmts u
 $u = (u_0,...,u_{N_0-1})$, an array of Pedersen commitments in $G_q$.

Additional Inherited Members

- Protected Attributes inherited from proofs::Verification
XmlConfigprotocolFile
 A class containing the information in the protocol info file.
cryptoTools::SHAxH
 The hashfunction to be used by the random oracles.
cryptoTools::ROROs
 The random oracle to use to seed the PRG.
cryptoTools::ROROv
 The random oracle to use to generate challenges.
std::vector< uint8_t > rho
 $\rho$, a prefix for the random oracle.
unsigned int n0
 $N_0$ (or $N$), the size of the arrays.
unsigned int ne
 $n_e$, number of bits in each component of random vectors used for batching.
unsigned int nr
 $n_r$, acceptable "statistical error" when deriving independent generators.
unsigned int nv
 $n_v$, number of bits in challenges.
cryptoTools::PRGprg
 Pseudo-random generator $PRG$ used to derive random vectors for batching.
arithm::Groupgq
 $G_q$ a group of prime order with characteristic $q$.
arithm::Fieldzq
 The field in which the exponent live, $Z_q$.
arithm::ArrayOfElmts h
 An array of independant generators $h = (h_0,...h_{N_0-1})$.
verifierUtils::ByteTreetau
 The commitment of the Fiat-Shamir proof, $\tau$.
verifierUtils::ByteTreesigma
 The reply of the Fiat-Shamir proof, $\sigma$.

Detailed Description

Performs a proof of shuffle of commitments. It is an implementation of the Verfication class.

The operation performed in this class are just implementation of the verificatum verifier specification, namely page 15.

Definition at line 32 of file proofofshuffleofcommitments.hpp.

Constructor & Destructor Documentation

ProofOfShuffleOfCommitments::ProofOfShuffleOfCommitments ( bool &  readingWasOK,
XmlConfig config,
std::vector< uint8_t >  prefix,
unsigned int  nZero,
arithm::ArrayOfElmts  pedersen,
verifierUtils::ByteTree commitmentFSproof,
verifierUtils::ByteTree replyFSproof 
)

Creates an instance of a Verification class by setting its two attributes.

If any variable is wrong, readingWasOK takes the value false. Otherwise, this variable is equal to true at the end of the construction.

Parameters
[out]readingWasOKIs false at the end of the construction if there was a problem.
configThe protocol info file to use.
prefixThe value to give to the rho attribute.
nZeroThe value to give to the n0 attribute.
pedersenArrays of Pedersen commitments.
commitmentFSproofCommitments of the Fiat-Shamir proof.
replyFSproofReply of the Fiat-Shamir proof.

Definition at line 19 of file proofofshuffleofcommitments.cpp.

:
Verification(config,prefix,nZero)
{
readingWasOK = true;
u = pedersen;
if (u.size() != n0)
{
std::cout<<"ERROR: in ProofOfShuffleOfCommitments:"
<<"u is not of the correct size."
<<"u->getSize()="<<u.size()
<<"n0="<<n0<<std::endl;
readingWasOK = false;;
}
tau = commitmentFSproof;
if ((tau->size()<5) || (!tau->isNode()))
{
std::cout<<"ERROR: in ProofOfShuffleOfCommitments:"
<<"tau is not valid.\ntau="<<std::endl;
std::cout<<std::endl;
readingWasOK = false;
}
sigma = replyFSproof;
if ((sigma->size()<5) || (!sigma->isNode())
|| (!sigma->getChild(0)->isLeaf())
|| (!sigma->getChild(1)->isNode()) || (sigma->getChild(1)->size() != n0)
|| (!sigma->getChild(2)->isLeaf())
|| (!sigma->getChild(3)->isLeaf())
|| (!sigma->getChild(4)->isNode()) || (sigma->getChild(4)->size() != n0)
)
{
std::cout<<"ERROR: in ProofOfShuffleOfCommitments:"
<<"sigma is not valid.\nsigma="<<std::endl;
std::cout<<std::endl;
readingWasOK = false;;
}
}

Member Function Documentation

bool ProofOfShuffleOfCommitments::isEverythingOK ( )
virtual

Checks that the mix-servers commited themselves correctly and knew how to this.

The detail of this algorithm is given page 15 of the verificatum verifier specification.

Returns
true if the mix-servers behaved correctly with regards to their commitments, false if the slightest thing went wrong.

Reimplemented from proofs::Verification.

Definition at line 69 of file proofofshuffleofcommitments.cpp.

{
// 1-a Initializing the G_q elements from tau
Aprime = gq->getElmt(tau->getChild(1)),
Cprime = gq->getElmt(tau->getChild(3)),
Dprime = gq->getElmt(tau->getChild(4));
B = gq->getArray(tau->getChild(0)),
Bprime = gq->getArray(tau->getChild(2));
// 1-b Initializing the elements of zq from sigma
kA = zq->getElmt(sigma->getChild(0)),
kC = zq->getElmt(sigma->getChild(2)),
kD = zq->getElmt(sigma->getChild(3));
kB = zq->getArray(sigma->getChild(1)),
kE = zq->getArray(sigma->getChild(4));
// 2- computing a seed
std::vector<uint8_t> s;
// 3- computing A
// 4- computing a challenge
// 5- Compute C and D
),
B.getElmt(n0-1),
h.getElmt(0),
zq->product(e)))
);
// First verification (on A and the likes)
Aprime
),
);
if (! gq->compare(lhs,rhs) )
{
std::cout<<"In ProofOfShuffleOfCommitments, $A^vA'$ "
<<"does not equal $h_0\\prod_{i=1}^{N_0-1}"
<<"h_i^{k_{E,i}}$."<<std::endl;
return false;
}
// Second verification (on B and the likes)
for (unsigned int i=0; i<n0; i++)
{
Bprime.getElmt(i)
);
arithm::Elmt BMinusOne = (i==0) ?
h.getElmt(0) : B.getElmt(i-1);
kB.getElmt(i)
),
BMinusOne,
kE.getElmt(i)
)
);
if (! gq->compare(lhs, rhs) )
{
std::cout<<"In ProofOfShuffleOfCommitments, $B_"<<i
<<"^vB_"<<i<<"'$ does not equal $g^{k_{B,"<<i
<<"}}B_{"<<i<<"-1}^"<<"{k_{E,"<<i<<"}}$."
<<std::endl;
return false;
}
}
// Third verification (on C and the likes)
Cprime
);
kC);
if (! gq->compare(lhs, rhs) )
{
std::cout<<"In ProofOfShuffleOfCommitments, $C^vC'$ "
<<"does not equal $g^{k_C}$" <<std::endl;
return false;
}
// Fourth verification (on D and the likes)
Dprime
);
kD);
if (! gq->compare(lhs, rhs) )
{
std::cout<<"In ProofOfShuffleOfCommitments, $D^vD'$ "
<<"does not equal $g^{k_D}$" <<std::endl;
return false;
}
// if this point is reached, then the proof is valid
return true;
}

Member Data Documentation

arithm::ArrayOfElmts proofs::ProofOfShuffleOfCommitments::u
private

$u = (u_0,...,u_{N_0-1})$, an array of Pedersen commitments in $G_q$.

Definition at line 39 of file proofofshuffleofcommitments.hpp.


The documentation for this class was generated from the following files: