diff --git a/src/.gitignore b/src/.gitignore index 367e1c2..0160315 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -9,3 +9,5 @@ brownieTest Serialize.h.gch zkptest libcash.a +buym1.xml +buym2.xml diff --git a/src/Arbiter.cpp b/src/Arbiter.cpp index 03b050c..7441116 100644 --- a/src/Arbiter.cpp +++ b/src/Arbiter.cpp @@ -1,8 +1,6 @@ #include "Arbiter.h" #include "VECiphertext.h" -using boost::shared_ptr; - vector Arbiter::initiatorResolve(const ZZ &r){ return buyerResolve(r); } @@ -22,27 +20,29 @@ vector Arbiter::sellerResolveI(const ResolutionPair &keyMessagePair){ // first, store the keys keys = keyMessagePair.first; // now, unwrap and check the buyMessage, then store everything - BuyMessage* buyMessage = keyMessagePair.second; - Coin coinPrime = buyMessage->getCoinPrime(); - VECiphertext escrow = *buyMessage->getEscrow(); + Ptr buyMessage = keyMessagePair.second; + Ptr coinPrime = buyMessage->getCoinPrime(); + Ptr escrow = buyMessage->getEscrow(); // want to store the contract as well (for stage II) - contract = *buyMessage->getContract(); + contract = buyMessage->getContract(); // check the timeout to make sure it hasn't passed - if(contract.checkTimeout(timeoutTolerance)) { - endorsement = verifiableDecrypter->decrypt(escrow.getCiphertext(), - saveString(contract), hashAlg); + if(contract->checkTimeout(timeoutTolerance)) { + endorsement = verifiableDecrypter->decrypt(escrow->getCiphertext(), + saveString(*contract), hashAlg); // make sure the endorsement on the coin is valid - if(coinPrime.verifyEndorsement(endorsement)){ + if(coinPrime->verifyEndorsement(endorsement)){ // construct verifiers based on the data in the contract and // return a set of challenges - hash_t ptHash = contract.getPTHashB(); - hash_t ctHash = contract.getCTHashB(); - ptVerifier = shared_ptr(new MerkleVerifier(ptHash, - contract.getNumPTHashBlocksB(), - MerkleContract(ptHash.key,ptHash.alg))); - ctVerifier = shared_ptr(new MerkleVerifier(ctHash, - contract.getNumCTHashBlocksB(), - MerkleContract(ctHash.key,ctHash.alg))); + hash_t ptHash = contract->getPTHashB(); + hash_t ctHash = contract->getCTHashB(); + ptVerifier = new_ptr( + ptHash, + contract->getNumPTHashBlocksB(), + MerkleContract(ptHash.key,ptHash.alg)); + ctVerifier = new_ptr( + ctHash, + contract->getNumCTHashBlocksB(), + MerkleContract(ctHash.key,ctHash.alg)); return ptVerifier->getChallenges(); } else { throw CashException(CashException::CE_FE_ERROR, @@ -54,12 +54,12 @@ vector Arbiter::sellerResolveI(const ResolutionPair &keyMessagePair){ } } -vector Arbiter::sellerResolveII(const MerkleProof* proof){ +vector Arbiter::sellerResolveII(Ptr proof){ // check the proof against the keys provided in Stage I if(verifyKeys(proof)){ if(updateDB){ vector rVec; - rVec.push_back(contract.getID()); + rVec.push_back(contract->getID()); // store the keys (for the buyer later) updateDB(Hash::hash(rVec,hashAlg), keys); } @@ -71,11 +71,11 @@ vector Arbiter::sellerResolveII(const MerkleProof* proof){ } } -bool Arbiter::verifyKeys(const MerkleProof* proof) { +bool Arbiter::verifyKeys(Ptr proof) { // the arbiter needs to check the encrypted blocks decrypt correctly bool validDecryption = true; - vector cTextBlocks = proof->getCTextBlocks(); - vector decryptedBlocks(cTextBlocks.size()); + vector > cTextBlocks = proof->getCTextBlocks(); + vector > decryptedBlocks(cTextBlocks.size()); vector hashedBlocks(cTextBlocks.size()); unsigned i = 0; // it checks the decryption in the following three steps: @@ -83,7 +83,7 @@ bool Arbiter::verifyKeys(const MerkleProof* proof) { // 1. decrypt the blocks unsigned index = (keys.size() == 1) ? 0 : i; decryptedBlocks[i] = cTextBlocks[i]->decrypt(keys[index], - contract.getEncAlgB()); + contract->getEncAlgB()); // 2. hash them hashedBlocks[i] = proof->getPTContract()->hash(decryptedBlocks[i]); // 3. check if they match the public plaintext hashes @@ -92,7 +92,7 @@ bool Arbiter::verifyKeys(const MerkleProof* proof) { } while(validDecryption && i < cTextBlocks.size()); // now finish verifying using the MerkleVerifiers - if(contract.getPTHashB().type == Hash::TYPE_MERKLE){ + if(contract->getPTHashB().type == Hash::TYPE_MERKLE){ return (validDecryption && ctVerifier->verifyProofs(proof->getCTextProof()) && ptVerifier->verifyProofs(proof->getPTextProof())); @@ -100,20 +100,20 @@ bool Arbiter::verifyKeys(const MerkleProof* proof) { hash_t ptHash = proof->getPTContract()->hash(proof->getPlaintext()); return (validDecryption && ctVerifier->verifyProofs(proof->getCTextProof()) && - (ptHash == message->getContract().getPTHashB())); + (ptHash == message->getContract()->getPTHashB())); } } -bool Arbiter::verifyDecryption(const MerkleProof* proof){ +bool Arbiter::verifyDecryption(Ptr proof){ bool validDecryption = true; - vector cTextBlocks = proof->getCTextBlocks(); - vector decryptedBlocks(cTextBlocks.size()); + vector > cTextBlocks = proof->getCTextBlocks(); + vector > decryptedBlocks(cTextBlocks.size()); vector hashedBlocks(cTextBlocks.size()); unsigned i = 0; do{ unsigned index = (keys.size() == 1) ? 0 : i; decryptedBlocks[i] = cTextBlocks[i]->decrypt(keys[index], - contract.getEncAlgA()); + contract->getEncAlgA()); hashedBlocks[i] = proof->getCTContract()->hash(decryptedBlocks[i]); validDecryption = hashedBlocks[i] == proof->getPTextProof()[i][0].node; i++; @@ -123,15 +123,15 @@ bool Arbiter::verifyDecryption(const MerkleProof* proof){ return (validDecryption && ctVerifier->verifyProofs(ctProof)); } -vector Arbiter::responderResolveI(const FEResolutionMessage* req) { +vector Arbiter::responderResolveI(Ptr req) { return responderResolveI(req->getKeys(), req->getMessage(), req->getSetupMessage()); } // this method sets up the resolve for a failed barter vector Arbiter::responderResolveI(const vector &ks, - const FEMessage* msg, - const FESetupMessage* setup) { + Ptr msg, + Ptr setup) { // stores keys and message keys = ks; message = msg; @@ -139,9 +139,9 @@ vector Arbiter::responderResolveI(const vector &ks, // this is the regular encryption vector sigEscrow = message->getEscrow(); // this is the verifiable encryption - VECiphertext vEscrow = *setup->getEscrow(); + Ptr vEscrow = setup->getEscrow(); contract = message->getContract(); - const Signature::Key* sigPK = setup->getPK(); + Ptr sigPK = setup->getPK(); // verify that the signature given in BarterMessage is correct bool sigCorrect = Signature::verify(*sigPK, message->getSignature(), @@ -153,12 +153,12 @@ vector Arbiter::responderResolveI(const vector &ks, } // also need to make sure the contract hasn't expired - if (!contract.checkTimeout(timeoutTolerance)){ + if (!contract->checkTimeout(timeoutTolerance)){ throw CashException(CashException::CE_FE_ERROR, "[Arbiter::responderResolveI] contract has expired"); } - vector end = verifiableDecrypter->decrypt(vEscrow.getCiphertext(), + vector end = verifiableDecrypter->decrypt(vEscrow->getCiphertext(), sigPK->publicKeyString(), hashAlg); // now verify the endorsement (and store it if it's valid) @@ -167,14 +167,16 @@ vector Arbiter::responderResolveI(const vector &ks, endorsement = end; // set up merkle verifiers and return challenges - hash_t ptHash = contract.getPTHashB(); - hash_t ctHash = contract.getCTHashB(); - ptVerifier = boost::shared_ptr(new MerkleVerifier(ptHash, - contract.getNumPTHashBlocksB(), - MerkleContract(ptHash.key,ptHash.alg))); - ctVerifier = boost::shared_ptr(new MerkleVerifier(ctHash, - contract.getNumCTHashBlocksB(), - MerkleContract(ctHash.key,ctHash.alg))); + hash_t ptHash = contract->getPTHashB(); + hash_t ctHash = contract->getCTHashB(); + ptVerifier = new_ptr( + ptHash, + contract->getNumPTHashBlocksB(), + MerkleContract(ptHash.key,ptHash.alg)); + ctVerifier = new_ptr( + ctHash, + contract->getNumCTHashBlocksB(), + MerkleContract(ctHash.key,ctHash.alg)); // XXX: right now this is only returning 0 every time!! return ptVerifier->getChallenges(); } else { @@ -183,11 +185,11 @@ vector Arbiter::responderResolveI(const vector &ks, } } -vector Arbiter::responderResolveII(const MerkleProof* proof){ +vector Arbiter::responderResolveII(Ptr proof){ if(verifyKeys(proof)){ // decrypt the signature escrow vector m = message->getEscrow(); - string label = saveString(contract); + string label = saveString(*contract); vector initiatorVals = regularDecrypter->decrypt(m, label, hashAlg); vector initiatorKeys(initiatorVals.size()); for(unsigned i = 0; i < initiatorVals.size(); i++){ @@ -202,7 +204,7 @@ vector Arbiter::responderResolveII(const MerkleProof* proof){ } } -vector Arbiter::responderResolveIII(const MerkleProof* proof){ +vector Arbiter::responderResolveIII(Ptr proof){ if (!verifyDecryption(proof)){ return endorsement; } else { diff --git a/src/Arbiter.h b/src/Arbiter.h index 87ebd89..01fe374 100644 --- a/src/Arbiter.h +++ b/src/Arbiter.h @@ -10,11 +10,11 @@ /*! \brief This class is for resolving any disputes that may arise in the * course of a fair exchange protocol */ -typedef pair, BuyMessage*> ResolutionPair; +typedef pair, Ptr > ResolutionPair; class Arbiter { public: - Arbiter(const VEDecrypter* vD, const VEDecrypter* rD, + Arbiter(Ptr vD, Ptr rD, const hashalg_t &h, int t) : verifiableDecrypter(vD), regularDecrypter(rD), hashAlg(h), timeoutTolerance(t) {} @@ -32,23 +32,23 @@ class Arbiter { /*! if the proof verifies, output the buyer's endorsement and * store the seller's keys in the database (for the buyer to * retrieve at some later date) */ - vector sellerResolveII(const MerkleProof* proof); + vector sellerResolveII(Ptr proof); // the following are resolutions for the responder /*! Stage I: the responder sends a request, and the arbiter * checks the validity of the two messages and stores the keys */ - vector responderResolveI(const FEResolutionMessage* request); + vector responderResolveI(Ptr request); vector responderResolveI(const vector &keys, - const FEMessage* message, - const FESetupMessage* setupMessage); + Ptr message, + Ptr setupMessage); /*! Stage II: if the proof verifies, return the initiator's keys */ - vector responderResolveII(const MerkleProof* proof); + vector responderResolveII(Ptr proof); /*! Stage III: if the initiator's keys were incorrect, the responder * sends a proof of this. if this proof is valid the arbiter will * return the endorsement */ - vector responderResolveIII(const MerkleProof* prooof); + vector responderResolveIII(Ptr prooof); //used to test stuff void setKeys(const vector &ks){ keys = ks; } @@ -60,21 +60,21 @@ class Arbiter { void updateDatabase(const ZZ &sessionID, const string &key); /*! takes in a proof and verifies it using the stored keys */ - bool verifyKeys(const MerkleProof* proof); + bool verifyKeys(Ptr proof); /*! much like verifyKeys except it ignores plaintext proofs; this * is a helper for responderResolveIII */ - bool verifyDecryption(const MerkleProof* proof); + bool verifyDecryption(Ptr proof); - const VEDecrypter* verifiableDecrypter;//, regularDecrypter; - const VEDecrypter* regularDecrypter; + Ptr verifiableDecrypter;//, regularDecrypter; + Ptr regularDecrypter; hashalg_t hashAlg; int timeoutTolerance; - boost::shared_ptr ptVerifier, ctVerifier; + Ptr ptVerifier, ctVerifier; vector endorsement; vector keys; - FEContract contract; - const FEMessage* message; + Ptr contract; + Ptr message; }; #endif diff --git a/src/Bank.h b/src/Bank.h index 791a01a..45ea722 100644 --- a/src/Bank.h +++ b/src/Bank.h @@ -8,14 +8,12 @@ class Bank { public: - Bank(const GroupPrime* grpPrime, const GroupRSA* secret) + Bank(Ptr grpPrime, Ptr secret) : groupPrime(grpPrime), secretKey(secret) {} Bank(const Bank &o) : groupPrime(o.groupPrime), secretKey(o.secretKey) {} - ~Bank() { delete groupPrime; delete secretKey; } - /*! returns a random number from prime-order group */ ZZ randomNumber(); @@ -23,8 +21,8 @@ class Bank { ZZ fullCommitment(const ZZ &part, const ZZ &bankPart); private: - const GroupPrime* groupPrime; - const GroupRSA* secretKey; + Ptr groupPrime; + Ptr secretKey; }; #endif /*_BANK_H_*/ diff --git a/src/BankParameters.cpp b/src/BankParameters.cpp index 56f8937..aa10357 100644 --- a/src/BankParameters.cpp +++ b/src/BankParameters.cpp @@ -1,13 +1,14 @@ #include "BankParameters.h" -BankParameters::BankParameters(vector &secrets, GroupPrime &ecashGrp, - vector &denoms) - : coinDenominations(denoms) +BankParameters::BankParameters(const vector > &secrets, + Ptr ecashGrp, + const vector &denoms) + : type(BankParameters::TYPE_SECRET), + coinDenominations(denoms) { - ecashGroup = new GroupPrime(ecashGrp); - type = BankParameters::TYPE_SECRET; + ecashGroup = new_ptr(*ecashGrp); for (unsigned i = 0; i < secrets.size(); i++) { - secretKeys.push_back(new GroupRSA(secrets[i])); + secretKeys.push_back(new_ptr(*secrets[i])); } // set up maps that associate a given key with a denomination @@ -18,22 +19,14 @@ BankParameters::BankParameters(vector &secrets, GroupPrime &ecashGrp, } BankParameters::BankParameters(const BankParameters &o) - : ecashGroup(new GroupPrime(*o.ecashGroup)), type(o.type), - secretKeys(o.secretKeys), groupToDenom(o.groupToDenom), - denomToGroup(o.denomToGroup), coinDenominations(o.coinDenominations) + : ecashGroup(new_ptr(*o.ecashGroup)), type(o.type), + secretKeys(o.secretKeys), groupToDenom(o.groupToDenom), + denomToGroup(o.denomToGroup), coinDenominations(o.coinDenominations) { } -BankParameters::~BankParameters() { - /*delete ecashGroup; - for (unsigned i = 0 ; i < secretKeys.size() ; i++) { - delete secretKeys[i]; - } - secretKeys.clear();*/ -} - -const GroupRSA* BankParameters::getBankKey(int denomination) const { - map::const_iterator i = denomToGroup.find(denomination); +Ptr BankParameters::getBankKey(int denomination) const { + map >::const_iterator i = denomToGroup.find(denomination); if (i == denomToGroup.end()) { throw CashException(CashException::CE_UNKNOWN_ERROR, "[BankParameters:getBankKey] Tried to find BankKey for " @@ -43,8 +36,8 @@ const GroupRSA* BankParameters::getBankKey(int denomination) const { return i->second; } -int BankParameters::getCoinDenomination(GroupRSA* group) const { - map::const_iterator i = groupToDenom.find(group); +int BankParameters::getCoinDenomination(Ptr group) const { + map ,int>::const_iterator i = groupToDenom.find(group); if (i == groupToDenom.end()) { throw CashException(CashException::CE_UNKNOWN_ERROR, "[BankParameters:getCoinDenomination] Tried to find denomination " @@ -55,7 +48,9 @@ int BankParameters::getCoinDenomination(GroupRSA* group) const { void BankParameters::makePublic() { for(unsigned i = 0 ; i < secretKeys.size(); i++) { - secretKeys[i]->clearSecrets(); + // copy key, so as not to overwrite original secret key + secretKeys[i] = new_ptr(*secretKeys[i]); + secretKeys[i]->clearSecrets(); } type = BankParameters::TYPE_PUBLIC; } diff --git a/src/BankParameters.h b/src/BankParameters.h index c748ebe..dfe8e87 100644 --- a/src/BankParameters.h +++ b/src/BankParameters.h @@ -14,18 +14,16 @@ class BankParameters { public: /*! this class stores the bank's public keys, the group used * for e-cash, and a list of possible coin denominations */ - BankParameters(vector &secretKey, GroupPrime &ecash, - vector &denoms); + BankParameters(const vector >& secretKey, + Ptr ecash, + const vector& denoms); /*! constructor to load from file */ BankParameters(const char* fname) { loadFile(make_nvp("BankParameters", *this), fname); } - /*! copy constructor */ - BankParameters(const BankParameters &original); - - /*! destructor */ - ~BankParameters(); + /*! copy constructor */ + BankParameters(const BankParameters &o); /*! determines whether RSA groups have had secrets cleared or not */ static const int TYPE_SECRET = 1; @@ -33,25 +31,25 @@ class BankParameters { int getType() const { return type; } /*! getters */ - const GroupPrime* getCashGroup() const { return ecashGroup; } - const vector getBankKeys() const { return secretKeys; } + Ptr getCashGroup() const { return ecashGroup; } + const vector > getBankKeys() const { return secretKeys; } vector getDenominations() const { return coinDenominations; } - const GroupRSA* getBankKey(int coinDenomination) const; - int getCoinDenomination(GroupRSA* group) const; + Ptr getBankKey(int coinDenomination) const; + int getCoinDenomination(Ptr group) const; /*! clear all secrets and set type to public */ void makePublic(); private: - BankParameters() : ecashGroup(0), type(1) {} + BankParameters() : type(1) {} - GroupPrime* ecashGroup; + Ptr ecashGroup; int type; - vector secretKeys; + vector > secretKeys; // XXX: do we want this to be hardcoded? const static int stat = 80; - map groupToDenom; - map denomToGroup; + map, int> groupToDenom; + map > denomToGroup; vector coinDenominations; friend class boost::serialization::access; diff --git a/src/BankTool.cpp b/src/BankTool.cpp index fe55905..d0ee0e4 100644 --- a/src/BankTool.cpp +++ b/src/BankTool.cpp @@ -6,57 +6,48 @@ BankTool::BankTool(int st, int l, int modLen, const hashalg_t &ha, vector &coinDenoms) : stat(st), lx(l), hashAlg(ha) { - vector secretKeys; + vector > secretKeys; for(unsigned i = 0; i < coinDenoms.size(); i++) { - GroupRSA g("bank", modLen, stat); + Ptr g = new_ptr("bank", modLen, stat); // initial generator is f // want to add g_1,...,g_4,h for (int j = 0; j < 5; j++) { - g.addNewGenerator(); + g->addNewGenerator(); } secretKeys.push_back(g); } // generator: f (different from RSA group) - GroupPrime cashGroup("bank", modLen, 2*stat, stat); + Ptr cashGroup = + new_ptr("bank", modLen, 2*stat, stat); // additional endorsed ecash group generators: g, h, h1, h2 for (int i = 0; i < 4; i++) { - cashGroup.addNewGenerator(); + cashGroup->addNewGenerator(); } - bankParameters = new BankParameters(secretKeys, cashGroup, coinDenoms); + bankParameters = new_ptr(secretKeys, cashGroup, coinDenoms); - publicBankParameters = new BankParameters(secretKeys, cashGroup, + publicBankParameters = new_ptr(secretKeys, cashGroup, coinDenoms); publicBankParameters->makePublic(); } BankTool::BankTool(int st, int l, const hashalg_t &ha, - BankParameters bp) + const BankParameters& bp) : stat(st), lx(l), hashAlg(ha) { - bankParameters = new BankParameters(bp); - publicBankParameters = new BankParameters(bp); + bankParameters = new_ptr(bp); + publicBankParameters = new_ptr(bp); publicBankParameters->makePublic(); } -BankTool::BankTool(const BankTool &o) - : stat(o.stat), lx(o.lx), hashAlg(o.hashAlg), - bankParameters(o.bankParameters) // XXX: what about public BP? -{ -} - -BankTool::~BankTool() { - delete bankParameters; -} - -BankWithdrawTool* BankTool::getWithdrawTool(const ZZ &userPK, int wSize, +Ptr BankTool::getWithdrawTool(const ZZ &userPK, int wSize, int coinDenom) const { - return new BankWithdrawTool(bankParameters, userPK, stat, lx, wSize, + return new_ptr(bankParameters, userPK, stat, lx, wSize, coinDenom, hashAlg); } -bool BankTool::verifyIdentity(ProofMessage* idProof, const ZZ &userPK) const { +bool BankTool::verifyIdentity(Ptr idProof, const ZZ &userPK) const { // check user's PoK of sk_u such that pk_u = g^sk_u InterpreterVerifier verifier; group_map g; diff --git a/src/BankTool.h b/src/BankTool.h index 61e86be..f6ee6a2 100644 --- a/src/BankTool.h +++ b/src/BankTool.h @@ -12,24 +12,20 @@ class BankTool { vector &coinDenoms); BankTool(int st, int l, const hashalg_t &ha, - BankParameters bp); - - BankTool(const BankTool &original); + const BankParameters& bp); BankTool(const char *fname) - : bankParameters(0), publicBankParameters(0) + : bankParameters(), publicBankParameters() { loadFile(make_nvp("BankTool", *this), fname); } - ~BankTool(); - // getters - const BankParameters* getBankParameters() const + Ptr getBankParameters() const { return publicBankParameters; } - const GroupPrime* getCashGroup() const + Ptr getCashGroup() const { return publicBankParameters->getCashGroup(); } - const vector getBankPublicKeys() const + const vector > getBankPublicKeys() const { return publicBankParameters->getBankKeys(); } - const GroupRSA* getBankPublicKey(int denom) const + Ptr getBankPublicKey(int denom) const { return publicBankParameters->getBankKey(denom); } /*! Inputs: user public key, group corresponding to public key, and @@ -37,13 +33,13 @@ class BankTool { * Output: a tool for interacting with a user who wants to withdraw a * wallet. * The BWTool returned must be freed by the caller. */ - BankWithdrawTool* getWithdrawTool(const ZZ &userPK, int wSize, + Ptr getWithdrawTool(const ZZ &userPK, int wSize, int coinDenom) const; /*! Input: a non interactive sigma proof of knowledge of a user's secret * key, using the public key as a commitment to the secret key. * Ouputs: true if proof accepted, false if proof not accepted. */ - bool verifyIdentity(ProofMessage* idProof, const ZZ &userPK) const; + bool verifyIdentity(Ptr idProof, const ZZ &userPK) const; // functions for depositing at the bank /*! Returns true if a coin is formed correctly */ @@ -62,8 +58,8 @@ class BankTool { private: int stat, lx; hashalg_t hashAlg; - BankParameters* bankParameters; - BankParameters* publicBankParameters; + Ptr bankParameters; + Ptr publicBankParameters; friend class boost::serialization::access; template diff --git a/src/BankWithdrawTool.cpp b/src/BankWithdrawTool.cpp index 96a8e06..86c7227 100644 --- a/src/BankWithdrawTool.cpp +++ b/src/BankWithdrawTool.cpp @@ -3,7 +3,7 @@ #include "CashException.h" #include "CLBlindIssuer.h" -BankWithdrawTool::BankWithdrawTool(const BankParameters *bp, const ZZ &userPK, +BankWithdrawTool::BankWithdrawTool(Ptr bp, const ZZ &userPK, int st, int l, int wSize, int denom, const hashalg_t &ha) : bankParameters(bp), userPublicKey(userPK), stat(st), lx(l), @@ -21,7 +21,7 @@ BankWithdrawTool::BankWithdrawTool(const BankParameters *bp, const ZZ &userPK, } BankWithdrawTool::BankWithdrawTool(const BankWithdrawTool &o) - : bankParameters(new BankParameters(*o.bankParameters)), + : bankParameters(new_ptr(*o.bankParameters)), userPublicKey(o.userPublicKey), stat(o.stat), lx(o.lx), walletSize(o.walletSize), coinDenom(o.coinDenom), bankContribution(o.bankContribution), hashAlg(o.hashAlg) @@ -40,7 +40,7 @@ void BankWithdrawTool::computeFullCommitment(const ZZ &partialCommitment) { fullCommitment = resultA; } -ProofMessage* BankWithdrawTool::sign(ProofMessage* id, ProofMessage* cl){ +Ptr BankWithdrawTool::sign(Ptr id, Ptr cl){ // first verify ID proof, then create issuer for the CL part InterpreterVerifier verifier; group_map g; @@ -55,8 +55,8 @@ ProofMessage* BankWithdrawTool::sign(ProofMessage* id, ProofMessage* cl){ "[BankWithdrawTool::sign] Proof of ID did not verify"); } variable_map clPubs = cl->publics; - const GroupRSA* sk = bankParameters->getBankKey(coinDenom); - const GroupPrime* comGroup = bankParameters->getCashGroup(); + Ptr sk = bankParameters->getBankKey(coinDenom); + Ptr comGroup = bankParameters->getCashGroup(); vector coms; for (int i = 0; i < 3; i++) { string name = "c_"+lexical_cast(i+1); diff --git a/src/BankWithdrawTool.h b/src/BankWithdrawTool.h index 0b72147..e44ac02 100644 --- a/src/BankWithdrawTool.h +++ b/src/BankWithdrawTool.h @@ -6,7 +6,7 @@ class BankWithdrawTool { public: - BankWithdrawTool(const BankParameters *bp, const ZZ &userPK, + BankWithdrawTool(Ptr bp, const ZZ &userPK, int stat, int lx, int wSize, int denom, const hashalg_t &hashAlg); @@ -22,13 +22,13 @@ class BankWithdrawTool { // This method will return the bank's signature if the sigma proofs // are verified, and will throw exceptions if they are not verified - ProofMessage* sign(ProofMessage* id, ProofMessage* cl); + Ptr sign(Ptr id, Ptr cl); int getWalletSize() const { return walletSize; } int getDenom() const { return coinDenom; } private: - const BankParameters* bankParameters; + Ptr bankParameters; ZZ userPublicKey; int stat, lx, walletSize, coinDenom; ZZ bankContribution; diff --git a/src/BuyMessage.cpp b/src/BuyMessage.cpp index 71cf759..5230108 100644 --- a/src/BuyMessage.cpp +++ b/src/BuyMessage.cpp @@ -2,18 +2,18 @@ #include "VEVerifier.h" #include "Timer.h" -bool BuyMessage::check(const VEPublicKey* pk, const int stat, +bool BuyMessage::check(Ptr pk, const int stat, const ZZ& R) const { // check coin - if (!coinPrime.verifyCoin() || coinPrime.getR() != R) + if (!coinPrime->verifyCoin() || coinPrime->getR() != R) throw CashException(CashException::CE_FE_ERROR, "[BuyMessage::check] Malformed coin"); // check verifiable escrow startTimer(); VEVerifier verifier(pk); - if (!verifier.verify(*escrow, coinPrime.getEndorsementCom(), - coinPrime.getCashGroup(), saveString(contract), + if (!verifier.verify(*escrow, coinPrime->getEndorsementCom(), + coinPrime->getCashGroup(), saveString(*contract), pk->hashAlg, stat)) throw CashException(CashException::CE_FE_ERROR, "[BuyMessage::check] Malformed escrow"); diff --git a/src/BuyMessage.h b/src/BuyMessage.h index aa43662..1131660 100644 --- a/src/BuyMessage.h +++ b/src/BuyMessage.h @@ -16,34 +16,34 @@ class BuyMessage { /*! coinPrime represents the unendorsed coin, contract represents * the label for the verifiable encryption, and escrow represents * the verifiable escrow on the coin's endorsement */ - BuyMessage(const Coin &coinPrime, FEContract* contract, - VECiphertext* escrow) - : coinPrime(coinPrime), contract(contract), escrow(escrow) {} + BuyMessage(Ptr coinPrime, Ptr contract, + Ptr escrow) + : coinPrime(new_ptr(*coinPrime)), + contract(new_ptr(*contract)), + escrow(new_ptr(*escrow)) {} /*! copy constructor */ BuyMessage(const BuyMessage &o) : coinPrime(o.coinPrime), contract(o.contract), escrow(o.escrow) {} - ~BuyMessage() { /*delete contract;*/ delete escrow; } - - BuyMessage(const string& s, const BankParameters *params) { + BuyMessage(const string& s, Ptr params) { // need to set params for Coin contained in message loadGZString(make_nvp("BuyMessage", *this), s); - coinPrime.setParameters(params); + coinPrime->setParameters(params); } /*! check contents (verify coin and escrow) */ - bool check(const VEPublicKey* pk, const int stat, const ZZ& R) const; + bool check(Ptr pk, const int stat, const ZZ& R) const; // getters - Coin getCoinPrime() const { return coinPrime; } - FEContract* getContract() const { return contract; } - VECiphertext* getEscrow() const { return escrow; } + Ptr getCoinPrime() const { return coinPrime; } + Ptr getContract() const { return contract; } + Ptr getEscrow() const { return escrow; } private: - Coin coinPrime; - FEContract* contract; - VECiphertext* escrow; + Ptr coinPrime; + Ptr contract; + Ptr escrow; friend class boost::serialization::access; template diff --git a/src/Buyer.cpp b/src/Buyer.cpp index 784c51d..6593d37 100644 --- a/src/Buyer.cpp +++ b/src/Buyer.cpp @@ -7,18 +7,12 @@ /*----------------------------------------------------------------------------*/ // Constructors -Buyer::Buyer(int timeoutLength, const VEPublicKey* pk, int stat) +Buyer::Buyer(int timeoutLength, Ptr pk, int stat) : timeoutLength(timeoutLength), stat(stat), pk(pk), - contract(NULL), inProgress(false) + inProgress(false) { } -Buyer::Buyer(const Buyer& o) - : timeoutLength(o.timeoutLength), stat(o.stat), pk(o.pk), - contract(o.contract? new FEContract(*o.contract) : NULL), - r(o.r), endorsement(o.endorsement), inProgress(o.inProgress) -{ -} /*----------------------------------------------------------------------------*/ // Destructor Buyer::~Buyer() { @@ -27,21 +21,21 @@ Buyer::~Buyer() { void Buyer::reset() { inProgress = false; - for (unsigned i = 0; i < ptext.size(); i++) { - delete ptext[i]; - } - delete contract; - contract = NULL; + ptext.clear(); + ctext.clear(); + contract.reset(); + coin.reset(); } + /*----------------------------------------------------------------------------*/ // Buy -BuyMessage* Buyer::buy(Wallet* wallet, EncBuffer* ciphertext, +Ptr Buyer::buy(Ptr wallet, Ptr ciphertext, const hash_t& ptHash, const ZZ& R) { - return buy(wallet, CommonFunctions::vectorize(ciphertext), + return buy(wallet, CommonFunctions::vectorize >(ciphertext), CommonFunctions::vectorize(ptHash), R); } -BuyMessage* Buyer::buy(Wallet* wallet, const vector& ctext, +Ptr Buyer::buy(Ptr wallet, const vector >& ctext, const vector& ptHash, const ZZ &R) { startTimer(); makeCoin(*wallet, R); @@ -49,12 +43,12 @@ BuyMessage* Buyer::buy(Wallet* wallet, const vector& ctext, return buy(ctext, ptHash); } -BuyMessage* Buyer::buy(EncBuffer* ciphertext, const hash_t& ptHash) { - return buy(CommonFunctions::vectorize(ciphertext), +Ptr Buyer::buy(Ptr ciphertext, const hash_t& ptHash) { + return buy(CommonFunctions::vectorize >(ciphertext), CommonFunctions::vectorize(ptHash)); } -BuyMessage* Buyer::buy(const vector& ct, +Ptr Buyer::buy(const vector >& ct, const vector& ptHash) { if (inProgress) throw CashException(CashException::CE_FE_ERROR, @@ -89,13 +83,13 @@ BuyMessage* Buyer::buy(const vector& ct, startTimer(); // set up the escrow - VECiphertext* escrow = new VECiphertext(makeEscrow()); + Ptr escrow = new_ptr(makeEscrow()); printTimer("[Buyer::buy] created escrow"); // set inProgress inProgress = true; - return new BuyMessage(coin, contract, escrow); + return new_ptr(coin, contract, escrow); } void Buyer::createContract() { @@ -104,14 +98,14 @@ void Buyer::createContract() { ZZ id = Hash::hash(r, pk->hashAlg, pk->hashKey); // prepare timeout setTimeout(); - contract = new FEContract(timeout, id); + contract = new_ptr(timeout, id); } VECiphertext Buyer::makeEscrow() { // now set up the verifiable encryption VEProver prover(pk); - return prover.verifiableEncrypt(coin.getEndorsementCom(), endorsement, - coin.getCashGroup(), saveString(*contract), + return prover.verifiableEncrypt(coin->getEndorsementCom(), endorsement, + coin->getCashGroup(), saveString(*contract), pk->hashAlg, stat); } @@ -120,11 +114,11 @@ void Buyer::makeCoin(Wallet& w, const ZZ& R) { setCoin( w.nextCoin(R) ); } -void Buyer::setCoin(const Coin& c) +void Buyer::setCoin(Ptr c) { coin = c; - endorsement = coin.getEndorsement(); - coin.unendorse(); + endorsement = coin->getEndorsement(); + coin->unendorse(); } /*----------------------------------------------------------------------------*/ @@ -150,7 +144,7 @@ bool Buyer::checkKey(const vector& keys) { for (unsigned i = 0; i < ctext.size(); i++) { // decrypt the ciphertext using key unsigned index = (keys.size() == 1) ? 0 : i; - Buffer* plaintext = ctext[i]->decrypt(keys[index], + Ptr plaintext = ctext[i]->decrypt(keys[index], contract->getEncAlgB()); ptext.push_back(plaintext); } diff --git a/src/Buyer.h b/src/Buyer.h index 8e53a55..d832679 100644 --- a/src/Buyer.h +++ b/src/Buyer.h @@ -12,10 +12,7 @@ class Buyer { public: /*! constructor takes in various parameters, a wallet, and the * arbiter's public key */ - Buyer(int timeoutLength, const VEPublicKey* pk, int stat); - - /*! copy constructor */ - Buyer(const Buyer &o); + Buyer(int timeoutLength, Ptr pk, int stat); /*! destructor */ ~Buyer(); @@ -23,18 +20,18 @@ class Buyer { /*! buy the ciphertext by sending an unendorsed coin, * a verifiable escrow of the endorsement, and associated * contract */ - BuyMessage* buy(Wallet* wallet, EncBuffer* ctext, + Ptr buy(Ptr wallet, Ptr ctext, const hash_t& ptHash, const ZZ &R); /*! buy multiple files */ - BuyMessage* buy(Wallet* wallet, const vector& ctext, + Ptr buy(Ptr wallet, const vector >& ctext, const vector& ptHash, const ZZ &R); /*! assumes setCoin() has been called */ - BuyMessage* buy(EncBuffer* ctext, const hash_t& ptHash); + Ptr buy(Ptr ctext, const hash_t& ptHash); /*! assumes setCoin() has been called */ - BuyMessage* buy(const vector& ctext, + Ptr buy(const vector >& ctext, const vector& ptHash); @@ -54,18 +51,18 @@ class Buyer { /*! get the plaintext (if stored as string in Buyer) */ //string getFile() const { return *ptext; } - const vector& getPtext() const { return ptext; } + const vector >& getPtext() const { return ptext; } /*! get the endorsement (send after key is checked) */ const vector& getEndorsement() const { return endorsement; } - bool canAbortLocally() {return !inProgress; }; + bool canAbortLocally() { return !inProgress; }; // setters - void setCoin(const Coin& coin); - void setTimeout() { timeout =time(NULL) + timeoutLength; } - void setSecurity(const int newstat) {stat = newstat;} - void setVEPublicKey(const VEPublicKey* newpk) {pk = newpk;} + void setCoin(Ptr coin); + void setTimeout() { timeout = time(NULL) + timeoutLength; } + void setSecurity(const int newstat) { stat = newstat; } + void setVEPublicKey(Ptr newpk) { pk = newpk; } void reset(); @@ -78,15 +75,15 @@ class Buyer { int timeout; int timeoutLength; int stat; - const VEPublicKey* pk; + Ptr pk; - Coin coin; - FEContract* contract; + Ptr coin; + Ptr contract; // ciphertext to decrypt, received from Seller - vector ctext; + vector > ctext; // saves output of decrypt() if Buy protocol is successful - vector ptext; + vector > ptext; ZZ r; vector endorsement; diff --git a/src/CLBlindIssuer.cpp b/src/CLBlindIssuer.cpp index 679b1d7..5e222ad 100644 --- a/src/CLBlindIssuer.cpp +++ b/src/CLBlindIssuer.cpp @@ -3,7 +3,7 @@ #include "ZKP/InterpreterProver.h" #include "Timer.h" -CLBlindIssuer::CLBlindIssuer(const GroupRSA* sk, const Group* comGroup, +CLBlindIssuer::CLBlindIssuer(Ptr sk, Ptr comGroup, int lx, const vector &coms, int numPrivates, int numPublics) : numPrivates(numPrivates), numPublics(numPublics) @@ -23,7 +23,7 @@ CLBlindIssuer::CLBlindIssuer(const GroupRSA* sk, const Group* comGroup, verifier.check(CommonFunctions::getZKPDir()+"/cl-obtain-ecash.txt", inputs, g); } -CLBlindIssuer::CLBlindIssuer(const GroupRSA* sk, int lx, int numPrivates, +CLBlindIssuer::CLBlindIssuer(Ptr sk, int lx, int numPrivates, int numPublics, const gen_group_map &groups, const vector &coms) : numPrivates(numPrivates), numPublics(numPublics) @@ -57,7 +57,7 @@ CLBlindIssuer::CLBlindIssuer(const CLBlindIssuer &o) { } -ProofMessage* CLBlindIssuer::getPartialSignature(const ZZ &C, +Ptr CLBlindIssuer::getPartialSignature(const ZZ &C, const vector& publics, const ProofMessage &pm, int stat, @@ -87,7 +87,8 @@ ProofMessage* CLBlindIssuer::getPartialSignature(const ZZ &C, // map for doing issue program ZZ lx = v.at("l_x"); v.clear(); - const GroupRSA* grp = (GroupRSA*) g.at("pkGroup"); + Ptr grp = + dynamic_pointer_cast(g.at("pkGroup")); v["l_x"] = lx; v["stat"] = grp->getStat(); v["modSize"] = grp->getModulusLength(); @@ -106,7 +107,7 @@ ProofMessage* CLBlindIssuer::getPartialSignature(const ZZ &C, variable_map p = prover.getPublicVariables(); SigmaProof pr = prover.computeProof(hashAlg); printTimer("[CLBlindIssuer] computed issuer proof"); - return new ProofMessage(partialSig, p, pr); + return new_ptr(partialSig, p, pr); } else { throw CashException(CashException::CE_PARSE_ERROR, "[CLBlindIssuer::getPartialSignature] Proof did not verify"); diff --git a/src/CLBlindIssuer.h b/src/CLBlindIssuer.h index e660c85..21064ca 100644 --- a/src/CLBlindIssuer.h +++ b/src/CLBlindIssuer.h @@ -9,10 +9,10 @@ class CLBlindIssuer { public: - CLBlindIssuer(const GroupRSA* sk, const Group* comGroup, int lx, + CLBlindIssuer(Ptr sk, Ptr comGroup, int lx, const vector &coms, int numPrivates, int numPublics); - CLBlindIssuer(const GroupRSA* sk, int lx, int numPrivates, + CLBlindIssuer(Ptr sk, int lx, int numPrivates, int numPublics, const gen_group_map &groups, const vector &coms); @@ -20,9 +20,9 @@ class CLBlindIssuer { /*! returns a variable map with the components of a partial signature * A, e, and v'' as well as a proof that it was correctly formed */ - ProofMessage* getPartialSignature(const ZZ &C, const vector& pubs, - const ProofMessage &pm, int stat, - const hashalg_t &hashAlg); + Ptr getPartialSignature(const ZZ &C, const vector& pubs, + const ProofMessage &pm, int stat, + const hashalg_t &hashAlg); private: input_map inputs; diff --git a/src/CLBlindRecipient.cpp b/src/CLBlindRecipient.cpp index 7645adf..c79e52f 100644 --- a/src/CLBlindRecipient.cpp +++ b/src/CLBlindRecipient.cpp @@ -4,7 +4,7 @@ #include #include "Timer.h" -CLBlindRecipient::CLBlindRecipient(const GroupRSA* pk, const Group* comGroup, +CLBlindRecipient::CLBlindRecipient(Ptr pk, Ptr comGroup, int lx, const vector &coms, int numPrivates, int numPublics) : numPrivates(numPrivates), numPublics(numPublics) @@ -26,7 +26,7 @@ CLBlindRecipient::CLBlindRecipient(const GroupRSA* pk, const Group* comGroup, prover.check(CommonFunctions::getZKPDir()+"/cl-obtain-ecash.txt", inputs, g); } -CLBlindRecipient::CLBlindRecipient(const GroupRSA* pk, int lx, int numPrivates, +CLBlindRecipient::CLBlindRecipient(Ptr pk, int lx, int numPrivates, int numPublics, const gen_group_map &grps, const vector &coms) : numPrivates(numPrivates), numPublics(numPublics) @@ -58,7 +58,7 @@ CLBlindRecipient::CLBlindRecipient(const GroupRSA* pk, int lx, int numPrivates, prover.check(fname, inputs, g); } -ProofMessage* CLBlindRecipient::getC(const vector& privates, +Ptr CLBlindRecipient::getC(const vector& privates, const hashalg_t &hashAlg) { if((int)privates.size() != numPrivates) throw CashException(CashException::CE_SIZE_ERROR, @@ -84,7 +84,7 @@ ProofMessage* CLBlindRecipient::getC(const vector& privates, variable_map pVars = prover.getEnvironment().variables; vals["C"] = pVars.at("C"); vals["vprime"] = pVars.at("vprime"); - return new ProofMessage(vals, publics, proof); + return new_ptr(vals, publics, proof); } bool CLBlindRecipient::verifySig(const ProofMessage &pm, int stat){ diff --git a/src/CLBlindRecipient.h b/src/CLBlindRecipient.h index 10b7c3e..8c64376 100644 --- a/src/CLBlindRecipient.h +++ b/src/CLBlindRecipient.h @@ -12,13 +12,13 @@ class CLBlindRecipient { /*! this constructor assumes commitments are formed in e-cash group * and is passed in the number of private and public variables and * a message length parameter, as well as the private commitments */ - CLBlindRecipient(const GroupRSA* pk, const Group* comGroup, int lx, + CLBlindRecipient(Ptr pk, Ptr comGroup, int lx, const vector &coms, int numPrivates, int numPublics); /*! this constructor allows for commitments that have been formed in * groups other than the PK group */ - CLBlindRecipient(const GroupRSA* pk, int lx, int numPrivates, + CLBlindRecipient(Ptr pk, int lx, int numPrivates, int numPublics, const gen_group_map &groups, const vector &coms); @@ -27,8 +27,8 @@ class CLBlindRecipient { // it is also possible to use one that is a commitment to all at once /*! returns the product C = h^v' * g_1^x_1 * ... * g_l^x_l, as * well as a proof that it was formed correctly */ - ProofMessage* getC(const vector &privates, - const hashalg_t &hashAlg); + Ptr getC(const vector &privates, + const hashalg_t &hashAlg); /*! given a partial signature, check that it was formed * correctly (i.e. that bank's PoK of 1/e verifies) */ diff --git a/src/CLSignatureProver.cpp b/src/CLSignatureProver.cpp index ddba84f..386928c 100644 --- a/src/CLSignatureProver.cpp +++ b/src/CLSignatureProver.cpp @@ -2,8 +2,8 @@ #include #include "Timer.h" -CLSignatureProver::CLSignatureProver(const GroupRSA* publicKey, - const Group* comGroup, int lx, +CLSignatureProver::CLSignatureProver(Ptr publicKey, + Ptr comGroup, int lx, const vector &coms, int numPrivates, int numPublics) :numPrivates(numPrivates), numPublics(numPublics) @@ -24,7 +24,7 @@ CLSignatureProver::CLSignatureProver(const GroupRSA* publicKey, prover.check(CommonFunctions::getZKPDir()+"/cl-prove-ecash.txt", inputs, g); } -CLSignatureProver::CLSignatureProver(const GroupRSA* pk, int lx, +CLSignatureProver::CLSignatureProver(Ptr pk, int lx, int numPrivates, int numPublics, const gen_group_map &grps, const vector &coms) @@ -54,7 +54,7 @@ CLSignatureProver::CLSignatureProver(const GroupRSA* pk, int lx, prover.check(fname, inputs, g); } -ProofMessage* CLSignatureProver::getProof(const vector& sig, +Ptr CLSignatureProver::getProof(const vector& sig, const vector& privates, const vector& publics, const hashalg_t &hashAlg){ @@ -85,7 +85,7 @@ ProofMessage* CLSignatureProver::getProof(const vector& sig, startTimer(); prover.compute(v); printTimer("CL prover computed all values"); - return new ProofMessage(prover.getPublicVariables(), + return new_ptr(prover.getPublicVariables(), prover.computeProof(hashAlg)); } diff --git a/src/CLSignatureProver.h b/src/CLSignatureProver.h index 72c3c85..b03c4b5 100644 --- a/src/CLSignatureProver.h +++ b/src/CLSignatureProver.h @@ -9,19 +9,19 @@ class CLSignatureProver { public: /*! this constructor assumes all operations take place in the same * group */ - CLSignatureProver(const GroupRSA *publicKey, const Group* comGroup, + CLSignatureProver(Ptr publicKey, Ptr comGroup, int lx, const vector &coms, int numPrivates, int numPublics); - CLSignatureProver(const GroupRSA* pk, int lx, int numPrivates, + CLSignatureProver(Ptr pk, int lx, int numPrivates, int numPublics, const gen_group_map &grps, const vector &coms); /*! returns SigmaProof of valid signature */ - ProofMessage* getProof(const vector& sig, - const vector& privates, - const vector& publics, - const hashalg_t &hashAlg); + Ptr getProof(const vector& sig, + const vector& privates, + const vector& publics, + const hashalg_t &hashAlg); private: group_map g; diff --git a/src/CLSignatureVerifier.cpp b/src/CLSignatureVerifier.cpp index 48d298b..a23d757 100644 --- a/src/CLSignatureVerifier.cpp +++ b/src/CLSignatureVerifier.cpp @@ -1,7 +1,7 @@ #include "CLSignatureVerifier.h" -CLSignatureVerifier::CLSignatureVerifier(const GroupRSA* publicKey, - const Group* comGroup, int lx, +CLSignatureVerifier::CLSignatureVerifier(Ptr publicKey, + Ptr comGroup, int lx, const vector &coms, int numPrivates, int numPublics) : numPrivates(numPrivates), numPublics(numPublics) @@ -20,7 +20,7 @@ CLSignatureVerifier::CLSignatureVerifier(const GroupRSA* publicKey, verifier.check(CommonFunctions::getZKPDir()+"/cl-prove-ecash.txt", inputs); } -CLSignatureVerifier::CLSignatureVerifier(const GroupRSA* pk, int lx, +CLSignatureVerifier::CLSignatureVerifier(Ptr pk, int lx, int numPrivates, int numPublics, const gen_group_map &groups, const vector &coms) @@ -49,11 +49,10 @@ CLSignatureVerifier::CLSignatureVerifier(const GroupRSA* pk, int lx, verifier.check(fname, inputs); } -bool CLSignatureVerifier::verify(const ProofMessage* pm, int stat) { - SigmaProof proof = pm->proof; - variable_map publics1 = pm->proof.getCommitments(); - variable_map publics2 = pm->publics; +bool CLSignatureVerifier::verify(const ProofMessage& pm, int stat) { + variable_map publics1 = pm.proof.getCommitments(); + variable_map publics2 = pm.publics; verifier.compute(v, publics1, publics2, g); - return verifier.verify(proof, stat); + return verifier.verify(pm.proof, stat); } diff --git a/src/CLSignatureVerifier.h b/src/CLSignatureVerifier.h index e1decf7..0dfdf90 100644 --- a/src/CLSignatureVerifier.h +++ b/src/CLSignatureVerifier.h @@ -7,16 +7,16 @@ class CLSignatureVerifier { public: - CLSignatureVerifier(const GroupRSA *publicKey, - const Group* comGroup, int lx, const vector &c, + CLSignatureVerifier(Ptr publicKey, + Ptr comGroup, int lx, const vector &c, int numPrivates, int numPublics); - CLSignatureVerifier(const GroupRSA* pk, int lx, int numPrivates, + CLSignatureVerifier(Ptr pk, int lx, int numPrivates, int numPublics, const gen_group_map &groups, const vector &coms); /*! checks to see if a signature composed of A, e, and v is valid */ - bool verify(const ProofMessage* pm, int stat); + bool verify(const ProofMessage& pm, int stat); private: group_map g; diff --git a/src/Ciphertext.cpp b/src/Ciphertext.cpp index cc446c2..7078c07 100644 --- a/src/Ciphertext.cpp +++ b/src/Ciphertext.cpp @@ -365,10 +365,10 @@ void Ciphertext::AES_counter_crypt(const unsigned char *in, unsigned char *out, } } -EncBuffer* Buffer::encrypt(const Ciphertext::cipher_t& alg, const string& k) const +Ptr Buffer::encrypt(const Ciphertext::cipher_t& alg, const string& k) const { string key = (!k.empty()) ? k : Ciphertext::generateKey(alg); size_t ctl; char *ct = Ciphertext::encrypt(key.data(), buf, len, alg, &ctl); - return new EncBuffer(ct, ctl, key, alg); + return new_ptr(ct, ctl, key, alg); } diff --git a/src/Ciphertext.h b/src/Ciphertext.h index 602a8b2..e5ae39e 100644 --- a/src/Ciphertext.h +++ b/src/Ciphertext.h @@ -109,19 +109,19 @@ class Ciphertext { operator string() const { return string(buf, len); } Buffer& operator=(const string& s) { copyString(s); return *this; } - // encrypt a Buffer: returns new EncBuffer* containing key, alg - //EncBuffer* encrypt(const string& key, const Ciphertext::cipher_t& alg) const; - EncBuffer* encrypt(const Ciphertext::cipher_t& alg, const string& key = string()) const;/* { + // encrypt a Buffer: returns new Ptr containing key, alg + //Ptr encrypt(const string& key, const Ciphertext::cipher_t& alg) const; + Ptr encrypt(const Ciphertext::cipher_t& alg, const string& key = string()) const;/* { return encrypt((NULL != key) ? key : Ciphertext::generateKey(alg), alg); }*/ - EncBuffer* encrypt(const ZZ& r, const Ciphertext::cipher_t& alg) const { + Ptr encrypt(const ZZ& r, const Ciphertext::cipher_t& alg) const { return encrypt(alg, Ciphertext::generateKey(alg, r)); } - // decrypt a Buffer: returns new Buffer* - virtual Buffer* decrypt(const string& key, const Ciphertext::cipher_t& alg) const { + // decrypt a Buffer: returns new Ptr + virtual Ptr decrypt(const string& key, const Ciphertext::cipher_t& alg) const { size_t ptl; char *pt = Ciphertext::decrypt(key.data(), buf, len, alg, &ptl); - return new Buffer(pt, ptl, false); + return new_ptr(pt, ptl, false); } // hash a Buffer: caches hash computation hash_t hash(const hashalg_t& halg, const string& hkey, int htype) { @@ -173,10 +173,10 @@ class Ciphertext { : Buffer(d, l, true), key(k), encAlg(a) {} EncBuffer(char* d, size_t l) : Buffer(d, l, true), key(), encAlg() {} - Buffer* decrypt(const string& key, const Ciphertext::cipher_t& alg) const { + Ptr decrypt(const string& key, const Ciphertext::cipher_t& alg) const { return Buffer::decrypt(key, alg); } - Buffer* decrypt() const { + Ptr decrypt() const { return Buffer::decrypt(key, encAlg); } void clear() { Buffer::clear(); key = string(); } diff --git a/src/Coin.cpp b/src/Coin.cpp index c03e739..1421745 100644 --- a/src/Coin.cpp +++ b/src/Coin.cpp @@ -7,7 +7,7 @@ #include "CLSignatureVerifier.h" #include "Timer.h" -Coin::Coin(const BankParameters* params, int wSize, int index, +Coin::Coin(Ptr params, int wSize, int index, const ZZ &skIn, const ZZ &sIn, const ZZ &tIn, const vector &clSig, int st, int l, const ZZ &rVal, int denom, const hashalg_t &ha) @@ -47,8 +47,8 @@ Coin::Coin(const BankParameters* params, int wSize, int index, // now need to do CL stuff // public message is the wallet size W // secret messages are sk_u, s, and t - const GroupRSA* pk = parameters->getBankKey(coinDenom); - const GroupPrime* comGroup = parameters->getCashGroup(); + Ptr pk = parameters->getBankKey(coinDenom); + Ptr comGroup = parameters->getCashGroup(); vector coms; coms.push_back(B); coms.push_back(C); @@ -62,7 +62,7 @@ Coin::Coin(const BankParameters* params, int wSize, int index, privates.push_back(make_pair(t, env.variables.at("r_D"))); vector publics; publics.push_back(walletSize); - ProofMessage* pm = clProver.getProof(signature, privates, publics, + Ptr pm = clProver.getProof(signature, privates, publics, hashAlg); printTimer("[Coin] got proof for CL"); clProof = *pm; @@ -80,7 +80,7 @@ Coin::Coin(const Coin &o) bool Coin::verifyEndorsement(const vector &endorse) { vector bases; - const GroupPrime* cashGroup = parameters->getCashGroup(); + Ptr cashGroup = parameters->getCashGroup(); ZZ mod = cashGroup->getModulus(); bases.push_back(cashGroup->getGenerator(3)); // h1 bases.push_back(cashGroup->getGenerator(4)); // h2 @@ -115,8 +115,8 @@ bool Coin::verifyCoin() const { // now do CL stuff startTimer(); - const GroupRSA* pk = parameters->getBankKey(coinDenom); - const GroupPrime* comGroup = parameters->getCashGroup(); + Ptr pk = parameters->getBankKey(coinDenom); + Ptr comGroup = parameters->getCashGroup(); vector coms; coms.push_back(B); @@ -126,7 +126,7 @@ bool Coin::verifyCoin() const { startTimer(); CLSignatureVerifier clVerifier(pk, comGroup, lx, coms, 3, 1); printTimer("[Coin] Verifier checked CL part"); - bool clVerified = clVerifier.verify(&clProof, stat); + bool clVerified = clVerifier.verify(clProof, stat); printTimer("[Coin] Verified CL possession"); return (ecashVerified && clVerified); } diff --git a/src/Coin.h b/src/Coin.h index fdd675a..26c7fc7 100644 --- a/src/Coin.h +++ b/src/Coin.h @@ -13,16 +13,16 @@ class Coin { /*! coin stores the user's secret sk_u, s, and t, as well * as a CL signature on these values, the index within the * wallet, the coin denomination, and the R value for the coin */ - Coin(const BankParameters* params, int wSize, int index, + Coin(Ptr params, int wSize, int index, const ZZ &skIn, const ZZ &sIn, const ZZ &tIn, const vector &clSig, int st, int l, const ZZ &rVal, int denom, const hashalg_t &hashAlg); - Coin(const char *fname, const BankParameters *params) + Coin(const char *fname, Ptr params) : parameters(params) { loadFile(make_nvp("Coin", *this), fname); } - Coin(const string& s, const BankParameters *params) + Coin(const string& s, Ptr params) : parameters(params) { loadGZString(make_nvp("Coin", *this), s); } @@ -42,7 +42,7 @@ class Coin { bool endorse(const vector &e); // getters - const GroupPrime* getCashGroup() const + Ptr getCashGroup() const { return parameters->getCashGroup(); } ZZ getWalletSize() const { return walletSize; } ZZ getB() const { return B; } @@ -60,13 +60,13 @@ class Coin { ZZ getSPrime() const; ZZ getTPrime() const; - void setParameters(const BankParameters* p) { parameters = p; } + void setParameters(Ptr p) { parameters = p; } hash_t hash() const; private: int stat, lx, coinDenom; - const BankParameters *parameters; // NOT serialized + Ptr parameters; // NOT serialized int walletSize; // this is W int coinIndex; // this is J ZZ sk_u, s, t; // NOT serialized diff --git a/src/Debug.h b/src/Debug.h index a51e3ae..b54b377 100644 --- a/src/Debug.h +++ b/src/Debug.h @@ -12,7 +12,9 @@ #include //#define DEBUG -#define TIMER +//#define TIMER +//#define DELETE_BUFFERS +#define DOUBLE_CHECK namespace __gnu_cxx { template<> struct hash { diff --git a/src/FEContract.cpp b/src/FEContract.cpp index 7dff378..0055868 100644 --- a/src/FEContract.cpp +++ b/src/FEContract.cpp @@ -20,30 +20,30 @@ bool FEContract::checkEncAlgB(const cipher_t& encAlgR) const { } -bool FEContract::checkAFiles(const vector& ptext, - const vector& ctext) const { +bool FEContract::checkAFiles(const vector >& ptext, + const vector >& ctext) const { return checkHashes(ptext, ctext, ptHashA, ctHashA); } -bool FEContract::checkBFiles(const vector& ptext, - const vector& ctext) const { +bool FEContract::checkBFiles(const vector >& ptext, + const vector >& ctext) const { return checkHashes(ptext, ctext, ptHashB, ctHashB); } -bool FEContract::checkAFile(const Buffer* ptext, - /*const*/ EncBuffer* ctext) const { - return checkAFiles(CommonFunctions::vectorize(ptext), - CommonFunctions::vectorize(ctext)); +bool FEContract::checkAFile(Ptr ptext, + /*const*/ Ptr ctext) const { + return checkAFiles(CommonFunctions::vectorize >(ptext), + CommonFunctions::vectorize >(ctext)); } -bool FEContract::checkBFile(const Buffer* ptext, - /*const*/ EncBuffer* ctext) const { - return checkBFiles(CommonFunctions::vectorize(ptext), - CommonFunctions::vectorize(ctext)); +bool FEContract::checkBFile(Ptr ptext, + /*const*/ Ptr ctext) const { + return checkBFiles(CommonFunctions::vectorize >(ptext), + CommonFunctions::vectorize >(ctext)); } -bool FEContract::checkHashes(const vector& ptext, - const vector& ctext, +bool FEContract::checkHashes(const vector >& ptext, + const vector >& ctext, const hash_t& ptHash, const hash_t& ctHash) const { if (ptext.size() != ctext.size()) throw CashException(CashException::CE_FE_ERROR, diff --git a/src/FEContract.h b/src/FEContract.h index 254f3a0..ab9d945 100644 --- a/src/FEContract.h +++ b/src/FEContract.h @@ -23,7 +23,7 @@ class FEContract { ptHashBlocksB(o.ptHashBlocksB), ctHashBlocksB(o.ctHashBlocksB) {} /*! serialization constructor */ - FEContract(const string& str) { loadString(*this, str); } + //FEContract(const string& str) { loadGZString(*this, str); } FEContract() {} @@ -46,12 +46,12 @@ class FEContract { bool checkTimeout(const int timeoutTolerance) const; bool checkEncAlgB(const cipher_t& encAlgR) const; - bool checkAFiles(const vector& ptext, - const vector& ctext) const; - bool checkBFiles(const vector& ptext, - const vector& ctext) const; - bool checkAFile(const Buffer* ptext, /*const*/ EncBuffer* ctext) const; - bool checkBFile(const Buffer* ptext, /*const*/ EncBuffer* ctext) const; + bool checkAFiles(const vector >& ptext, + const vector >& ctext) const; + bool checkBFiles(const vector >& ptext, + const vector >& ctext) const; + bool checkAFile(Ptr ptext, Ptr ctext) const; + bool checkBFile(Ptr ptext, Ptr ctext) const; bool checkAHash(const hash_t& ptHash, const hash_t& ctHash) const; bool checkBHash(const hash_t& ptHash, const hash_t& ctHash) const; @@ -69,8 +69,8 @@ class FEContract { const cipher_t& getEncAlgB() const { return encAlgB; } protected: - bool checkHashes(const vector& ptext, - const vector& ctext, + bool checkHashes(const vector >& ptext, + const vector >& ctext, const hash_t& ptHash, const hash_t& ctHash) const; bool checkHash(const hash_t& hashGiven, const hash_t& hashStored) const; diff --git a/src/FEInitiator.cpp b/src/FEInitiator.cpp index 5cb74bf..f881d38 100644 --- a/src/FEInitiator.cpp +++ b/src/FEInitiator.cpp @@ -5,62 +5,43 @@ /*----------------------------------------------------------------------------*/ // Constructors -FEInitiator::FEInitiator(const long timeoutLength, const VEPublicKey* pk, - const VEPublicKey* regularpk, const int stat, - const Signature::Key* sk) +FEInitiator::FEInitiator(const long timeoutLength, Ptr pk, + Ptr regularpk, const int stat, + Ptr sk) : timeoutLength(timeoutLength), stat(stat), verifiablePK(pk), - regularPK(regularpk), contract(NULL), signKey(NULL), + regularPK(regularpk), contract(), signKey(sk), exchangeType(TYPE_NONE) -{ - if (NULL != sk) - signKey = new Signature::Key(*sk); -} - -FEInitiator::FEInitiator(const FEInitiator &o) - : timeoutLength(o.timeoutLength), stat(o.stat), - verifiablePK(o.verifiablePK), regularPK(o.regularPK), coin(o.coin), - contract(o.contract), signKey(new Signature::Key(*o.signKey)), - ptextA(o.ptextA), ctextA(o.ctextA), ctextB(o.ctextB), ptextB(o.ptextB), - r(o.r), endorsement(o.endorsement), exchangeType(o.exchangeType) -{ -} +{} /*----------------------------------------------------------------------------*/ // Destructor FEInitiator::~FEInitiator() { reset(); - delete signKey; } void FEInitiator::reset() { exchangeType = TYPE_NONE; - for (unsigned i = 0; i < ptextB.size(); i++) - delete ptextB[i]; - for (unsigned i = 0; i < ctextA.size(); i++) - delete ctextA[i]; ctextA.clear(); ctextB.clear(); ptextA.clear(); ptextB.clear(); - - delete contract; - contract = NULL; + contract.reset(); } /*----------------------------------------------------------------------------*/ // Setup -FESetupMessage* FEInitiator::setup(Wallet *wallet, const ZZ &R, +Ptr FEInitiator::setup(Ptr wallet, const ZZ &R, const string &signAlg) { makeCoin(wallet, R); return setup(signAlg); } -FESetupMessage* FEInitiator::setup(const string &signAlg) { +Ptr FEInitiator::setup(const string &signAlg) { #ifdef TIMER startTimer(); #endif // generate signature key - if (signKey == NULL) + if (signKey.get() == NULL) signKey = Signature::Key::generateKey(signAlg); #ifdef TIMER printTimer("Signature key generation"); @@ -75,26 +56,26 @@ startTimer(); ZZ eCom = coin.getEndorsementCom(); // the label needs to be the public key for the signature scheme // create the verifiable escrow - VECiphertext* escrow = new VECiphertext(prover.verifiableEncrypt(eCom, + Ptr escrow = new_ptr(prover.verifiableEncrypt(eCom, endorsement, coin.getCashGroup(), signKey->publicKeyString(), verifiablePK->hashAlg, stat)); #ifdef TIMER printTimer("Verifiable escrow generation"); #endif - return new FESetupMessage(coin, escrow, *signKey); + return new_ptr(coin, escrow, *signKey); } -void FEInitiator::makeCoin(Wallet* wallet, const ZZ& R) { +void FEInitiator::makeCoin(Ptr wallet, const ZZ& R) { // get a coin #ifdef TIMER startTimer(); #endif - Coin coin = wallet->nextCoin(R); + Ptr coin = wallet->nextCoin(R); #ifdef TIMER printTimer("Coin generation"); #endif - setCoin(coin); + setCoin(*coin); } void FEInitiator::setCoin(const Coin& c) { @@ -106,12 +87,12 @@ void FEInitiator::setCoin(const Coin& c) { /*----------------------------------------------------------------------------*/ // Buy -FEMessage* FEInitiator::buy(EncBuffer* ctextR, const hash_t& ptHashR) { - return buy(CommonFunctions::vectorize(ctextR), +Ptr FEInitiator::buy(Ptr ctextR, const hash_t& ptHashR) { + return buy(CommonFunctions::vectorize >(ctextR), CommonFunctions::vectorize(ptHashR)); } -FEMessage* FEInitiator::buy(const vector& ctextR, +Ptr FEInitiator::buy(const vector >& ctextR, const vector& ptHashR) { if (TYPE_NONE != exchangeType) throw CashException(CashException::CE_FE_ERROR, @@ -140,7 +121,7 @@ FEMessage* FEInitiator::buy(const vector& ctextR, Hash::TYPE_MERKLE); // create contract - if (NULL == contract) + if (NULL == contract.get()) createContract(); // set up the contract @@ -151,7 +132,7 @@ FEMessage* FEInitiator::buy(const vector& ctextR, contract->setCTHashBlocksB(ctextR.size()); string signature = signContract(); - return new FEMessage(signature, *contract); + return new_ptr(signature, contract); } void FEInitiator::createContract() { @@ -160,7 +141,7 @@ void FEInitiator::createContract() { ZZ id = Hash::hash(r, verifiablePK->hashAlg, verifiablePK->hashKey); long timeout = time(NULL) + timeoutLength; - contract = new FEContract(timeout, id); + contract = new_ptr(timeout, id); } string FEInitiator::signContract() const { @@ -191,7 +172,7 @@ bool FEInitiator::decryptCheck(const vector& keysR) { for (unsigned i = 0; i < ctextB.size(); i++) { // decrypt the ciphertext using key unsigned index = (keysR.size() == 1) ? 0 : i; - Buffer* ptext = ctextB[i]->decrypt(keysR[index], contract->getEncAlgB()); + Ptr ptext = ctextB[i]->decrypt(keysR[index], contract->getEncAlgB()); ptextB.push_back(ptext); } @@ -208,13 +189,13 @@ bool FEInitiator::decryptCheck(const vector& keysR) { /*----------------------------------------------------------------------------*/ // Continue Round -EncBuffer* FEInitiator::continueRound(const Buffer* ptextI, +Ptr FEInitiator::continueRound(Ptr ptextI, const cipher_t& encAlgI) { - return continueRound(CommonFunctions::vectorize(ptextI), + return continueRound(CommonFunctions::vectorize >(ptextI), encAlgI)[0]; } -vector FEInitiator::continueRound(const vector& ptextI, +vector > FEInitiator::continueRound(const vector >& ptextI, const cipher_t& encAlgI) { if (TYPE_NONE != exchangeType) throw CashException(CashException::CE_FE_ERROR, @@ -231,27 +212,27 @@ vector FEInitiator::continueRound(const vector& ptext /*----------------------------------------------------------------------------*/ // Encrypt -vector FEInitiator::encrypt(const vector& ptextI, +vector > FEInitiator::encrypt(const vector >& ptextI, const cipher_t& encAlgI) const { if (ptextI.empty()) throw CashException(CashException::CE_FE_ERROR, "[FEInitiator::encrypt] No initiator plaintext given"); string key = Ciphertext::generateKey(encAlgI); - vector ctexts; + vector > ctexts; for (unsigned i = 0; i < ptextI.size(); i++) { ctexts.push_back(ptextI[i]->encrypt(encAlgI, key)); } return ctexts; } -void FEInitiator::setInitiatorFiles(const Buffer *ptextI, EncBuffer* ctextI) { - setInitiatorFiles(CommonFunctions::vectorize(ptextI), - CommonFunctions::vectorize(ctextI)); +void FEInitiator::setInitiatorFiles(Ptr ptextI, Ptr ctextI) { + setInitiatorFiles(CommonFunctions::vectorize >(ptextI), + CommonFunctions::vectorize >(ctextI)); } -void FEInitiator::setInitiatorFiles(const vector& ptextI, - const vector& ctextI) { +void FEInitiator::setInitiatorFiles(const vector >& ptextI, + const vector >& ctextI) { // store values ptextA = ptextI; ctextA = ctextI; @@ -259,14 +240,14 @@ void FEInitiator::setInitiatorFiles(const vector& ptextI, /*----------------------------------------------------------------------------*/ // Barter -FEMessage* FEInitiator::barter(EncBuffer* ctextR, const hash_t& ptHashR, +Ptr FEInitiator::barter(Ptr ctextR, const hash_t& ptHashR, const hash_t& ptHashI) { - return barter(CommonFunctions::vectorize(ctextR), + return barter(CommonFunctions::vectorize >(ctextR), CommonFunctions::vectorize(ptHashR), CommonFunctions::vectorize(ptHashI)); } -FEMessage* FEInitiator::barter(const vector& ctextR, +Ptr FEInitiator::barter(const vector >& ctextR, const vector& ptHashR, const vector& ptHashI) { if (ctextR.empty()) @@ -324,7 +305,7 @@ FEMessage* FEInitiator::barter(const vector& ctextR, string sig = Signature::sign(*signKey, escrowStr, regularPK->hashAlg); // now output the escrow, signature, and contract (label) - return new FEMessage(escrow, sig, *contract); + return new_ptr(escrow, sig, contract); } /*----------------------------------------------------------------------------*/ diff --git a/src/FEInitiator.h b/src/FEInitiator.h index 2d309f6..c7b4a12 100644 --- a/src/FEInitiator.h +++ b/src/FEInitiator.h @@ -19,12 +19,9 @@ class FEInitiator { /*! constructor takes in various parameters, as well as a wallet * and the public key of the arbiter */ - FEInitiator(const long timeoutLength, const VEPublicKey* pk, - const VEPublicKey* regularpk, const int stat, - const Signature::Key* signKey = NULL); - - /*! copy constructor */ - FEInitiator(const FEInitiator &o); + FEInitiator(const long timeoutLength, Ptr pk, + Ptr regularpk, const int stat, + Ptr signKey = Ptr()); /*! destructor */ ~FEInitiator(); @@ -33,19 +30,19 @@ class FEInitiator { * unendorsed coin, and then computes a verifiable escrow (using * the arbiter's PK) on the endorsement using the public key for * the signature scheme as a label */ - FESetupMessage* setup(Wallet *wallet, const ZZ &R, + Ptr setup(Ptr wallet, const ZZ &R, const string &signAlg); /*! assumes setCoin() has been called */ - FESetupMessage* setup(const string &signAlg); + Ptr setup(const string &signAlg); // the following functions should be used only for buy /*! receives the ciphertext and computes the contract; also outputs * a signature on the contract */ - FEMessage* buy(EncBuffer* ctextR, const hash_t& ptHashR); + Ptr buy(Ptr ctextR, const hash_t& ptHashR); - FEMessage* buy(const vector& ctextsR, + Ptr buy(const vector >& ctextsR, const vector& ptHashesR); /*! pay the seller with the endorsement (if key is correct) */ @@ -55,21 +52,21 @@ class FEInitiator { // the following functions should be used only for barter - EncBuffer* continueRound(const Buffer *ptextI, const cipher_t& encAlgI); + Ptr continueRound(Ptr ptextI, const cipher_t& encAlgI); - vector continueRound(const vector& ptextI, + vector > continueRound(const vector >& ptextI, const cipher_t& encAlgI); /*! set initiator files (only for BT client use) */ - void setInitiatorFiles(const Buffer* ptextI, EncBuffer* ctextI); + void setInitiatorFiles(Ptr ptextI, Ptr ctextI); - void setInitiatorFiles(const vector& ptextI, - const vector& ctextI); + void setInitiatorFiles(const vector >& ptextI, + const vector >& ctextI); - FEMessage* barter(EncBuffer* ctextR, const hash_t& ptHashR, + Ptr barter(Ptr ctextR, const hash_t& ptHashR, const hash_t& ptHashI); - FEMessage* barter(const vector& ctextR, + Ptr barter(const vector >& ctextR, const vector& ptHashR, const vector& ptHashI); @@ -84,7 +81,7 @@ class FEInitiator { ZZ resolve(); // get vector of decrypted plaintexts from responder - const vector& getPtextB() const { return ptextB; } + const vector >& getPtextB() const { return ptextB; } bool canAbortLocally() {return TYPE_NONE == exchangeType;}; @@ -94,42 +91,42 @@ class FEInitiator { void setTimeoutLength(const long newtimeout) {timeoutLength = newtimeout;} void setSecurity(const int newstat) {stat = newstat;} - void setVerifiablePublicKey(const VEPublicKey* newpk) + void setVerifiablePublicKey(Ptr newpk) {verifiablePK = newpk;} - void setRegularPublicKey(const VEPublicKey* newpk) {regularPK = newpk;} - void setSignatureKey(Signature::Key* newsignKey = NULL) - { delete signKey; signKey = newsignKey ? new Signature::Key(*newsignKey) : NULL; } + void setRegularPublicKey(Ptr newpk) {regularPK = newpk;} + void setSignatureKey(Ptr sk=Ptr()) + { signKey = sk; } void setExchangeType(int et) { exchangeType = et; } void reset(); protected: - void makeCoin(Wallet* wallet, const ZZ& R); + void makeCoin(Ptr wallet, const ZZ& R); void createContract(); string signContract() const; bool decryptCheck(const vector& keys); - vector encrypt(const vector& ptextI, + vector > encrypt(const vector >& ptextI, const cipher_t& encAlgI) const; private: long timeoutLength; int stat; - const VEPublicKey* verifiablePK; - const VEPublicKey* regularPK; + Ptr verifiablePK; + Ptr regularPK; Coin coin; - FEContract* contract; - Signature::Key* signKey; + Ptr contract; + Ptr signKey; // these correspond to the initiator's files (if doing barter) - vector ptextA; - vector ctextA; + vector > ptextA; + vector > ctextA; // these correspond to the responder/seller's files - vector ctextB; - vector ptextB; + vector > ctextB; + vector > ptextB; ZZ r; vector endorsement; diff --git a/src/FEMessage.h b/src/FEMessage.h index 16ccaec..f454666 100644 --- a/src/FEMessage.h +++ b/src/FEMessage.h @@ -12,27 +12,28 @@ class FEMessage { /*! constructor: takes in escrow (encryption of the symmetric * key), signature on this escrow, and contract (label for the * escrow) */ - FEMessage(vector &escrow, string &sig, FEContract &contract) + FEMessage(const vector &escrow, + const string &sig, Ptr contract) : escrow(escrow), signature(sig), contract(contract) {} - FEMessage(string &sig, FEContract &contract) + FEMessage(const string &sig, Ptr contract) : signature(sig), contract(contract) {} /*! copy constructor */ FEMessage(const FEMessage &o) : escrow(o.escrow), signature(o.signature), contract(o.contract) {} - FEMessage(const string& s) { loadString(*this, s); }; + FEMessage(const string& s) { loadGZString(*this, s); }; // getters const vector& getEscrow() const { return escrow; } const string& getSignature() const { return signature; } - const FEContract& getContract() const { return contract; } + Ptr getContract() const { return contract; } private: vector escrow; string signature; - FEContract contract; + Ptr contract; friend class boost::serialization::access; template diff --git a/src/FEResolutionMessage.h b/src/FEResolutionMessage.h index 1447ede..14eb59d 100644 --- a/src/FEResolutionMessage.h +++ b/src/FEResolutionMessage.h @@ -11,20 +11,20 @@ class FEResolutionMessage { public: - FEResolutionMessage(FEMessage* m, FESetupMessage* s, + FEResolutionMessage(Ptr m, Ptr s, const vector &k) : message(m), setupMessage(s), keys(k) {} - FEResolutionMessage() : message(0), setupMessage(0) {} + FEResolutionMessage() : message(), setupMessage() {} // getters - FEMessage* getMessage() const { return message; } - FESetupMessage* getSetupMessage() const { return setupMessage; } + Ptr getMessage() const { return message; } + Ptr getSetupMessage() const { return setupMessage; } vector getKeys() const { return keys; } private: - FEMessage* message; - FESetupMessage* setupMessage; + Ptr message; + Ptr setupMessage; vector keys; friend class boost::serialization::access; diff --git a/src/FEResponder.cpp b/src/FEResponder.cpp index 83325cb..d9a4227 100644 --- a/src/FEResponder.cpp +++ b/src/FEResponder.cpp @@ -6,97 +6,79 @@ /*----------------------------------------------------------------------------*/ // Constructors FEResponder::FEResponder(const int timeoutLength, const int timeoutTolerance, - const VEPublicKey* pk, const VEPublicKey* regularpk, + Ptr pk, Ptr regularpk, const int stat) : timeoutLength(timeoutLength), timeoutTolerance(timeoutTolerance), - stat(stat), verifiablePK(pk), regularPK(regularpk), contract(NULL), - escrow(NULL), initiatorSignPK(NULL), exchangeType(TYPE_NONE), - message(NULL) + stat(stat), verifiablePK(pk), regularPK(regularpk), contract(), + escrow(), initiatorSignPK(), exchangeType(TYPE_NONE), + message() { } -FEResponder::FEResponder(const FEResponder& o) - : timeoutLength(o.timeoutLength), timeoutTolerance(o.timeoutTolerance), - stat(o.stat), verifiablePK(o.verifiablePK), regularPK(o.regularPK), - ptextB(o.ptextB), ctextB(o.ctextB), ctextA(o.ctextA), ptextA(o.ptextA), - contract(o.contract ? new FEContract(*o.contract) : NULL), - escrow(o.escrow ? new VECiphertext(*o.escrow) : NULL), - initiatorSignPK(o.initiatorSignPK ? new Signature::Key(*o.initiatorSignPK) : NULL), - message(o.message ? new FEMessage(*o.message) : NULL) -{ -} - /*----------------------------------------------------------------------------*/ // Destructor FEResponder::~FEResponder() { reset(); - delete escrow; - delete initiatorSignPK; } void FEResponder::reset() { exchangeType = TYPE_NONE; - - for (unsigned i = 0; i < ptextA.size(); i++) { - delete ptextA[i]; - } - for (unsigned i = 0; i < ctextB.size(); i++) { - delete ctextB[i]; - } + ctextB.clear(); ctextA.clear(); ptextB.clear(); ptextA.clear(); - delete contract; - delete message; + contract.reset(); + escrow.reset(); + message.reset(); } /*----------------------------------------------------------------------------*/ // Setup -bool FEResponder::setup(const FESetupMessage *msg, const ZZ& R) { +bool FEResponder::setup(Ptr msg, const ZZ& R) { // check escrow msg->check(verifiablePK, stat, R); // set parameters from FESetupMessage coinPrime = msg->getCoinPrime(); escrow = msg->getEscrow(); - initiatorSignPK = new Signature::Key(*msg->getPK()); + initiatorSignPK = new_ptr(*msg->getPK()); return true; } /*----------------------------------------------------------------------------*/ // Start Round -EncBuffer* FEResponder::startRound(const Buffer* ptextR, +Ptr FEResponder::startRound(Ptr ptextR, const cipher_t& encAlgR) { - return startRound(CommonFunctions::vectorize(ptextR), + return startRound(CommonFunctions::vectorize >(ptextR), encAlgR)[0]; } -vector FEResponder::startRound(const vector& ptextR, +vector > FEResponder::startRound(const vector >& ptextR, const cipher_t& encAlgR) { setResponderFiles(ptextR, encrypt(ptextR,encAlgR)); return ctextB; } /*----------------------------------------------------------------------------*/ // Set Responder Files -void FEResponder::setResponderFiles(const Buffer *ptextR, EncBuffer* ctextR) { - setResponderFiles(CommonFunctions::vectorize(ptextR), - CommonFunctions::vectorize(ctextR)); +void FEResponder::setResponderFiles(Ptr ptextR, Ptr ctextR) { + setResponderFiles(CommonFunctions::vectorize >(ptextR), + CommonFunctions::vectorize >(ctextR)); } -void FEResponder::setResponderFiles(const vector& ptextR, - const vector& ctextR) { +void FEResponder::setResponderFiles(const vector >& ptextR, + const vector >& ctextR) { // store values ptextB = ptextR; ctextB = ctextR; } /*----------------------------------------------------------------------------*/ // Encryption -vector FEResponder::encrypt(const vector& ptextR, +vector > FEResponder::encrypt(const vector >& ptextR, const cipher_t& encAlgR) const { string key = Ciphertext::generateKey(encAlgR); - vector ctexts; + vector > ctexts; for (unsigned i = 0; i < ptextR.size(); i++) { ctexts.push_back(ptextR[i]->encrypt(encAlgR, key)); } @@ -119,16 +101,16 @@ vector FEResponder::sell(const FEMessage& message, exchangeType = TYPE_BUY; // check contract and signature - FEContract contract = message.getContract(); - check(message, saveString(contract), ptHashR); + Ptr contract = message.getContract(); + check(message, saveString(*contract), ptHashR); return getKeys(); } bool FEResponder::check(const FEMessage& msg, const string& label, const vector& ptHashRs) { // save message - message = new FEMessage(msg); - contract = new FEContract(msg.getContract()); + message = new_ptr(msg); + contract = msg.getContract(); string sig = msg.getSignature(); // check contract @@ -173,15 +155,15 @@ bool FEResponder::endorseCoin(const vector& endorsement) { /*----------------------------------------------------------------------------*/ // Give Key vector FEResponder::giveKeys(const FEMessage& signedEscrow, - EncBuffer* ctI, const hash_t& ptI, + Ptr ctI, const hash_t& ptI, const hash_t& ptR) { - return giveKeys(signedEscrow, CommonFunctions::vectorize(ctI), + return giveKeys(signedEscrow, CommonFunctions::vectorize >(ctI), CommonFunctions::vectorize(ptI), CommonFunctions::vectorize(ptR)); } vector FEResponder::giveKeys(const FEMessage& signedEscrow, - const vector& ctextI, + const vector >& ctextI, const vector& ptHashIs, const vector& ptHashRs) { if (TYPE_NONE != exchangeType) @@ -230,7 +212,7 @@ bool FEResponder::checkKey(const vector& keysI) { for (unsigned i = 0; i < ctextA.size(); i++) { unsigned index = (keysI.size() == 1) ? 0 : i; - Buffer* ptext = ctextA[i]->decrypt(keysI[index], contract->getEncAlgA()); + Ptr ptext = ctextA[i]->decrypt(keysI[index], contract->getEncAlgA()); ptextA.push_back(ptext); } const hash_t& pt = contract->getPTHashA(); @@ -240,12 +222,12 @@ bool FEResponder::checkKey(const vector& keysI) { /*----------------------------------------------------------------------------*/ // Resolutions -FEResolutionMessage* FEResponder::resolveI(){ - return new FEResolutionMessage(getMessage(), getSetupMessage(), getKeys()); +Ptr FEResponder::resolveI(){ + return new_ptr(getMessage(), getSetupMessage(), getKeys()); } -MerkleProof* FEResponder::resolveII(vector &challenges){ - vector ctextBlocks; +Ptr FEResponder::resolveII(vector &challenges){ + vector > ctextBlocks; //prove the ciphertext blocks for(unsigned i = 0; i < challenges.size(); i++){ ctextBlocks.push_back(ctextB[challenges[i]]); @@ -261,20 +243,20 @@ MerkleProof* FEResponder::resolveII(vector &challenges){ MerkleContract ptContract(pt.key, pt.alg); MerkleProver ptProver = MerkleProver(ptextB, ptContract); hash_matrix ptProofs = ptProver.generateProofs(challenges); - return new MerkleProof(ctextBlocks, ctProofs, ptProofs, - new MerkleContract(ctContract), - new MerkleContract(ptContract)); + return new_ptr(ctextBlocks, ctProofs, ptProofs, + new_ptr(ctContract), + new_ptr(ptContract)); } else { - return new MerkleProof(ctextBlocks, ctProofs, ptextB[0]->str(), - new MerkleContract(ctContract)); + return new_ptr(ctextBlocks, ctProofs, ptextB[0]->str(), + new_ptr(ctContract)); } } -MerkleProof* FEResponder::resolveIII(vector &keys){ +Ptr FEResponder::resolveIII(vector &keys){ if(checkKey(keys)){ // XXX: not really sure what I should be returning if they do check // out as additional communication with the Arbiter is not needed - return new MerkleProof; + return new_ptr(); } else{ return proveIncorrectKeys(keys); } @@ -284,7 +266,7 @@ bool FEResponder::resolveIV(vector &endorsement){ return endorseCoin(endorsement); } -MerkleProof* FEResponder::proveIncorrectKeys(const vector &keys) { +Ptr FEResponder::proveIncorrectKeys(const vector &keys) { // make sure we are in barter if (exchangeType != TYPE_BARTER) { throw CashException(CashException::CE_FE_ERROR, @@ -296,7 +278,7 @@ MerkleProof* FEResponder::proveIncorrectKeys(const vector &keys) { // if the key is wrong, this will be wrong with high probability vector challenges; challenges.push_back(0); - vector ctextBlock; + vector > ctextBlock; ctextBlock.push_back(ctextA[0]); const hash_t& ct = contract->getCTHashA(); MerkleContract ctContract(ct.key, ct.alg); @@ -307,16 +289,16 @@ MerkleProof* FEResponder::proveIncorrectKeys(const vector &keys) { MerkleContract ptContract(pt.key, pt.alg); MerkleProver ptProver = MerkleProver(ptextB, ptContract); hash_matrix ptProofs = ptProver.generateProofs(challenges); - return new MerkleProof(ctextBlock, ctProofs, ptProofs, - new MerkleContract(ctContract), - new MerkleContract(ptContract)); + return new_ptr(ctextBlock, ctProofs, ptProofs, + new_ptr(ctContract), + new_ptr(ptContract)); } else { - return new MerkleProof(ctextBlock, ctProofs, ptextB[0]->str(), - new MerkleContract(ctContract)); + return new_ptr(ctextBlock, ctProofs, ptextB[0]->str(), + new_ptr(ctContract)); } } -FESetupMessage* FEResponder::getSetupMessage() const { - return new FESetupMessage(coinPrime, escrow, *initiatorSignPK); +Ptr FEResponder::getSetupMessage() const { + return new_ptr(coinPrime, escrow, *initiatorSignPK); } diff --git a/src/FEResponder.h b/src/FEResponder.h index 7fcd157..8c240c3 100644 --- a/src/FEResponder.h +++ b/src/FEResponder.h @@ -19,28 +19,25 @@ class FEResponder { /*! constructor takes in various parameters and the public key of * the arbiter */ FEResponder(const int timeoutLength, const int timeoutTolerance, - const VEPublicKey* pk, const VEPublicKey* repk, + Ptr pk, Ptr repk, const int stat); - /*! copy constructor */ - FEResponder(const FEResponder &o); - /*! destructor */ ~FEResponder(); /*! check a setup message received from FEInitiator */ - bool setup(const FESetupMessage* setup, const ZZ& R); + bool setup(Ptr setup, const ZZ& R); /*! encrypt and start the next round (including first round) */ - EncBuffer* startRound(const Buffer* ptextR, const cipher_t& encAlgR); - vector startRound(const vector& ptextR, + Ptr startRound(Ptr ptextR, const cipher_t& encAlgR); + vector > startRound(const vector >& ptextR, const cipher_t& encAlgR); /*! set responder files (only for BT client use) */ - void setResponderFiles(const Buffer* ptextR, EncBuffer* ctextR); + void setResponderFiles(Ptr ptextR, Ptr ctextR); - void setResponderFiles(const vector& ptextR, - const vector& ctextR); + void setResponderFiles(const vector >& ptextR, + const vector >& ctextR); // the following should be used for sell only /*! if the contract is formed correctly and the signature on the @@ -59,11 +56,11 @@ class FEResponder { /*! if the contract is correctly and the signature on the escrow * verifies, return the decryption key */ vector giveKeys(const FEMessage& signedEscrow, - EncBuffer* ctextI, const hash_t& ptHashI, + Ptr ctextI, const hash_t& ptHashI, const hash_t& ptHashR); vector giveKeys(const FEMessage& signedEscrow, - const vector& ctextI, + const vector >& ctextI, const vector& ptHashI, const vector& ptHashR); @@ -73,15 +70,15 @@ class FEResponder { bool checkKey(const vector& keysI); /*! Send a request to the arbiter to resolve*/ - FEResolutionMessage* resolveI(); + Ptr resolveI(); /*! Send proofs that you know the plaintext of the blocks * indicated by the challengs to the Arbiter */ - MerkleProof* resolveII(vector &challenges); + Ptr resolveII(vector &challenges); /*! Check that the keys sent by the Arbiter enable you to decrypt * the Initiator's ciphertext. If they don't, send a proof of this */ - MerkleProof* resolveIII(vector &keys); + Ptr resolveIII(vector &keys); /*! If the proof of the initiator's keys not decrypting the * ciphertext correctly is valid @@ -90,11 +87,11 @@ class FEResponder { bool resolveIV(vector &endorsement); // getters - const vector& getPtextA() const { return ptextA; } + const vector >& getPtextA() const { return ptextA; } const Coin& getCoinPrime() const { return coinPrime; } // these are only needed for testing - FESetupMessage* getSetupMessage() const; - FEMessage* getMessage() const { return message; } + Ptr getSetupMessage() const; + Ptr getMessage() const { return message; } bool canAbortLocally() {return TYPE_NONE == exchangeType;} @@ -103,15 +100,15 @@ class FEResponder { void setTimeoutTolerance(const int newtimeoutTolerance) {timeoutTolerance = newtimeoutTolerance;} void setSecurity(const int newstat) {stat = newstat;} - void setVerifiablePublicKey(const VEPublicKey* newpk) + void setVerifiablePublicKey(Ptr newpk) {verifiablePK = newpk;} - void setRegularPublicKey(const VEPublicKey* newpk) {regularPK = newpk;} + void setRegularPublicKey(Ptr newpk) {regularPK = newpk;} void reset(); protected: - vector encrypt(const vector& ptextR, - const cipher_t& encAlgR) const; + vector > encrypt(const vector >& ptextR, + const cipher_t& encAlgR) const; bool check(const FEMessage& message, const string& label, const vector& ptHashR); @@ -119,28 +116,28 @@ class FEResponder { vector getKeys() const; /*! Prove the initiator's keys are not correct for the ciphertext */ - MerkleProof* proveIncorrectKeys(const vector &keys); + Ptr proveIncorrectKeys(const vector &keys); private: int timeoutLength; int timeoutTolerance; int timeout; int stat; - const VEPublicKey* verifiablePK; - const VEPublicKey* regularPK; + Ptr verifiablePK; + Ptr regularPK; - vector ptextB; - vector ctextB; - vector ctextA; - vector ptextA; + vector > ptextB; + vector > ctextB; + vector > ctextA; // const? + vector > ptextA; Coin coinPrime; - FEContract* contract; - VECiphertext* escrow; - Signature::Key* initiatorSignPK; + Ptr contract; + Ptr escrow; + Ptr initiatorSignPK; // 0 is buy, 1 is barter int exchangeType; - FEMessage* message; + Ptr message; }; #endif /*_FERESPONDER_H_*/ diff --git a/src/FESetupMessage.cpp b/src/FESetupMessage.cpp index 9ba3bcc..8c8cedf 100644 --- a/src/FESetupMessage.cpp +++ b/src/FESetupMessage.cpp @@ -2,7 +2,7 @@ #include "FESetupMessage.h" #include "VEVerifier.h" -bool FESetupMessage::check(const VEPublicKey* pk, const int stat, +bool FESetupMessage::check(Ptr pk, const int stat, const ZZ& R) const { // check coin if (!coinPrime.verifyCoin() || coinPrime.getR() != R) diff --git a/src/FESetupMessage.h b/src/FESetupMessage.h index 8ef8757..50ee78b 100644 --- a/src/FESetupMessage.h +++ b/src/FESetupMessage.h @@ -17,36 +17,33 @@ class FESetupMessage { * the endorsement for the coin), and the public key * for the initiator's signature scheme (label for the * verifiable escrow) */ - FESetupMessage(const Coin &coinPrime, VECiphertext* escrow, + FESetupMessage(const Coin &coinPrime, Ptr escrow, const Signature::Key &signPK) : coinPrime(coinPrime), escrow(escrow), signPK(signPK.getPublicKey()) {} /*! copy constructor */ FESetupMessage(const FESetupMessage &o) : coinPrime(o.coinPrime), escrow(o.escrow), - signPK(new Signature::Key(*o.signPK)) {} + signPK(new_ptr(*o.signPK)) {} - /*! destructor */ - ~FESetupMessage() { delete signPK; } - - FESetupMessage(const string& s, const BankParameters *params) { + FESetupMessage(const string& s, Ptr params) { // need to set params for Coin contained in message loadGZString(make_nvp("FESetupMessage", *this), s); coinPrime.setParameters(params); } /*! check contents (verify coin and escrow) */ - bool check(const VEPublicKey* pk, const int stat, const ZZ& R) const; + bool check(Ptr pk, const int stat, const ZZ& R) const; /*! getters for coin', escrow, and signature PK */ Coin getCoinPrime() const { return coinPrime; } - VECiphertext* getEscrow() const { return escrow; } - const Signature::Key* getPK() const { return signPK; } + Ptr getEscrow() const { return escrow; } + Ptr getPK() const { return signPK; } private: Coin coinPrime; - VECiphertext* escrow; - Signature::Key* signPK; + Ptr escrow; + Ptr signPK; friend class boost::serialization::access; template diff --git a/src/Group.h b/src/Group.h index 7cb9a0b..472f381 100644 --- a/src/Group.h +++ b/src/Group.h @@ -82,7 +82,7 @@ class Group { virtual bool isGenerator(const ZZ &value) const = 0; /*! Returns a copy of the group. */ - Group* copy() const; + Ptr copy() const; /*! Debugging code. */ virtual void debug() const = 0; diff --git a/src/GroupRSA.h b/src/GroupRSA.h index 7ca9034..a80f649 100644 --- a/src/GroupRSA.h +++ b/src/GroupRSA.h @@ -17,7 +17,7 @@ class GroupRSA : public Group { GroupRSA(const string &owner, int modulusLength, int stat); - GroupRSA(const string &owner, ZZ &modulus, int s) + GroupRSA(const string &owner, const ZZ& modulus, int s) : Group(owner, modulus), stat(s) {} GroupRSA() : Group(), p(0), q(0), stat(0) {} diff --git a/src/Hash.cpp b/src/Hash.cpp index c628db4..f47bbd8 100644 --- a/src/Hash.cpp +++ b/src/Hash.cpp @@ -214,7 +214,7 @@ hash_t HmacFunction::hash(const string& left, const string& right) const /* used by FEContract, FEInitiator, FEResponder, etc */ -hash_t Hash::hash(const vector& buf, const hashalg_t& alg, +hash_t Hash::hash(const vector >& buf, const hashalg_t& alg, const string &key, const int hashType) { vector hash; @@ -225,7 +225,7 @@ hash_t Hash::hash(const vector& buf, const hashalg_t& alg, return Hash::hash(hash, alg, key, hashType); } -hash_t Hash::hash(const vector& buf, const hashalg_t& alg, +hash_t Hash::hash(const vector >& buf, const hashalg_t& alg, const string &key, const int hashType) { vector hash; @@ -236,7 +236,7 @@ hash_t Hash::hash(const vector& buf, const hashalg_t& alg, return Hash::hash(hash, alg, key, hashType); } -hash_t Hash::hash(const vector& buf, const hashalg_t& alg, +hash_t Hash::hash(const vector >& buf, const hashalg_t& alg, const string &key, const int hashType) { vector hash; @@ -247,7 +247,7 @@ hash_t Hash::hash(const vector& buf, const hashalg_t& alg, return Hash::hash(hash, alg, key, hashType); } -hash_t Hash::hash(const vector& buf, const hashalg_t& alg, +hash_t Hash::hash(const vector >& buf, const hashalg_t& alg, const string &key, const int hashType) { vector hash; diff --git a/src/Hash.h b/src/Hash.h index cdb7fc2..caec0ab 100644 --- a/src/Hash.h +++ b/src/Hash.h @@ -108,13 +108,13 @@ class Hash { const alg_t alg, const string& key, size_t& chunksz_out); /* Used by FEContract for contract-checking */ - static hash_t hash(const vector& buf, const alg_t& alg, + static hash_t hash(const vector >& buf, const alg_t& alg, const string &key, const int hashType); - static hash_t hash(const vector& buf, const alg_t& alg, + static hash_t hash(const vector >& buf, const alg_t& alg, const string &key, const int hashType); - static hash_t hash(const vector& buf, const alg_t& alg, + static hash_t hash(const vector >& buf, const alg_t& alg, const string &key, const int hashType); - static hash_t hash(const vector& buf, const alg_t& alg, + static hash_t hash(const vector >& buf, const alg_t& alg, const string &key, const int hashType); static hash_t hash(const vector& hashes, const alg_t& alg, const string &key, const int hashType); diff --git a/src/Makefile b/src/Makefile index 704de3a..3d78312 100644 --- a/src/Makefile +++ b/src/Makefile @@ -58,6 +58,7 @@ CASHSOURCE = Arbiter.cpp \ ZKP/ExponentSub.cpp \ ZKP/ForExpander.cpp \ ZKP/Interpreter.cpp \ + ZKP/InterpreterCache.cpp \ ZKP/InterpreterProver.cpp \ ZKP/InterpreterVerifier.cpp \ ZKP/Printer.cpp \ diff --git a/src/MerkleContract.h b/src/MerkleContract.h index 9f43240..d5e69d5 100644 --- a/src/MerkleContract.h +++ b/src/MerkleContract.h @@ -33,6 +33,11 @@ class MerkleContract { hash_t hash(T* buff) const { return hash(buff->data(), buff->size()); } + + template + hash_t hash(Ptr buff) const { + return hash(buff->data(), buff->size()); + } hash_t hash(const string& str) const { return hash(str.data(), str.size()); diff --git a/src/MerkleProof.cpp b/src/MerkleProof.cpp index cacaef8..167009b 100644 --- a/src/MerkleProof.cpp +++ b/src/MerkleProof.cpp @@ -1,11 +1,11 @@ #include "MerkleProof.h" -MerkleProof::MerkleProof(const vector &ctextBlocks, +MerkleProof::MerkleProof(const vector > &ctextBlocks, const hash_matrix &ctextProof, const hash_matrix &fileProof, - MerkleContract* ctContract, - MerkleContract* ptContract) + Ptr ctContract, + Ptr ptContract) : ctextBlocks(ctextBlocks), ctextProof(ctextProof), fileProof(fileProof), ctContract(ctContract), ptContract(ptContract) { @@ -13,15 +13,15 @@ MerkleProof::MerkleProof(const vector &ctextBlocks, empty=false; } -MerkleProof::MerkleProof(const vector &ctextBlocks, +MerkleProof::MerkleProof(const vector > &ctextBlocks, const hash_matrix &ctextProof, - const string &plaintext, MerkleContract* ctContract) + const string &plaintext, Ptr ctContract) : ctextBlocks(ctextBlocks), ctextProof(ctextProof), plaintext(plaintext), ctContract(ctContract) {empty=false;} -MerkleProof::MerkleProof(const vector &ctextBlocks, +MerkleProof::MerkleProof(const vector > &ctextBlocks, const hash_matrix &ctextProof, - MerkleContract* ctContract) + Ptr ctContract) : ctextBlocks(ctextBlocks), ctextProof(ctextProof), ctContract(ctContract) { } diff --git a/src/MerkleProof.h b/src/MerkleProof.h index c973eaf..27e3cde 100644 --- a/src/MerkleProof.h +++ b/src/MerkleProof.h @@ -8,43 +8,43 @@ class MerkleProof { public: - MerkleProof() : ctContract(0), ptContract(0) {empty=true;} + MerkleProof() : ctContract(), ptContract() {empty=true;} /*! ctextBlocks represent the blocks of the ciphertext that we are * proving are correct; ctextProof is the proof that the Merkle hash * of the ciphertext was formed correctly; fileProof is the proof * that the Merkle hash of the plaintext was formed correctly * the contracts store the hashalg and key */ - MerkleProof(const vector &ctextBlocks, + MerkleProof(const vector > &ctextBlocks, const hash_matrix &ctextProof, const hash_matrix &fileProof, - MerkleContract* ctContract, MerkleContract* ptContract); + Ptr ctContract, Ptr ptContract); - MerkleProof(const vector &ctextBlocks, + MerkleProof(const vector > &ctextBlocks, const hash_matrix &ctextProof, const string &plaintext, - MerkleContract* ctContract); + Ptr ctContract); - MerkleProof(const vector &ctextBlocks, - const hash_matrix &ctextProof, MerkleContract* ctContract); + MerkleProof(const vector > &ctextBlocks, + const hash_matrix &ctextProof, Ptr ctContract); MerkleProof(const MerkleProof &o); // getters - vector getCTextBlocks() const { return ctextBlocks; } + vector > getCTextBlocks() const { return ctextBlocks; } hash_matrix getCTextProof() const { return ctextProof; } hash_matrix getPTextProof() const { return fileProof; } string getPlaintext() const { return plaintext; } - MerkleContract* getPTContract() const { return ptContract; } - MerkleContract* getCTContract() const { return ctContract; } + Ptr getPTContract() const { return ptContract; } + Ptr getCTContract() const { return ctContract; } bool isEmpty() const { return empty; } private: - vector ctextBlocks; + vector > ctextBlocks; hash_matrix ctextProof; hash_matrix fileProof; string plaintext; - MerkleContract* ctContract; - MerkleContract* ptContract; + Ptr ctContract; + Ptr ptContract; bool empty; friend class boost::serialization::access; diff --git a/src/MerkleProver.cpp b/src/MerkleProver.cpp index bafd5f4..d3bcea0 100644 --- a/src/MerkleProver.cpp +++ b/src/MerkleProver.cpp @@ -4,12 +4,12 @@ MerkleProver::MerkleProver(const vector &hashBlocks, const MerkleContract &contract) : contract(contract) { - tree = new MerkleTree(hashBlocks, contract); + tree = new_ptr(hashBlocks, contract); } MerkleProver::MerkleProver(const char* buff, int buffSize, const MerkleContract& contract) - : contract(contract), tree(0) + : contract(contract), tree() { init(buff, buffSize); } @@ -21,7 +21,7 @@ MerkleProver::MerkleProver(const string &str, const MerkleContract &contract) init(str.data(), str.size()); } -MerkleProver::MerkleProver(const vector &encBuffs, +MerkleProver::MerkleProver(const vector > &encBuffs, const MerkleContract &contract) : contract(contract) { @@ -29,10 +29,10 @@ MerkleProver::MerkleProver(const vector &encBuffs, for(unsigned x=0; x(hashBlocks, contract); } -MerkleProver::MerkleProver(const vector& buffs, +MerkleProver::MerkleProver(const vector >& buffs, const MerkleContract &contract) : contract(contract) { @@ -40,7 +40,7 @@ MerkleProver::MerkleProver(const vector& buffs, for(unsigned x=0; x(hashBlocks, contract); } hash_matrix MerkleProver::generateProofs(const vector &challenges){ hash_matrix toReturn; @@ -97,7 +97,7 @@ hash_t MerkleProver::computeSubTree(unsigned index, vector &m_tree){ void MerkleProver::init(const char* buff, int buffSize){ - tree = new MerkleTree(buff, buffSize, contract); + tree = new_ptr(buff, buffSize, contract); } diff --git a/src/MerkleProver.h b/src/MerkleProver.h index de39a44..23887b3 100644 --- a/src/MerkleProver.h +++ b/src/MerkleProver.h @@ -6,10 +6,10 @@ class MerkleProver { public: - MerkleProver(const vector &encBuffs, + MerkleProver(const vector > &encBuffs, const MerkleContract &contract); - MerkleProver(const vector &buffs, + MerkleProver(const vector > &buffs, const MerkleContract &contract); MerkleProver(const string &str, const MerkleContract &contract); @@ -34,7 +34,7 @@ class MerkleProver { hash_t computeSubTree(unsigned index, vector &m_tree); MerkleContract contract; - MerkleTree* tree; + Ptr tree; }; diff --git a/src/NTL/ZZ.h b/src/NTL/ZZ.h index 4248cc0..28be4f6 100644 --- a/src/NTL/ZZ.h +++ b/src/NTL/ZZ.h @@ -204,14 +204,14 @@ inline void BytesFromZZ(unsigned char *p, const ZZ& a, long n) { } // Convert binary string to NTL integer -inline ZZ ZZFromBytes(const string &str) { +inline ZZ ZZFromBytes(const std::string &str) { return ZZFromBytes((const unsigned char *)str.data(), str.size()); } -inline string ZZToBytes(const ZZ& n) { +inline std::string ZZToBytes(const ZZ& n) { unsigned char buf[NumBytes(n)]; BytesFromZZ((unsigned char *)&buf, n, sizeof(buf)); - return string((char *)&buf, sizeof(buf)); + return std::string((char *)&buf, sizeof(buf)); } } // namespace NTL @@ -228,6 +228,7 @@ namespace boost { namespace serialization { bool neg = (NTL::sign(t) == -1); ar & auto_nvp(neg); // save sign (true if negative) size_t len = (mpz_sizeinbase(MPZ(t), 2) + 7) / 8; + if (t == 0) len = 0; assert(len >= 0); ar & auto_nvp(len); if (len) { @@ -257,6 +258,8 @@ namespace boost { namespace serialization { ar & make_nvp("mpz", make_binary_object(buf, len)); mpz_import(MPZ(t), len, -1, 1, -1, 0, buf); if (neg) mpz_neg(MPZ(t), MPZ(t)); + } else { + t = 0; } } diff --git a/src/ProgramMaker.h b/src/ProgramMaker.h index 65d9708..31ee0f8 100644 --- a/src/ProgramMaker.h +++ b/src/ProgramMaker.h @@ -7,7 +7,7 @@ // the following are useful for CLBlindRecipient and CLSignatureProver // for groups, need access to group object and names of generators -typedef pair > group_pair; +typedef pair, vector > group_pair; typedef boost::unordered_map gen_group_map; // for commitments, we'll assume that value being committed to is called diff --git a/src/Seller.cpp b/src/Seller.cpp index 2033e7f..25879aa 100644 --- a/src/Seller.cpp +++ b/src/Seller.cpp @@ -8,68 +8,52 @@ /*----------------------------------------------------------------------------*/ // Constructors Seller::Seller(const int timeoutLength, const int timeoutTolerance, - const VEPublicKey* pk, const int stat) + Ptr pk, const int stat) : timeoutLength(timeoutLength), timeoutTolerance(timeoutTolerance), - stat(stat), pk(pk), contract(NULL), escrow(NULL), inProgress(false) + stat(stat), pk(pk), contract(), escrow(), inProgress(false) { } -Seller::Seller(EncBuffer* ct, const int timeoutLength, - const int timeoutTolerance, const VEPublicKey* pk, +Seller::Seller(Ptr ct, const int timeoutLength, + const int timeoutTolerance, Ptr pk, const int stat) : timeoutLength(timeoutLength), timeoutTolerance(timeoutTolerance), - stat(stat), pk(pk), contract(NULL), escrow(NULL), inProgress(false) + stat(stat), pk(pk), contract(), escrow(), inProgress(false) { ctext.push_back(ct); } -Seller::Seller(vector ctext, const int timeoutLength, - const int timeoutTolerance, const VEPublicKey* pk, +Seller::Seller(vector > ctext, const int timeoutLength, + const int timeoutTolerance, Ptr pk, const int stat) : timeoutLength(timeoutLength), timeoutTolerance(timeoutTolerance), - stat(stat), pk(pk), ctext(ctext), contract(NULL), escrow(NULL), + stat(stat), pk(pk), ctext(ctext), contract(), escrow(), inProgress(false) { } -Seller::Seller(const Seller& o) - : timeoutLength(o.timeoutLength), timeoutTolerance(o.timeoutTolerance), - stat(o.stat), pk(o.pk), ptext(o.ptext), ctext(o.ctext), - coinPrime(o.coinPrime), - contract(o.contract ? new FEContract(*o.contract) : NULL), - escrow(o.escrow ? new VECiphertext(*o.escrow) : NULL), - inProgress(o.inProgress) -{ -} - /*----------------------------------------------------------------------------*/ -// Destructor -Seller::~Seller() { - reset(); -} void Seller::reset() { inProgress = false; - //delete escrow; - for (unsigned i = 0; i < ctext.size(); i++) { - delete ctext[i]; - } - //delete contract; + ctext.clear(); + escrow.reset(); + contract.reset(); } /*----------------------------------------------------------------------------*/ // Encryption -EncBuffer* Seller::encrypt(const Buffer* pt, const cipher_t& encAlg, +Ptr Seller::encrypt(Ptr pt, const cipher_t& encAlg, const string& key) { ptext.push_back(pt); // now encrypt each block in fileBlocks using K - EncBuffer* ct = pt->encrypt(encAlg, key); + Ptr ct = pt->encrypt(encAlg, key); ctext.push_back(ct); // return outcome of this encryption return ct; } -vector Seller::encrypt(const vector& ptext, +vector > Seller::encrypt(const vector >& ptext, const cipher_t& encAlg) { string commonKey = Ciphertext::generateKey(encAlg); for (unsigned i = 0; i < ptext.size(); i++) { @@ -78,26 +62,26 @@ vector Seller::encrypt(const vector& ptext, return ctext; } -void Seller::setFiles(const Buffer* ptext, EncBuffer* ctext) { - setFiles(CommonFunctions::vectorize(ptext), - CommonFunctions::vectorize(ctext)); +void Seller::setFiles(Ptr ptext, Ptr ctext) { + setFiles(CommonFunctions::vectorize >(ptext), + CommonFunctions::vectorize >(ctext)); } -void Seller::setFiles(const vector& pt, - const vector& ct) { +void Seller::setFiles(const vector >& pt, + const vector >& ct) { ptext = pt; ctext = ct; } /*----------------------------------------------------------------------------*/ // Selling -vector Seller::sell(const BuyMessage* buyerInput, const ZZ& R, +vector Seller::sell(Ptr buyerInput, const ZZ& R, const hash_t& ptHash){ return sell(buyerInput, R, CommonFunctions::vectorize(ptHash)); } -vector Seller::sell(const BuyMessage* buyerInput, const ZZ& R, +vector Seller::sell(Ptr buyerInput, const ZZ& R, const vector& ptHashes) { if (inProgress) throw CashException(CashException::CE_FE_ERROR, @@ -123,7 +107,7 @@ vector Seller::sell(const BuyMessage* buyerInput, const ZZ& R, return keys; } -bool Seller::check(const BuyMessage* buyerInput, const ZZ& R, +bool Seller::check(Ptr buyerInput, const ZZ& R, const vector& ptHashes) { // check message buyerInput->check(pk, stat, R); @@ -132,6 +116,12 @@ bool Seller::check(const BuyMessage* buyerInput, const ZZ& R, contract = buyerInput->getContract(); contract->checkTimeout(timeoutTolerance); contract->checkEncAlgB(ctext[0]->encAlg); +#ifdef DOUBLE_CHECK + hash_t ptHashReal = Hash::hash(ptext, contract->getPTHashB().alg, + contract->getPTHashB().key, + contract->getPTHashB().type); + assert(ptHashReal == contract->getPTHashB()); +#endif hash_t ptHash = Hash::hash(ptHashes, contract->getPTHashB().alg, contract->getPTHashB().key, contract->getPTHashB().type); @@ -150,16 +140,16 @@ bool Seller::check(const BuyMessage* buyerInput, const ZZ& R, // Resolution //send keys and buy message to the Arbiter so they can begin resolution -pair, BuyMessage*> Seller::resolveI() { +pair, Ptr > Seller::resolveI() { vector keys(ctext.size()); for(unsigned i = 0; i < ctext.size(); i++){ keys[i] = ctext[i]->key; } - return make_pair, BuyMessage*>(keys, getBuyMessage()); + return make_pair, Ptr >(keys, getBuyMessage()); } -MerkleProof* Seller::resolveII(vector &challenges){ - vector ctextBlocks; +Ptr Seller::resolveII(vector &challenges){ + vector > ctextBlocks; // send the required ciphertext blocks for(unsigned i = 0; i < challenges.size(); i++){ ctextBlocks.push_back(ctext[challenges[i]]); @@ -167,26 +157,26 @@ MerkleProof* Seller::resolveII(vector &challenges){ //create and send the proofs as well const hash_t& ct = contract->getCTHashB(); - MerkleContract* ctContract = new MerkleContract(ct.key, ct.alg); + Ptr ctContract = new_ptr(ct.key, ct.alg); MerkleProver ctProver(ctext, *ctContract); vector > ctProofs = ctProver.generateProofs(challenges); if(ct.type == Hash::TYPE_MERKLE){ const hash_t& pt = contract->getPTHashB(); - MerkleContract* ptContract = new MerkleContract(pt.key, pt.alg); + Ptr ptContract = new_ptr(pt.key, pt.alg); MerkleProver ptProver(ptext, *ptContract); vector > ptProofs = ptProver.generateProofs(challenges); - return new MerkleProof(ctextBlocks, ctProofs, ptProofs, + return new_ptr(ctextBlocks, ctProofs, ptProofs, ctContract, ptContract); } else { - return new MerkleProof(ctextBlocks, ctProofs, ptext[0]->str(), ctContract); + return new_ptr(ctextBlocks, ctProofs, ptext[0]->str(), ctContract); } } -BuyMessage* Seller::getBuyMessage() const { - return new BuyMessage(coinPrime, contract, escrow); +Ptr Seller::getBuyMessage() const { + return new_ptr(coinPrime, contract, escrow); } bool Seller::endorseCoin(const vector &endorsement) { - return coinPrime.endorse(endorsement); + return coinPrime->endorse(endorsement); } diff --git a/src/Seller.h b/src/Seller.h index 938afc9..f167daf 100644 --- a/src/Seller.h +++ b/src/Seller.h @@ -12,34 +12,28 @@ class Seller { /*! constructor takes in various parameters and the arbiter's * public key */ Seller(const int timeoutLength, const int timeoutTolerance, - const VEPublicKey* pk, const int stat); + Ptr pk, const int stat); /*! constructor for when ctext has already been encrypted: * ctext containing key and encAlg: will be freed by Seller */ - Seller(EncBuffer* ctext, const int timeout, const int timeoutTolerance, - const VEPublicKey* pk, const int stat); + Seller(Ptr ctext, const int timeout, const int timeoutTolerance, + Ptr pk, const int stat); - Seller(vector ctext, const int timeout, - const int timeoutTolerance, const VEPublicKey* pk, + Seller(vector > ctext, const int timeout, + const int timeoutTolerance, Ptr pk, const int stat); - /*! copy constructor */ - Seller(const Seller &o); - - /*! destructor */ - ~Seller(); - /*! outputs the ciphertext of the file */ - EncBuffer* encrypt(const Buffer* ptext, const cipher_t& encAlg, + Ptr encrypt(Ptr ptext, const cipher_t& encAlg, const string& key = ""); - vector encrypt(const vector& ptext, + vector > encrypt(const vector >& ptext, const cipher_t& encAlgs); /*! For BT client use only (if encrypt is not called) */ - void setFiles(const Buffer* ptext, EncBuffer* ctext); - void setFiles(const vector& ptext, - const vector& ctext); + void setFiles(Ptr ptext, Ptr ctext); + void setFiles(const vector >& ptext, + const vector >& ctext); /*! if the message from the buyer is formed correctly, meaning * the contract is correctly formed (matches seller's knowledge), @@ -47,9 +41,9 @@ class Seller { * by the seller), * and the verifiable escrow of the endorsement verifies, * then return the decryption key */ - vector sell(const BuyMessage* buyerInput, const ZZ& R, + vector sell(Ptr buyerInput, const ZZ& R, const hash_t& ptHash); - vector sell(const BuyMessage* buyerInput, const ZZ& R, + vector sell(Ptr buyerInput, const ZZ& R, const vector& ptHashes); /*! Endorse the coin previously obtained in this exchange using @@ -58,14 +52,14 @@ class Seller { bool endorseCoin(const vector &endorsement); /*! Send the information required for resolution to the Arbiter */ - pair, BuyMessage*> resolveI(); + pair, Ptr > resolveI(); /* Prove knowledge to the Arbiter of the challenged blocks*/ - MerkleProof* resolveII(vector &challenges); + Ptr resolveII(vector &challenges); // getters - const Coin* getCoin() const { return new Coin(coinPrime); }; - BuyMessage* getBuyMessage() const; + Ptr getCoin() const { return coinPrime; }; + Ptr getBuyMessage() const; // setters void setTimeoutLength(const int newLength) @@ -73,29 +67,29 @@ class Seller { void setTimeoutTolerance(const int newtimeoutTolerance) {timeoutTolerance = newtimeoutTolerance;} void setSecurity(const int newstat) {stat = newstat;} - void setVEPublicKey(const VEPublicKey* newpk) {pk = newpk;} + void setVEPublicKey(Ptr newpk) {pk = newpk;} bool canAbortLocally() const {return !inProgress;}; void reset(); protected: - bool check(const BuyMessage* buyerInput, const ZZ& R, + bool check(Ptr buyerInput, const ZZ& R, const vector& ptHashes); private: int timeoutLength; int timeoutTolerance; int stat; - const VEPublicKey* pk; + Ptr pk; // Seller has encrypted ptext and sent ctext to Buyer - vector ptext; + vector > ptext; // Seller will exchange ctext->key for Buyer's coin - vector ctext; + vector > ctext; - Coin coinPrime; - FEContract* contract; - VECiphertext* escrow; + Ptr coinPrime; + Ptr contract; + Ptr escrow; bool inProgress; }; diff --git a/src/Serialize.h b/src/Serialize.h index c9672f4..8041284 100644 --- a/src/Serialize.h +++ b/src/Serialize.h @@ -24,6 +24,7 @@ #include #include #include +#include "new_ptr.hpp" #include "Serialize_map.h" /* NVP stands for "name-value pair" and is used for naming variables diff --git a/src/Serialize_map.h b/src/Serialize_map.h index 704826c..48938ec 100644 --- a/src/Serialize_map.h +++ b/src/Serialize_map.h @@ -1,103 +1,120 @@ -/* serialization of unordered_map and unordered_multimap, based on - * http://lists.boost.org/Archives/boost/2007/12/131283.php by René Bürgel */ +// from http://code.google.com/p/ntest/source/browse/unordered_map_serialization.h +// via http://stackoverflow.com/questions/4287299/boostserialization-of-boostunordered-map +#ifndef BOOST_SERIALIZATION_UNORDEREDMAP_HPP +#define BOOST_SERIALIZATION_UNORDEREDMAP_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// serialization/map.hpp: +// serialization for stl map templates + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org for updates, documentation, and revision history. + #include + #include + #include #include #include #include + namespace boost { namespace serialization { -template + +template inline void save( - Archive & ar, - const boost::unordered_map &t, - const unsigned int /* file_version */ + Archive & ar, + const boost::unordered_map &t, + const unsigned int /* file_version */ ){ - boost::serialization::stl::save_collection< - Archive, - boost::unordered_map ->(ar, t); -} -template + boost::serialization::stl::save_collection< + Archive, + boost::unordered_map + >(ar, t); +} + +template inline void load( - Archive & ar, - boost::unordered_map &t, - const unsigned int /* file_version */ + Archive & ar, + boost::unordered_map &t, + const unsigned int /* file_version */ ){ - boost::serialization::stl::load_collection< - Archive, - boost::unordered_map, - boost::serialization::stl::archive_input_map< - Archive, boost::unordered_map >, - -boost::serialization::stl::no_reserve_imp -> ->(ar, t); + boost::serialization::stl::load_collection< + Archive, + boost::unordered_map, + boost::serialization::stl::archive_input_map< + Archive, boost::unordered_map >, + boost::serialization::stl::no_reserve_imp + > + >(ar, t); } + // split non-intrusive serialization function member into separate // non intrusive save/load member functions -template +template inline void serialize( - Archive & ar, - boost::unordered_map &t, - const unsigned int file_version + Archive & ar, + boost::unordered_map &t, + const unsigned int file_version ){ - boost::serialization::split_free(ar, t, file_version); + boost::serialization::split_free(ar, t, file_version); } -// unordered_multimap -template + +// multimap +template inline void save( - Archive & ar, - const boost::unordered_multimap &t, - const unsigned int /* file_version */ + Archive & ar, + const boost::unordered_multimap &t, + const unsigned int /* file_version */ ){ - boost::serialization::stl::save_collection< - Archive, - boost::unordered_multimap ->(ar, t); + boost::serialization::stl::save_collection< + Archive, + boost::unordered_multimap + >(ar, t); } -template + +template inline void load( - Archive & ar, - boost::unordered_multimap &t, - const unsigned int /* file_version */ + Archive & ar, + boost::unordered_multimap &t, + const unsigned int /* file_version */ ){ - boost::serialization::stl::load_collection< - Archive, - boost::unordered_multimap, - // "archive_input_multimap" was removed in Dec 2009: - // http://lists.boost.org/boost-commit/2009/12/21089.php - // seems safe to use archive_input_map here, for all boost versions (??) - boost::serialization::stl::archive_input_map< - Archive, boost::unordered_multimap ->, - boost::serialization::stl::no_reserve_imp< - boost::unordered_multimap -> ->(ar, t); + boost::serialization::stl::load_collection< + Archive, + boost::unordered_multimap, + boost::serialization::stl::archive_input_map< + Archive, boost::unordered_multimap + >, + boost::serialization::stl::no_reserve_imp< + boost::unordered_multimap + > + >(ar, t); } + // split non-intrusive serialization function member into separate // non intrusive save/load member functions -template +template inline void serialize( - Archive & ar, - boost::unordered_multimap &t, - const unsigned int file_version + Archive & ar, + boost::unordered_multimap &t, + const unsigned int file_version ){ - boost::serialization::split_free(ar, t, file_version); + boost::serialization::split_free(ar, t, file_version); } + } // serialization } // namespace boost + +#endif // BOOST_SERIALIZATION_UNORDEREDMAP_HPP diff --git a/src/SigmaProof.h b/src/SigmaProof.h index f314292..2aa75ea 100644 --- a/src/SigmaProof.h +++ b/src/SigmaProof.h @@ -16,6 +16,10 @@ #include "Debug.h" #include "Hash.h" +#ifndef USE_STD_MAP +#define USE_STD_MAP 1 +#endif + #ifdef USE_STD_MAP #include typedef map var_map; diff --git a/src/Signature.cpp b/src/Signature.cpp index d03c3a0..dd11156 100644 --- a/src/Signature.cpp +++ b/src/Signature.cpp @@ -73,7 +73,7 @@ bool Signature::verify(const Key& key, const string& sig, const string &data, return (err == 1); // signature OK } -Signature::Key* Signature::Key::generateDSAKey(int numbits) { +Ptr Signature::Key::generateDSAKey(int numbits) { DSA *dsa; if (numbits == SIG_NUMBITS) dsa = DSAparams_dup_wrap(DSA_PARAMS); @@ -87,10 +87,10 @@ Signature::Key* Signature::Key::generateDSAKey(int numbits) { "[Signature::Key::generateDSAKey] DSA gen key"); EVP_PKEY *k = EVP_PKEY_new(); EVP_PKEY_assign_DSA(k, dsa); // dsa now owned by k: don't need to free it - return new Key(k, true); + return new_ptr(k, true); } -Signature::Key* Signature::Key::generateRSAKey(int modlen) { +Ptr Signature::Key::generateRSAKey(int modlen) { RSA *rsa = NULL; rsa = RSA_generate_key(modlen, RSA_F4, NULL, NULL); if (!RSA_check_key(rsa)) @@ -98,7 +98,7 @@ Signature::Key* Signature::Key::generateRSAKey(int modlen) { "[Signature::Key::generateRSAKey] RSA gen params"); EVP_PKEY *k = EVP_PKEY_new(); EVP_PKEY_assign_RSA(k, rsa); // rsa now owned by k: don't need to free it - return new Key(k, true); + return new_ptr(k, true); } void BIO_free_to_string(BIO *bio, string &out) { @@ -142,7 +142,7 @@ string Signature::Key::toDER(bool save_private_key) const { return ret; } -Signature::Key* Signature::Key::fromDER(const string& str, bool isPrivate) { +Ptr Signature::Key::fromDER(const string& str, bool isPrivate) { EVP_PKEY *k; const unsigned char *buf = (const unsigned char*)str.data(); if (isPrivate) { @@ -153,7 +153,7 @@ Signature::Key* Signature::Key::fromDER(const string& str, bool isPrivate) { if (!k) throw CashException(CashException::CE_OPENSSL_ERROR, "[Signature::Key::fromDER] can't load d2i"); - return new Key(k, isPrivate); + return new_ptr(k, isPrivate); } Signature::Key::Key(const string& file, const string& passwd, bool isPrivate) diff --git a/src/Signature.h b/src/Signature.h index 5627a84..d7b4a47 100644 --- a/src/Signature.h +++ b/src/Signature.h @@ -28,17 +28,17 @@ class Signature { Key() : _key(0), isPrivate(false) {} /// private key: can sign & verify - static Key* loadPrivateKey(const string& file, const string& passwd) { - return new Key(file, passwd, true); + static Ptr loadPrivateKey(const string& file, const string& passwd) { + return new_ptr(file, passwd, true); } /// public key: can only verify - static Key* loadPublicKey(const string& file, const string& passwd=string()) { - return new Key(file, passwd, false); + static Ptr loadPublicKey(const string& file, const string& passwd=string()) { + return new_ptr(file, passwd, false); } // generates public/private keypair - static Key* generateDSAKey(int numbits=SIG_NUMBITS); - static Key* generateRSAKey(int modlen=SIG_NUMBITS); - inline static Key* generateKey(const string& alg) { + static Ptr generateDSAKey(int numbits=SIG_NUMBITS); + static Ptr generateRSAKey(int modlen=SIG_NUMBITS); + inline static Ptr generateKey(const string& alg) { if (alg == "DSA") return generateDSAKey(); else if (alg == "RSA") return generateRSAKey(); else throw CashException(CashException::CE_UNKNOWN_ERROR, @@ -47,9 +47,9 @@ class Signature { } // get public key for this key: allocates & returns new Key - Key* getPublicKey() const { + Ptr getPublicKey() const { if (!isPrivate){ - return new Key(*this); + return new_ptr(*this); } else { // XXX convert to public key more efficiently? string d = toDER(false); return fromDER(d, false); @@ -84,7 +84,7 @@ class Signature { inline string privateKeyString() const { return toPEM(true); } // binary DER encoding string toDER(bool save_private_key=false) const; - static Key* fromDER(const string& buf, bool isPrivate=false); + static Ptr fromDER(const string& buf, bool isPrivate=false); ~Key() { EVP_PKEY_free(_key); } EVP_PKEY* _key; diff --git a/src/Test.cpp b/src/Test.cpp index 6d689be..957f0e3 100644 --- a/src/Test.cpp +++ b/src/Test.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #define foreach BOOST_FOREACH @@ -81,6 +82,7 @@ double* testBuyWithSetup(); double* testBuyResolution(); double* testBarterResolution(); double* testSerializeAbstract(); +double* testSerializeZero(); double* testMultiExp(); double* multiTest(); @@ -112,6 +114,7 @@ test_desc_t test_funcs[] = { { testBuyResolution, "Buy resolution" }, { testBarterResolution, "Barter resolution" }, { testSerializeAbstract, "Test serialization of derived pointers"}, + { testSerializeZero, "Test serialization of zero"}, { testMultiExp, "Test multi-exp"}, // add new tests here { multiTest, "Multi-tester" }, @@ -138,8 +141,14 @@ void printTests() { } int main(int argc , const char* argv[]) { - // XXX: want to incorporate a different random seed every time? +#if 0 + timeval t; + gettimeofday(&t, NULL); + cout << "NTL::SetSeed: " << t.tv_sec + t.tv_usec << endl; + NTL::SetSeed(to_ZZ(t.tv_sec + t.tv_usec)); // XXX sure, why not +#else SetSeed(to_ZZ(0)); +#endif /*setprecision(5); resetiosflags(ios::scientific); @@ -215,17 +224,17 @@ double* createParameters() { // loadFile(repk, "public.regular."+sec+".arbiter"); startTimer(); - VEDecrypter ve(m, rsaModLength, security); - saveFile(make_nvp("VEPublicKey", *ve.getPK()), "public."+sec+".arbiter"); - saveFile(make_nvp("VESecretKey", *ve.getSK()), "secret."+sec+".arbiter"); + Ptr ve = new_ptr(m, rsaModLength, security); + saveFile(make_nvp("VEPublicKey", *ve->getPK()), "public."+sec+".arbiter"); + saveFile(make_nvp("VESecretKey", *ve->getSK()), "secret."+sec+".arbiter"); timers[timer++] = printTimer(timer, "Arbiter public and secret keys " "created and saved"); startTimer(); m = 1024; - VEDecrypter re(m, rsaModLength, security); - saveFile(make_nvp("VEPublicKey", *re.getPK()), "public.regular."+sec+".arbiter"); - saveFile(make_nvp("VESecretKey", *re.getSK()), "secret.regular."+sec+".arbiter"); + Ptr re = new_ptr(m, rsaModLength, security); + saveFile(make_nvp("VEPublicKey", *re->getPK()), "public.regular."+sec+".arbiter"); + saveFile(make_nvp("VESecretKey", *re->getSK()), "secret.regular."+sec+".arbiter"); timers[timer++] = printTimer(timer, "Arbiter public and secret keys (for " "non-verifiable encryption) created " "and saved"); @@ -241,13 +250,13 @@ double* createParameters() { "and saved"); // save BankParams from BankTool public params - const BankParameters* bankParameters = bankTool.getBankParameters(); + Ptr bankParameters = bankTool.getBankParameters(); saveFile(make_nvp("BankParameters", *bankParameters), "bank."+sec+".params"); // save a new user startTimer(); UserTool userTool(security, lx, bankParameters, - *ve.getPK(), *re.getPK(), hashAlg); + ve->getPK(), re->getPK(), hashAlg); saveFile(make_nvp("UserTool",userTool), "tool."+sec+".user"); timers[timer++] = printTimer(timer, "User created and saved"); return timers; @@ -268,13 +277,13 @@ double* loadParameters() { VEPublicKey pk(("public.regular."+sec+".arbiter").c_str()); BankTool bankTool(("tool."+sec+".bank").c_str()); - BankParameters bp(("bank."+sec+".params").c_str()); - const BankParameters* params = &bp; + Ptr params( + new BankParameters(("bank."+sec+".params").c_str())); cout << "Number of denominations is " << params->getDenominations().size() << endl; - const GroupPrime* cashGrp = params->getCashGroup(); + Ptr cashGrp = params->getCashGroup(); cout << "Number of generators for cash group is " << cashGrp->getGenerators().size() << endl; @@ -284,7 +293,7 @@ double* loadParameters() { } cout << "generators for bank public key for denom 512 are:" << endl; - const GroupRSA* bankPK = params->getBankKey(512); + Ptr bankPK = params->getBankKey(512); for (unsigned i = 0; i < bankPK->getGenerators().size(); i++) { cout << i+1 << "-th generator is " << bankPK->getGenerator(i) << endl; } @@ -391,8 +400,8 @@ double* testSophie() { double* testClone() { double* timers = new double[MAX_TIMERS]; istringstream iss(string("x * a ^ b_i + -2")); - ZKPLexer* lexer = new ZKPLexer(iss); - ZKPParser* parser = new ZKPParser(*lexer); + Ptr lexer(new ZKPLexer(iss)); + Ptr parser(new ZKPParser(*lexer)); ASTExprPtr n = parser->expr(); Printer print; @@ -407,8 +416,8 @@ double* testClone() { double* testFor() { double* timers = new double[MAX_TIMERS]; istringstream iss(string("for(i, 1:3, &&, c_i := (g^x_i) * (h^r_i))")); - ZKPLexer* lexer = new ZKPLexer(iss); - ZKPParser* parser = new ZKPParser(*lexer); + Ptr lexer(new ZKPLexer(iss)); + Ptr parser(new ZKPParser(*lexer)); ASTNodePtr n = parser->spec(); Printer print; @@ -435,8 +444,8 @@ double* testConstSub() { "r[1:l], vprime such that: for(i, 1:l, range: " "-(2^l_x - 1) <= x_i < 2^l_x) C = h^vprime * " "for(i, 1:l, *, c_i * h^(-r_i))")); - ZKPLexer* lexer = new ZKPLexer(iss); - ZKPParser* parser = new ZKPParser(*lexer); + Ptr lexer(new ZKPLexer(iss)); + Ptr parser(new ZKPParser(*lexer)); ASTNodePtr n = parser->spec(); Printer print; @@ -479,9 +488,9 @@ double* testProofInteraction() { // load up our parameters BankTool bankTool("tool.80.bank"); BankParameters bp("bank.80.params"); - const GroupPrime* cashG = bp.getCashGroup(); + Ptr cashG = bp.getCashGroup(); // just get PK for an arbitrary denomination - const GroupRSA* rangeG = bp.getBankKey(512); + Ptr rangeG = bp.getBankKey(512); group_map pgrps; variable_map pvars; @@ -620,7 +629,7 @@ double* testCLProver(){ int numPrivates = 3; //create secret key //creating group adds f as a generator - GroupRSA* sk = new GroupRSA("first", RSALength, stat); + Ptr sk = new_ptr("first", RSALength, stat); for (int i = 0; i < numPrivates + numPublics; i++) { sk->addNewGenerator(); } @@ -628,7 +637,7 @@ double* testCLProver(){ sk->addNewGenerator(); //create public key from copying secret key and clearing secrets - GroupRSA* pk = new GroupRSA(*sk); + Ptr pk = new_ptr(*sk); pk->clearSecrets(); //create random public messages @@ -638,8 +647,8 @@ double* testCLProver(){ publics.push_back(RandomBits_ZZ(lx-1)); //create random private messages and their commitments - const BankParameters* bp = new BankParameters("bank.80.params"); - const GroupPrime* comGroup = bp->getCashGroup(); + Ptr bp = new_ptr("bank.80.params"); + Ptr comGroup = bp->getCashGroup(); startTimer(); vector > secretExps; vector coms; @@ -664,7 +673,7 @@ double* testCLProver(){ CLBlindRecipient recip(pk, comGroup, lx, coms, numPrivates, numPublics); timers[timer++] = printTimer(timer, "Created CL recipient"); startTimer(); - ProofMessage* cVprimeProof = recip.getC(secretExps, hashAlg); + Ptr cVprimeProof = recip.getC(secretExps, hashAlg); timers[timer++] = printTimer(timer, "Recipient sent proof of knowledge " "of values in commitments"); cout << "Recipient proof size: " << saveGZString(*cVprimeProof).size() <vars.at("C"); - ProofMessage* partialSigProof = issu.getPartialSignature(C, publics, + Ptr partialSigProof = issu.getPartialSignature(C, publics, *cVprimeProof, stat, hashAlg); timers[timer++] = printTimer(timer, "Issuer verified recipient's proof " @@ -711,7 +720,7 @@ double* testCLProver(){ CLSignatureProver prover(pk, comGroup, lx, coms, numPrivates, numPublics); timers[timer++] = printTimer(timer, "Created CL prover"); startTimer(); - ProofMessage* publicProof = prover.getProof(signature, secretExps, + Ptr publicProof = prover.getProof(signature, secretExps, publics, hashAlg); timers[timer++] = printTimer(timer, "Prover sent proof of possession of " "CL signature"); @@ -722,7 +731,7 @@ double* testCLProver(){ numPublics); timers[timer++] = printTimer(timer, "Created CL verifier"); startTimer(); - bool verified = verifier.verify(publicProof, stat); + bool verified = verifier.verify(*publicProof, stat); timers[timer++] = printTimer(timer, "Verifier checked prover's proof"); if(verified){ cout<<"Proving possession of a CL signature succeeded"< group1 = new_ptr("cash", modLength, 2*stat, stat); group1->addNewGenerator(); - GroupPrime* group2 = new GroupPrime("cash", modLength, 2*stat, stat); + Ptr group2 = new_ptr("cash", modLength, 2*stat, stat); group2->addNewGenerator(); - GroupPrime* group3 = new GroupPrime("cash", modLength, 2*stat, stat); + Ptr group3 = new_ptr("cash", modLength, 2*stat, stat); group3->addNewGenerator(); - vector grps; + vector > grps; grps.push_back(group1); grps.push_back(group2); grps.push_back(group3); // also need RSA group for CL signature stuff - GroupRSA* pk = new GroupRSA("bank", modLength, stat); // f + Ptr pk = new_ptr("bank", modLength, stat); // f pk->addNewGenerator(); // g_1 pk->addNewGenerator(); // g_2 pk->addNewGenerator(); // g_3 pk->addNewGenerator(); // g_4 pk->addNewGenerator(); // h - GroupRSA* sk = new GroupRSA(*pk); + Ptr sk = new_ptr(*pk); pk->clearSecrets(); // now set up commitments and such @@ -804,12 +813,12 @@ double* testCLGroups() { timers[timer++] = printTimer(timer, "CLBlindIssuer created"); startTimer(); - ProofMessage* initial = recipient.getC(secretExps, hashAlg); + Ptr initial = recipient.getC(secretExps, hashAlg); timers[timer++] = printTimer(timer, "Initial proof from recipient created"); ZZ C = initial->vars.at("C"); startTimer(); - ProofMessage* bankProof = issuer.getPartialSignature(C, publics, *initial, + Ptr bankProof = issuer.getPartialSignature(C, publics, *initial, stat, hashAlg); timers[timer++] = printTimer(timer, "Issuer's proof created"); @@ -834,7 +843,7 @@ double* testCLGroups() { timers[timer++] = printTimer(timer, "CL signature prover created"); startTimer(); - ProofMessage* sigProof = prover.getProof(sig, secretExps, publics, + Ptr sigProof = prover.getProof(sig, secretExps, publics, hashAlg); timers[timer++] = printTimer(timer, "Proof of knowledge of CL signature " "created"); @@ -845,7 +854,7 @@ double* testCLGroups() { timers[timer++] = printTimer(timer, "CL signature verifier created"); startTimer(); - bool sigVerified = verifier.verify(sigProof, stat); + bool sigVerified = verifier.verify(*sigProof, stat); timers[timer++] = printTimer(timer, "Verifier verified the prover's PoK"); if (sigVerified) @@ -862,15 +871,15 @@ double* testVE() { hashalg_t hashAlg = Hash::SHA1; // later will just save and load, but for now make keys from scratch - VEDecrypter decrypter(m, modLength, stat); - VEPublicKey* pk = decrypter.getPK(); + Ptr decrypter = new_ptr(m, modLength, stat); + Ptr pk = decrypter->getPK(); // set up the prover VEProver prover(pk); // need all commitment values and such // XXX: need test where this group can be of any form - GroupRSA* rsaGroup = new GroupRSA("bank", modLength, stat); // f_3 + Ptr rsaGroup = new_ptr("bank", modLength, stat); // f_3 rsaGroup->addNewGenerator(); // gprime rsaGroup->addNewGenerator(); // hprime rsaGroup->addNewGenerator(); // f_1 @@ -922,7 +931,7 @@ double* testVE() { "encryption completed"); // also try it with a prime-order group - GroupPrime* primeGroup = new GroupPrime("bank", modLength, 2*stat, stat); + Ptr primeGroup = new_ptr("bank", modLength, 2*stat, stat); primeGroup->addNewGenerator(); primeGroup->addNewGenerator(); primeGroup->addNewGenerator(); @@ -1033,32 +1042,36 @@ double* testWithdraw() { denoms.push_back(512); denoms.push_back(1024); - int stat=80; + int stat=80, lx=2*stat, modLen=1024, m=3; string statName = lexical_cast(stat); - + +#define LOAD_DATA 1 +#if LOAD_DATA // load bank and user from file BankTool bankTool("tool.80.bank"); - const BankParameters* params = new BankParameters("bank.80.params"); + Ptr params = new_ptr("bank.80.params"); UserTool userTool("tool.80.user", params, "public.80.arbiter", "public.regular.80.arbiter"); -/* + +#else // generate from scratch + startTimer(); BankTool bankTool(stat, lx, modLen, hashAlg, denoms); timers[timer++] = printTimer(timer, "BankTool created"); - const BankParameters *params = bankTool.getBankParameters(); + Ptr params = bankTool.getBankParameters(); // this is PK used for verifiable encryption startTimer(); - VEDecrypter decrypter(m, modLen, stat); - VEPublicKey vepk = *decrypter.getPK(); - VESecretKey vesk = *decrypter.getSK(); + Ptr decrypter = new_ptr(m, modLen, stat); + Ptr vepk = decrypter->getPK(); + Ptr vesk = decrypter->getSK(); timers[timer++] = printTimer(timer, "Arbiter public and secret keys created"); // this is PK used for regular encryption startTimer(); - VEDecrypter regularDecrypter(m, modLen, stat); - VEPublicKey pk = *regularDecrypter.getPK(); - VESecretKey sk = *regularDecrypter.getSK(); + Ptr regularDecrypter = new_ptr(m, modLen, stat); + Ptr pk = regularDecrypter->getPK(); + Ptr sk = regularDecrypter->getSK(); timers[timer++] = printTimer(timer, "Arbiter regular public and secret " "keys created"); @@ -1066,12 +1079,12 @@ double* testWithdraw() { startTimer(); UserTool userTool(stat, lx, params, vepk, pk, hashAlg); timers[timer++] = printTimer(timer, "UserTool created"); -*/ +#endif // step 1: user sends bank the public key and desired wallet size ZZ userPK = userTool.getPublicKey(); // also uses tool for withdrawing - UserWithdrawTool* uwTool = userTool.getWithdrawTool(walletSize, coinDenom); + Ptr uwTool = userTool.getWithdrawTool(walletSize, coinDenom); // also sends partial commitment (in partial commitment to s') startTimer(); ZZ sPrimeCom = uwTool->createPartialCommitment(); @@ -1079,7 +1092,7 @@ double* testWithdraw() { cout << "Partial commitment size: " < bwTool = bankTool.getWithdrawTool(userPK, walletSize, coinDenom); // given commitment to s', computes full commitment to s = s' + r' startTimer(); @@ -1092,8 +1105,8 @@ double* testWithdraw() { // step 3: now, the user sends bank a proof of identity and a proof // from the CL signature protocol startTimer(); - ProofMessage* idProof = uwTool->initiateSignature(bankPart); - ProofMessage* clProof = uwTool->getCLProof(); + Ptr idProof = uwTool->initiateSignature(bankPart); + Ptr clProof = uwTool->getCLProof(); timers[timer++] = printTimer(timer, "User created proof of identity, as " "well as all commitments"); cout << "ID proof size: " << saveGZString(*idProof).size() << endl; @@ -1103,7 +1116,7 @@ double* testWithdraw() { // signature // bank also needs to send a proof of knowledge of 1/e startTimer(); - ProofMessage* pm = bwTool->sign(idProof, clProof); + Ptr pm = bwTool->sign(idProof, clProof); timers[timer++] = printTimer(timer, "Bank created PoK of 1/e and partial " "signature"); cout << "Bank proof size: " << saveGZString(*pm).size() << endl; @@ -1131,9 +1144,10 @@ double* testWithdraw() { */ saveFile(make_nvp("Wallet", wallet), ("wallet."+statName).c_str()); - // XXX: having some seg fault issues here... - delete uwTool; - delete bwTool; + idProof.reset(); clProof.reset(); pm.reset(); + + uwTool.reset(); + bwTool.reset(); // also like to make sure that coin is valid here vector contractInfo; @@ -1141,11 +1155,11 @@ double* testWithdraw() { ZZ rVal = Hash::hash(contractInfo, hashAlg); startTimer(); - Coin coin = wallet.nextCoin(rVal); + Ptr coin = wallet.nextCoin(rVal); timers[timer++] = printTimer(timer, "Got a coin from the wallet"); - coin.unendorse(); - bool coinVerified = coin.verifyCoin(); + coin->unendorse(); + bool coinVerified = coin->verifyCoin(); if (coinVerified) cout << "Coin successfully verified and we're done!" << endl; else @@ -1166,21 +1180,17 @@ double* testWithdrawInterleaved() { // load bank and user from file BankTool bankTool("tool.80.bank"); - const BankParameters* params = new BankParameters("bank.80.params"); - - // create new user - VEPublicKey vepk("public.80.arbiter"); - VEPublicKey repk("public.regular.80.arbiter"); - UserTool userTool(stat, 2*stat, params, vepk, repk, hashAlg); -// UserTool userTool("tool.80.user", params, "public.80.arbiter", -// "public.regular.80.arbiter"); + Ptr params = new_ptr("bank.80.params"); + + UserTool userTool("tool.80.user", params, "public.80.arbiter", + "public.regular.80.arbiter"); cout << "user pubkey " << userTool.getPublicKey() << endl; // step 1: user sends bank the public key and desired wallet size ZZ userPK = userTool.getPublicKey(); // also uses tool for withdrawing - UserWithdrawTool* uwTool1 = userTool.getWithdrawTool(walletSize, coinDenom1); - UserWithdrawTool* uwTool2 = userTool.getWithdrawTool(walletSize, coinDenom2); + Ptr uwTool1 = userTool.getWithdrawTool(walletSize, coinDenom1); + Ptr uwTool2 = userTool.getWithdrawTool(walletSize, coinDenom2); // also sends partial commitment (in partial commitment to s') startTimer(); ZZ sPrimeCom1 = uwTool1->createPartialCommitment(); @@ -1190,8 +1200,8 @@ double* testWithdrawInterleaved() { cout << "Partial commitment 2 size: " < bwTool1 = bankTool.getWithdrawTool(userPK, walletSize, coinDenom1); + Ptr bwTool2 = bankTool.getWithdrawTool(userPK, walletSize, coinDenom2); // given commitment to s', computes full commitment to s = s' + r' startTimer(); @@ -1207,10 +1217,10 @@ double* testWithdrawInterleaved() { // step 3: now, the user sends bank a proof of identity and a proof // from the CL signature protocol startTimer(); - ProofMessage* idProof1 = uwTool1->initiateSignature(bankPart1); - ProofMessage* idProof2 = uwTool2->initiateSignature(bankPart2); - ProofMessage* clProof1 = uwTool1->getCLProof(); - ProofMessage* clProof2 = uwTool2->getCLProof(); + Ptr idProof1 = uwTool1->initiateSignature(bankPart1); + Ptr idProof2 = uwTool2->initiateSignature(bankPart2); + Ptr clProof1 = uwTool1->getCLProof(); + Ptr clProof2 = uwTool2->getCLProof(); timers[timer++] = printTimer(timer, "User created proof of identity, as " "well as all commitments"); cout << "ID proof size: " << saveGZString(*idProof1).size() << endl; @@ -1222,8 +1232,8 @@ double* testWithdrawInterleaved() { // signature // bank also needs to send a proof of knowledge of 1/e startTimer(); - ProofMessage* pm1 = bwTool1->sign(idProof1, clProof1); - ProofMessage* pm2 = bwTool2->sign(idProof2, clProof2); + Ptr pm1 = bwTool1->sign(idProof1, clProof1); + Ptr pm2 = bwTool2->sign(idProof2, clProof2); timers[timer++] = printTimer(timer, "Bank created PoK of 1/e and partial " "signature"); cout << "Bank proof 1 size: " << saveGZString(*pm1).size() << endl; @@ -1254,14 +1264,14 @@ double* testWithdrawInterleaved() { ZZ rVal2 = Hash::hash(contractInfo2, hashAlg); startTimer(); - Coin coin1 = wallet1.nextCoin(rVal1); - Coin coin2 = wallet2.nextCoin(rVal2); + Ptr coin1 = wallet1.nextCoin(rVal1); + Ptr coin2 = wallet2.nextCoin(rVal2); timers[timer++] = printTimer(timer, "Got a coin from the wallet"); - coin1.unendorse(); - coin2.unendorse(); - bool coinVerified1 = coin1.verifyCoin(); - bool coinVerified2 = coin2.verifyCoin(); + coin1->unendorse(); + coin2->unendorse(); + bool coinVerified1 = coin1->verifyCoin(); + bool coinVerified2 = coin2->verifyCoin(); cout << (coinVerified1 ? "Coin 1 successfully verified and we're done!" : "Coin 1 failed to verify") << endl; cout << (coinVerified2 ? "Coin 2 successfully verified and we're done!" : "Coin 2 failed to verify") << endl; @@ -1281,20 +1291,16 @@ double* testWithdrawRepeated() { // load bank and user from file BankTool bankTool("tool.80.bank"); - const BankParameters* params = new BankParameters("bank.80.params"); - - // create new user - VEPublicKey vepk("public.80.arbiter"); - VEPublicKey repk("public.regular.80.arbiter"); - UserTool userTool(stat, 2*stat, params, vepk, repk, hashAlg); -// UserTool userTool("tool.80.user", params, "public.80.arbiter", -// "public.regular.80.arbiter"); + Ptr params = new_ptr("bank.80.params"); + + UserTool userTool("tool.80.user", params, "public.80.arbiter", + "public.regular.80.arbiter"); cout << "user pubkey " << userTool.getPublicKey() << endl; // step 1: user sends bank the public key and desired wallet size ZZ userPK = userTool.getPublicKey(); // also uses tool for withdrawing - UserWithdrawTool* uwTool1 = userTool.getWithdrawTool(walletSize, coinDenom1); + Ptr uwTool1 = userTool.getWithdrawTool(walletSize, coinDenom1); // also sends partial commitment (in partial commitment to s') startTimer(); ZZ sPrimeCom1 = uwTool1->createPartialCommitment(); @@ -1302,7 +1308,7 @@ double* testWithdrawRepeated() { cout << "Partial commitment 1 size: " < bwTool1 = bankTool.getWithdrawTool(userPK, walletSize, coinDenom1); // given commitment to s', computes full commitment to s = s' + r' startTimer(); @@ -1315,8 +1321,8 @@ double* testWithdrawRepeated() { // step 3: now, the user sends bank a proof of identity and a proof // from the CL signature protocol startTimer(); - ProofMessage* idProof1 = uwTool1->initiateSignature(bankPart1); - ProofMessage* clProof1 = uwTool1->getCLProof(); + Ptr idProof1 = uwTool1->initiateSignature(bankPart1); + Ptr clProof1 = uwTool1->getCLProof(); timers[timer++] = printTimer(timer, "User created proof of identity, as " "well as all commitments"); cout << "ID proof size: " << saveGZString(*idProof1).size() << endl; @@ -1326,7 +1332,7 @@ double* testWithdrawRepeated() { // signature // bank also needs to send a proof of knowledge of 1/e startTimer(); - ProofMessage* pm1 = bwTool1->sign(idProof1, clProof1); + Ptr pm1 = bwTool1->sign(idProof1, clProof1); timers[timer++] = printTimer(timer, "Bank created PoK of 1/e and partial " "signature"); cout << "Bank proof 1 size: " << saveGZString(*pm1).size() << endl; @@ -1350,29 +1356,29 @@ double* testWithdrawRepeated() { ZZ rVal1 = Hash::hash(contractInfo1, hashAlg); startTimer(); - Coin coin1 = wallet1.nextCoin(rVal1); + Ptr coin1 = wallet1.nextCoin(rVal1); timers[timer++] = printTimer(timer, "Got a coin from the wallet"); - coin1.unendorse(); - bool coinVerified1 = coin1.verifyCoin(); + coin1->unendorse(); + bool coinVerified1 = coin1->verifyCoin(); cout << (coinVerified1 ? "Coin 1 successfully verified and we're done!" : "Coin 1 failed to verify") << endl; // // now do it again, with a different denom // - //UserWithdrawTool* uwTool2 = userTool.getWithdrawTool(walletSize, coinDenom1); // works (weird, why?) - UserWithdrawTool* uwTool2 = userTool.getWithdrawTool(walletSize, coinDenom2); // doesn't work + //Ptr uwTool2 = userTool.getWithdrawTool(walletSize, coinDenom1); // works (weird, why?) + Ptr uwTool2 = userTool.getWithdrawTool(walletSize, coinDenom2); // doesn't work ZZ sPrimeCom2 = uwTool2->createPartialCommitment(); cout << "Partial commitment 2 size: " < bwTool2 = bankTool.getWithdrawTool(userPK, walletSize, coinDenom2); bwTool2->computeFullCommitment(sPrimeCom2); ZZ bankPart2 = bwTool2->getBankContribution(); cout << "Bank contribution 2 size: " << saveGZString(bankPart2).size() << endl; - ProofMessage* idProof2 = uwTool2->initiateSignature(bankPart2); - ProofMessage* clProof2 = uwTool2->getCLProof(); + Ptr idProof2 = uwTool2->initiateSignature(bankPart2); + Ptr clProof2 = uwTool2->getCLProof(); cout << "ID proof size: " << saveGZString(*idProof2).size() << endl; cout << "CL proof size: " << saveGZString(*clProof2).size() << endl; - ProofMessage* pm2 = bwTool2->sign(idProof2, clProof2); + Ptr pm2 = bwTool2->sign(idProof2, clProof2); cout << "Bank proof 2 size: " << saveGZString(*pm2).size() << endl; cout << "Verifying proof message 2" << endl; vector partialSig2 = uwTool2->verify(*pm2); @@ -1380,9 +1386,9 @@ double* testWithdrawRepeated() { vector contractInfo2; contractInfo2.push_back(1234567891); ZZ rVal2 = Hash::hash(contractInfo2, hashAlg); - Coin coin2 = wallet2.nextCoin(rVal2); - coin2.unendorse(); - bool coinVerified2 = coin2.verifyCoin(); + Ptr coin2 = wallet2.nextCoin(rVal2); + coin2->unendorse(); + bool coinVerified2 = coin2->verifyCoin(); cout << (coinVerified2 ? "Coin 2 successfully verified and we're done!" : "Coin 2 failed to verify") << endl; return timers; @@ -1396,7 +1402,7 @@ double* testCoin() { startTimer(); // load bank and user from file BankTool bankTool("tool.80.bank"); - const BankParameters* params = new BankParameters("bank.80.params"); + Ptr params = new_ptr("bank.80.params"); UserTool userTool("tool.80.user", params, "public.80.arbiter", "public.regular.80.arbiter"); // also load wallet @@ -1410,7 +1416,7 @@ double* testCoin() { ZZ rVal = Hash::hash(contractInfo, hashAlg); startTimer(); - Coin coin = wallet.nextCoin(rVal); + Coin coin = *wallet.nextCoin(rVal); timers[timer++] = printTimer(timer, "Got coin from wallet"); cout << "Coin size: " << saveGZString(coin).size() << endl; @@ -1465,7 +1471,7 @@ double* testCoin() { wallet.replaceCoin(sameIndex); startTimer(); - Coin coin2 = wallet.nextCoin(rVal2); + Coin coin2 = *wallet.nextCoin(rVal2); timers[timer++] = printTimer(timer, "Withdrew the same coin from the wallet"); startTimer(); bool isDoubleSpent = bankTool.isCoinDoubleSpent(coin, coin2); @@ -1494,29 +1500,29 @@ double* testBuy() { hashalg_t hashAlg = Hash::SHA1; cipher_t encAlg = "aes-128-ctr"; - const BankParameters* params = new BankParameters("bank.80.params"); - Wallet wallet("wallet.80", params); - VEPublicKey vepk("public.80.arbiter"); + Ptr params = new_ptr("bank.80.params"); + Ptr wallet(new Wallet("wallet.80", params)); + Ptr vepk(new VEPublicKey("public.80.arbiter")); ZZ R = RandomBits_ZZ(params->getCashGroup()->getOrderLength()); // just use random garbage for file - Buffer* ptext = new Buffer(string("randomdata01234567890123456789")); + Ptr ptext = new_ptr(string("randomdata01234567890123456789")); Hash::hash_t ptHash = ptext->hash(hashAlg, string(), Hash::TYPE_PLAIN); // create buyer and seller objects - Buyer buyer(timeoutLength, &vepk, stat); - Seller seller(timeoutLength, timeoutTolerance, &vepk, stat); + Buyer buyer(timeoutLength, vepk, stat); + Seller seller(timeoutLength, timeoutTolerance, vepk, stat); // step 1: seller gives ciphertext to buyer startTimer(); - EncBuffer* ctext = seller.encrypt(ptext, encAlg); + Ptr ctext = seller.encrypt(ptext, encAlg); // XXX: serializing ciphertexts doesn't really work timers[timer++] = printTimer(timer, "Seller created ciphertext"); // step 2: buyer creates contract and verifiable escrow startTimer(); - BuyMessage* buyMessage = buyer.buy(&wallet, ctext, ptHash, R); + Ptr buyMessage = buyer.buy(wallet, ctext, ptHash, R); timers[timer++] = printTimer(timer, "Buyer created buy message"); cout << "Buy message size: " << saveGZString(*buyMessage).size() << endl; @@ -1527,9 +1533,27 @@ double* testBuy() { cout << " Escrow size: " << saveGZString(buyMessage->getEscrow()).size() << endl; +#if 1 + // test saving and loading BuyMessage + string bmsg = saveGZString(*buyMessage); + saveXML(make_nvp("BuyMessage", *buyMessage), "buym1.xml"); + Ptr loadedBMsg = new_ptr(bmsg, params); + saveXML(make_nvp("BuyMessage", *loadedBMsg), "buym2.xml"); + + cout << "Loaded Buy message size: " << saveGZString(*loadedBMsg).size() << endl; + cout << " Coin size: " << saveGZString(loadedBMsg->getCoinPrime()).size() + << endl; + cout << " Contract size: " << saveGZString(loadedBMsg->getContract()).size() + << endl; + cout << " Escrow size: " << saveGZString(loadedBMsg->getEscrow()).size() + << endl; +#else + Ptr loadedBMsg = buyMessage; +#endif + // step 3: seller checks contract and escrow, returns key(s) if valid startTimer(); - vector key = seller.sell(buyMessage, R, ptHash); + vector key = seller.sell(loadedBMsg, R, ptHash); timers[timer++] = printTimer(timer, "Seller checked the buy message and " "sent decryption key"); @@ -1550,8 +1574,8 @@ double* testBuy() { else cout << "Buy protocol failed" << endl; - delete ptext; - delete buyMessage; + ptext.reset(); + buyMessage.reset(); loadedBMsg.reset(); return timers; } @@ -1564,35 +1588,35 @@ double* testBarter() { cipher_t encAlg = "aes-128-ctr", signAlg = "DSA"; int hashType = Hash::TYPE_PLAIN; - const BankParameters* params = new BankParameters("bank.80.params"); - Wallet wallet("wallet.80", params); - VEPublicKey vepk("public.80.arbiter"); - VEPublicKey pk("public.regular.80.arbiter"); + Ptr params = new_ptr("bank.80.params"); + Ptr wallet = new_ptr("wallet.80", params); + Ptr vepk(new VEPublicKey("public.80.arbiter")); + Ptr pk(new VEPublicKey("public.regular.80.arbiter")); - string trackerHashKey = vepk.getHashKey(); + string trackerHashKey = vepk->getHashKey(); ZZ R = RandomBits_ZZ(params->getCashGroup()->getOrderLength()); // get random files for Alice and Bob char bufA[1024], bufB[1024]; RAND_pseudo_bytes((unsigned char*) bufA, sizeof(bufA)); RAND_pseudo_bytes((unsigned char*) bufB, sizeof(bufB)); - Buffer* aData = new Buffer(bufA, sizeof(bufA)); - Buffer* bData = new Buffer(bufB, sizeof(bufB)); + Ptr aData = new_ptr(bufA, sizeof(bufA)); + Ptr bData = new_ptr(bufB, sizeof(bufB)); hash_t aHash = aData->hash(hashAlg, trackerHashKey, hashType); hash_t bHash = bData->hash(hashAlg, trackerHashKey, hashType); // want to generate a signing key startTimer(); - Signature::Key* signKey = Signature::Key::generateKey(signAlg); + Ptr signKey = Signature::Key::generateKey(signAlg); timers[timer++] = printTimer(timer, "Signature key generated"); // create initiator and responder objects - FEInitiator alice(timeoutLength, &vepk, &pk, stat, signKey); - FEResponder bob(timeoutLength, timeoutTolerance, &vepk, &pk, stat); + FEInitiator alice(timeoutLength, vepk, pk, stat, signKey); + FEResponder bob(timeoutLength, timeoutTolerance, vepk, pk, stat); // step 1: Alice sends Bob a setup message startTimer(); - FESetupMessage* setupMsg = alice.setup(&wallet, R, signAlg); + Ptr setupMsg = alice.setup(wallet, R, signAlg); timers[timer++] = printTimer(timer, "Alice created setup message"); cout << "Setup size: " << saveGZString(*setupMsg).size() << endl; @@ -1603,21 +1627,21 @@ double* testBarter() { cout << "The setup message was valid" << endl; else cout << "Verification of the setup message failed" << endl; - EncBuffer* bCipher = bob.startRound(bData, encAlg); + Ptr bCipher = bob.startRound(bData, encAlg); timers[timer++] = printTimer(timer, "Bob checked setup message and " "sent back his ciphertext"); cout << "Bob ciphertext size: " << saveGZString(*bCipher).size() << endl; // step 3: Alice sends her ciphertext startTimer(); - EncBuffer* aCipher = alice.continueRound(aData, encAlg); + Ptr aCipher = alice.continueRound(aData, encAlg); timers[timer++] = printTimer(timer, "Alice sent back her own ciphertext"); cout << "Alice ciphertext size: " << saveGZString(*aCipher).size() << endl; // step 4: Alice continues by preparing and sending a contract and // an escrow of her key (and her signature on it) startTimer(); - FEMessage* message = alice.barter(bCipher, bHash, aHash); + Ptr message = alice.barter(bCipher, bHash, aHash); timers[timer++] = printTimer(timer, "Alice sent the contract for bartering"); cout << "Message size: " << saveGZString(*message).size() << endl; @@ -1651,21 +1675,21 @@ double* testBarter() { bob.reset(); // use new files - Buffer* aData2 = new Buffer(string("thisismysuperraddataalice00")); - Buffer* bData2 = new Buffer(string("thisismysuperraddatabob0000")); + Ptr aData2 = new_ptr(string("thisismysuperraddataalice00")); + Ptr bData2 = new_ptr(string("thisismysuperraddatabob0000")); hash_t aHash2 = aData2->hash(hashAlg, trackerHashKey, hashType); hash_t bHash2 = bData2->hash(hashAlg, trackerHashKey, hashType); startTimer(); - EncBuffer* bCipher2 = bob.startRound(bData2, encAlg); + Ptr bCipher2 = bob.startRound(bData2, encAlg); timers[timer++] = printTimer(timer, "Bob sent his second ciphertext"); startTimer(); - EncBuffer* aCipher2 = alice.continueRound(aData2, encAlg); + Ptr aCipher2 = alice.continueRound(aData2, encAlg); timers[timer++] = printTimer(timer, "Alice sent her second ciphertext"); startTimer(); - FEMessage* message2 = alice.barter(bCipher2, bHash2, aHash2); + Ptr message2 = alice.barter(bCipher2, bHash2, aHash2); timers[timer++] = printTimer(timer, "Alice sent her message for the " "second set of files"); @@ -1688,14 +1712,14 @@ double* testBarter() { else cout << "Bartering on the second set of files failed" << endl; - delete aData; - delete bData; - delete setupMsg; - delete message; - delete aData2; - delete bData2; - delete signKey; - delete message2; + aData.reset(); + bData.reset(); + setupMsg.reset(); + message.reset(); + aData2.reset(); + bData2.reset(); + signKey.reset(); + message2.reset(); return timers; } @@ -1708,46 +1732,46 @@ double* testBuyWithSetup() { string signAlg = "DSA", encAlg = "aes-128-ctr"; int hashType = Hash::TYPE_PLAIN; - const BankParameters* params = new BankParameters("bank.80.params"); - Wallet wallet("wallet.80", params); - VEPublicKey vepk("public.80.arbiter"); - VEPublicKey pk("public.regular.80.arbiter"); + Ptr params = new_ptr("bank.80.params"); + Ptr wallet = new_ptr("wallet.80", params); + Ptr vepk = new_ptr("public.80.arbiter"); + Ptr pk = new_ptr("public.regular.80.arbiter"); - string trackerHashKey = vepk.getHashKey(); + string trackerHashKey = vepk->getHashKey(); ZZ R = RandomBits_ZZ(params->getCashGroup()->getOrderLength()); // get random files for Alice and Bob char bufB[1024]; RAND_pseudo_bytes((unsigned char*) bufB, sizeof(bufB)); - Buffer* data = new Buffer(bufB, sizeof(bufB)); + Ptr data = new_ptr(bufB, sizeof(bufB)); hash_t hash = data->hash(hashAlg, trackerHashKey, hashType); // want to generate a signing key startTimer(); - Signature::Key* signKey = Signature::Key::generateKey(signAlg); + Ptr signKey = Signature::Key::generateKey(signAlg); timers[timer++] = printTimer(timer, "Signature key generated"); // create initiator and responder objects - FEInitiator alice(timeoutLength, &vepk, &pk, stat, signKey); - FEResponder bob(timeoutLength, timeoutTolerance, &vepk, &pk, stat); + FEInitiator alice(timeoutLength, vepk, pk, stat, signKey); + FEResponder bob(timeoutLength, timeoutTolerance, vepk, pk, stat); // step 1: Alice sends Bob a setup message startTimer(); - FESetupMessage* setupMsg = alice.setup(&wallet, R, signAlg); + Ptr setupMsg = alice.setup(wallet, R, signAlg); timers[timer++] = printTimer(timer, "Alice created setup message"); cout << "Setup size: " << saveGZString(*setupMsg).size() << endl; // step 2: Bob checks setup message and outputs his ciphertext startTimer(); bob.setup(setupMsg, R); - EncBuffer* ctext = bob.startRound(data, encAlg); + Ptr ctext = bob.startRound(data, encAlg); timers[timer++] = printTimer(timer, "Bob checked setup message and " "output ciphertext"); cout << "Ciphertext size: " << saveGZString(*ctext).size() << endl; // step 3: Alice decides to buy startTimer(); - FEMessage* msg = alice.buy(ctext, hash); + Ptr msg = alice.buy(ctext, hash); timers[timer++] = printTimer(timer, "Alice decided to buy and sent contract"); cout << "Message size: " << saveGZString(*msg).size() << endl; @@ -1786,38 +1810,38 @@ double* testBuyResolution() { int hashType = Hash::TYPE_PLAIN; cipher_t encAlg = "aes-128-ctr"; - VEPublicKey vepk("public.80.arbiter"); - VESecretKey vesk("secret.80.arbiter"); - VEDecrypter veDecrypter(&vepk, &vesk); + Ptr vepk = new_ptr("public.80.arbiter"); + Ptr vesk = new_ptr("secret.80.arbiter"); + Ptr veDecrypter = new_ptr(vepk, vesk); - VEPublicKey pk("public.80.arbiter"); - VESecretKey sk("secret.80.arbiter"); - VEDecrypter decrypter(&pk, &sk); + Ptr pk = new_ptr("public.80.arbiter"); + Ptr sk = new_ptr("secret.80.arbiter"); + Ptr decrypter = new_ptr(pk, sk); BankTool bankTool("tool.80.bank"); - const BankParameters* params = new BankParameters("bank.80.params"); - Wallet wallet("wallet.80", params); + Ptr params = new_ptr("bank.80.params"); + Ptr wallet = new_ptr("wallet.80", params); - string trackerHashKey = vepk.getHashKey(); + string trackerHashKey = vepk->getHashKey(); ZZ R = RandomBits_ZZ(params->getCashGroup()->getOrderLength()); char buf[1024]; RAND_pseudo_bytes((unsigned char*) buf, sizeof(buf)); - Buffer* ptext = new Buffer(buf, sizeof(buf)); + Ptr ptext = new_ptr(buf, sizeof(buf)); hash_t ptHash = ptext->hash(hashAlg, trackerHashKey, hashType); // now let's create our buyer and seller objects - Buyer buyer(timeoutLength, &vepk, stat); - Seller seller(timeoutLength, timeoutTolerance, &vepk, stat); + Buyer buyer(timeoutLength, vepk, stat); + Seller seller(timeoutLength, timeoutTolerance, vepk, stat); // step 1: seller gives ciphertext to buyer startTimer(); - EncBuffer* ctext = seller.encrypt(ptext, encAlg); + Ptr ctext = seller.encrypt(ptext, encAlg); timers[timer++] = printTimer(timer, "Seller created ciphertext"); // step 2: buyer creates contract and verifiable escrow startTimer(); - BuyMessage* buyMessage = buyer.buy(&wallet, ctext, ptHash, R); + Ptr buyMessage = buyer.buy(wallet, ctext, ptHash, R); timers[timer++] = printTimer(timer, "Buyer created buy message"); // step 3: seller checks contract and escrow, returns key(s) if valid @@ -1830,7 +1854,7 @@ double* testBuyResolution() { buyer.pay(key); // so let's say arbiter needs to get involved - Arbiter arbiter(&veDecrypter, &decrypter, hashAlg, timeoutTolerance); + Arbiter arbiter(veDecrypter, decrypter, hashAlg, timeoutTolerance); // step 1: seller sends over relevant info to act as request startTimer(); @@ -1853,7 +1877,7 @@ double* testBuyResolution() { // step 3: the seller prepares a proof that his keys are valid startTimer(); - MerkleProof* proof = seller.resolveII(chal); + Ptr proof = seller.resolveII(chal); timers[timer++] = printTimer(timer, "The seller sent his proof back to " "the arbiter"); @@ -1885,41 +1909,41 @@ double* testBarterResolution() { cipher_t encAlg = "aes-128-ctr", signAlg = "DSA"; int hashType = Hash::TYPE_PLAIN; - const BankParameters* params = new BankParameters("bank.80.params"); - Wallet wallet("wallet.80", params); + Ptr params = new_ptr("bank.80.params"); + Ptr wallet = new_ptr("wallet.80", params); - VEPublicKey vepk("public.80.arbiter"); - VESecretKey vesk("secret.80.arbiter"); - VEDecrypter veDecrypter(&vepk, &vesk); + Ptr vepk = new_ptr("public.80.arbiter"); + Ptr vesk = new_ptr("secret.80.arbiter"); + Ptr veDecrypter = new_ptr(vepk, vesk); - VEPublicKey pk("public.regular.80.arbiter"); - VESecretKey sk("secret.regular.80.arbiter"); - VEDecrypter decrypter(&vepk, &vesk); + Ptr pk = new_ptr("public.regular.80.arbiter"); + Ptr sk = new_ptr("secret.regular.80.arbiter"); + Ptr decrypter = new_ptr(vepk, vesk); - string trackerHashKey = vepk.getHashKey(); + string trackerHashKey = vepk->getHashKey(); ZZ R = RandomBits_ZZ(params->getCashGroup()->getOrderLength()); // get random files for Alice and Bob char bufA[1024], bufB[1024]; RAND_pseudo_bytes((unsigned char*) bufA, sizeof(bufA)); RAND_pseudo_bytes((unsigned char*) bufB, sizeof(bufB)); - Buffer* aData = new Buffer(bufA, sizeof(bufA)); - Buffer* bData = new Buffer(bufB, sizeof(bufB)); + Ptr aData = new_ptr(bufA, sizeof(bufA)); + Ptr bData = new_ptr(bufB, sizeof(bufB)); hash_t aHash = aData->hash(hashAlg, trackerHashKey, hashType); hash_t bHash = bData->hash(hashAlg, trackerHashKey, hashType); // want to generate a signing key startTimer(); - Signature::Key* signKey = Signature::Key::generateKey(signAlg); + Ptr signKey = Signature::Key::generateKey(signAlg); timers[timer++] = printTimer(timer, "Signature key generated"); // create initiator and responder objects - FEInitiator alice(timeoutLength, &vepk, &pk, stat, signKey); - FEResponder bob(timeoutLength, timeoutTolerance, &vepk, &pk, stat); + FEInitiator alice(timeoutLength, vepk, pk, stat, signKey); + FEResponder bob(timeoutLength, timeoutTolerance, vepk, pk, stat); // step 1: Alice sends Bob a setup message startTimer(); - FESetupMessage* setupMsg = alice.setup(&wallet, R, signAlg); + Ptr setupMsg = alice.setup(wallet, R, signAlg); timers[timer++] = printTimer(timer, "Alice created setup message"); // step 2: Bob checks setup message and outputs his file ciphertext @@ -1929,19 +1953,19 @@ double* testBarterResolution() { cout << "The setup message was valid" << endl; else cout << "Verification of the setup message failed" << endl; - EncBuffer* bCipher = bob.startRound(bData, encAlg); + Ptr bCipher = bob.startRound(bData, encAlg); timers[timer++] = printTimer(timer, "Bob checked setup message and sent " "back his ciphertext"); // step 3: Alice sends her ciphertext startTimer(); - EncBuffer* aCipher = alice.continueRound(aData, encAlg); + Ptr aCipher = alice.continueRound(aData, encAlg); timers[timer++] = printTimer(timer, "Alice sent back her own ciphertext"); // step 4: Alice continues by preparing and sending a contract and // an escrow of her key (and her signature on it) startTimer(); - FEMessage* message = alice.barter(bCipher, bHash, aHash); + Ptr message = alice.barter(bCipher, bHash, aHash); timers[timer++] = printTimer(timer, "Alice sent the contract for bartering"); // step 5: Bob receives Alice's ciphertext and contract and checks @@ -1955,11 +1979,11 @@ double* testBarterResolution() { alice.giveKeys(bKey); // now let's say we need to get arbiter involved - Arbiter arbiter(&veDecrypter, &decrypter, hashAlg, timeoutTolerance); + Arbiter arbiter(veDecrypter, decrypter, hashAlg, timeoutTolerance); // step 1: responder sends request to arbiter startTimer(); - FEResolutionMessage* req = bob.resolveI(); + Ptr req = bob.resolveI(); timers[timer++] = printTimer(timer, "Bob sent resolution request to " "the arbiter"); @@ -1970,7 +1994,7 @@ double* testBarterResolution() { // step 3: Bob sends proof that his keys are valid startTimer(); - MerkleProof* proof = bob.resolveII(chal); + Ptr proof = bob.resolveII(chal); timers[timer++] = printTimer(timer, "Bob sent a proof that his keys " "were valid"); @@ -1997,7 +2021,7 @@ double* testBarterResolution() { // step 5: if Alice's key wasn't valid, Bob needs to prove this to // the arbiter startTimer(); - MerkleProof* badKeyProof = bob.resolveIII(aKey); + Ptr badKeyProof = bob.resolveIII(aKey); // step 6: finally, if Bob's proof (of Alice's bad key) is correct, // the arbiter will give him the endorsement @@ -2015,6 +2039,17 @@ double* testBarterResolution() { return timers; } +double* testSerializeZero() { + double* timers = new double[MAX_TIMERS]; + + ZZ z = 0, zz = 33; + string s = saveString(z); + loadString(zz, s); + cout << "loaded 0 zz " << zz << endl; + + return timers; +} + BOOST_CLASS_EXPORT(ASTNode) BOOST_CLASS_EXPORT(ASTExpr) BOOST_CLASS_EXPORT(ASTExprIdentifier) @@ -2025,8 +2060,8 @@ double* testSerializeAbstract() { double* timers = new double[MAX_TIMERS]; // test serializing base and derived pointers istringstream iss(string("g^x")); - ZKPLexer* lexer = new ZKPLexer(iss); - ZKPParser* parser = new ZKPParser(*lexer); + Ptr lexer(new ZKPLexer(iss)); + Ptr parser(new ZKPParser(*lexer)); ASTExprPtr n = parser->expr(); cout << "type of expr: " << type_to_str(typeid(*n)) << endl; diff --git a/src/Timer.cpp b/src/Timer.cpp index 4c159fc..8837b55 100644 --- a/src/Timer.cpp +++ b/src/Timer.cpp @@ -10,12 +10,24 @@ #include "CashException.h" #include #include +#include + +struct BrownieTimer { + vector timers; +}; +// use thread-local storage +boost::thread_specific_ptr localTimer; + +vector& getTimer() { + if (localTimer.get() == 0) + localTimer.reset(new BrownieTimer); + return localTimer->timers; +} -vector brownieTimerValue; void startTimer() { timeval t; gettimeofday(&t, NULL); - brownieTimerValue.push_back(t); + getTimer().push_back(t); } /* Determine the difference, in milliseconds, between two struct timevals. */ @@ -40,12 +52,12 @@ double printTimer(const int index, const string &msg) { long long elapsedTime() { timeval now; gettimeofday(&now, NULL); - if (brownieTimerValue.size() == 0) + if (getTimer().size() == 0) throw CashException(CashException::CE_TIMER_ERROR, "[Timer::printTimer] No running timer found. " "Maybe you forgot to start one?"); - long long elapsed = TV_DIFF_US(brownieTimerValue.back(), now); - brownieTimerValue.pop_back(); + long long elapsed = TV_DIFF_US(getTimer().back(), now); + getTimer().pop_back(); return elapsed; } diff --git a/src/UserTool.cpp b/src/UserTool.cpp index 19fcb3e..48aa7e2 100644 --- a/src/UserTool.cpp +++ b/src/UserTool.cpp @@ -1,12 +1,16 @@ #include "UserTool.h" -UserTool::UserTool(int st, int l, const BankParameters *bp, - const VEPublicKey &vPK, const VEPublicKey &rPK, +UserTool::UserTool(int st, int l, + Ptr bp, + Ptr vPK, + Ptr rPK, const hashalg_t &ha) - : stat(st), lx(l), bankParameters(new BankParameters(*bp)), - vepk(vPK), pk(rPK), hashAlg(ha) + : stat(st), lx(l), + bankParameters(bp), + vepk(vPK), pk(rPK), + hashAlg(ha) { - const GroupPrime* cashGroup = bankParameters->getCashGroup(); + Ptr cashGroup = bankParameters->getCashGroup(); userSecretKey = cashGroup->randomExponent(); // now compute user public key = g^sk_u @@ -21,7 +25,7 @@ UserTool::UserTool(int st, int l, const BankParameters *bp, v["sk_u"] = userSecretKey; // now compute proof and save it InterpreterProver p; - p.check(CommonFunctions::getZKPDir()+"/userid.txt", groups); + p.check(CommonFunctions::getZKPDir()+"/userid.txt", groups, false); p.compute(v); idProof = p.computeProof(hashAlg); } diff --git a/src/UserTool.h b/src/UserTool.h index 210832e..6719729 100644 --- a/src/UserTool.h +++ b/src/UserTool.h @@ -11,58 +11,52 @@ class UserTool { public: - UserTool(int st, int l, const BankParameters *bp, - const VEPublicKey &arbiterVPK, const VEPublicKey &arbiterPK, + UserTool(int st, int l, + Ptr bp, + Ptr arbiterVPK, + Ptr arbiterPK, const hashalg_t &ha); - UserTool(const UserTool &o) - : stat(o.stat), lx(o.lx), - bankParameters(new BankParameters(*o.bankParameters)), - vepk(o.vepk), pk(o.pk), userSecretKey(o.userSecretKey), - userPublicKey(o.userPublicKey), hashAlg(o.hashAlg), - idProof(o.idProof) {} - - UserTool(const char *fname, const BankParameters *bp, + UserTool(const char *fname, + Ptr bp, const char *fnameVEPK, const char *fnamePK) - : bankParameters(new BankParameters(*bp)), vepk(fnameVEPK), pk(fnamePK) - { loadFile(make_nvp("UserTool", *this), fname); } + : bankParameters(bp), + vepk(new_ptr(fnameVEPK)), + pk(new_ptr(fnamePK)) + { loadFile(make_nvp("UserTool", *this), fname); } - // XXX: this was causing a seg fault... - //~UserTool() { delete bankParameters; } - // getters ZZ getPublicKey() const { return userPublicKey; } - const VEPublicKey *getVEPublicKey() const { return &vepk; } SigmaProof getIdentityProof() const { return idProof; } - const BankParameters* getBankParameters() const { return bankParameters; } + Ptr getBankParameters() const { return bankParameters; } - UserWithdrawTool* getWithdrawTool(int walletSize, int coinDenom) const { - return new UserWithdrawTool(stat, lx, bankParameters, - userPublicKey, userSecretKey, - hashAlg, walletSize, coinDenom); - } + Ptr getWithdrawTool(int walletSize, int coinDenom) const { + return new_ptr(stat, lx, bankParameters, + userPublicKey, userSecretKey, + hashAlg, walletSize, coinDenom); + } /* Factory functions for user */ - Buyer* getBuyer(time_t timeout) const - { return new Buyer(timeout, &vepk, stat); } + Ptr getBuyer(time_t timeout) const + { return new_ptr(timeout, vepk, stat); } - Seller* getSeller(time_t timeout, int timeoutTolerance) const - { return new Seller(timeout, timeoutTolerance, &vepk, stat); } + Ptr getSeller(time_t timeout, int timeoutTolerance) const + { return new_ptr(timeout, timeoutTolerance, vepk, stat); } - Seller* getSeller(EncBuffer* ctext, int t, int timeoutTolerance) const - { return new Seller(ctext, t, timeoutTolerance, &vepk, stat); } + Ptr getSeller(Ptr ctext, int t, int timeoutTolerance) const + { return new_ptr(ctext, t, timeoutTolerance, vepk, stat); } - FEInitiator* getFEInitiator(time_t timeout) const - { return new FEInitiator(timeout, &vepk, &pk, stat); } + Ptr getFEInitiator(time_t timeout) const + { return new_ptr(timeout, vepk, pk, stat); } - FEResponder* getFEResponder(time_t t, int tolerance) const - { return new FEResponder(t, tolerance, &vepk, &pk, stat); } + Ptr getFEResponder(time_t t, int tolerance) const + { return new_ptr(t, tolerance, vepk, pk, stat); } private: int stat, lx; - const BankParameters *bankParameters; - VEPublicKey vepk; - VEPublicKey pk; + Ptr bankParameters; + Ptr vepk; + Ptr pk; ZZ userSecretKey; ZZ userPublicKey; hashalg_t hashAlg; diff --git a/src/UserWithdrawTool.cpp b/src/UserWithdrawTool.cpp index 0e44fc8..cde2148 100644 --- a/src/UserWithdrawTool.cpp +++ b/src/UserWithdrawTool.cpp @@ -3,29 +3,17 @@ #include "MultiExp.h" #include "Timer.h" -UserWithdrawTool::UserWithdrawTool(int st, int l, const BankParameters *bp, +UserWithdrawTool::UserWithdrawTool(int st, int l, Ptr bp, const ZZ &userPK, const ZZ &userSK, const hashalg_t &ha, int ws, int denom) : stat(st), lx(l), bankParameters(bp), userSecretKey(userSK), userPublicKey(userPK), hashAlg(ha), walletSize(ws), coinDenom(denom), - signatureRecipient(0), verified(false) + verified(false) { } -UserWithdrawTool::UserWithdrawTool(const UserWithdrawTool &o) - : stat(o.stat), lx(o.lx), bankParameters(o.bankParameters), - userSecretKey(o.userSecretKey), userPublicKey(o.userPublicKey), - hashAlg(o.hashAlg), walletSize(o.walletSize), - coinDenom(o.coinDenom), verified(o.verified) -{ -} - -UserWithdrawTool::~UserWithdrawTool() { - delete signatureRecipient; -} - ZZ UserWithdrawTool::createPartialCommitment() { - const GroupPrime* cashGroup = bankParameters->getCashGroup(); + Ptr cashGroup = bankParameters->getCashGroup(); // pick s' and t : s' and t should be in (Z, *, primeOrder) // ie. 1 <= s', t < primeOrder // where primeOrder is the order of the primeOrder group used for wallet @@ -77,7 +65,7 @@ ZZ UserWithdrawTool::createPartialCommitment() { return sPrimeCom; } -ProofMessage* UserWithdrawTool::initiateSignature(const ZZ &bankPart) { +Ptr UserWithdrawTool::initiateSignature(const ZZ &bankPart) { bankContribution = bankPart; createSignatureRecipient(); return preSignatureProof(); @@ -92,7 +80,7 @@ vector UserWithdrawTool::getIndividualCommitments() { return privateComs; } -ProofMessage* UserWithdrawTool::getCLProof() const { +Ptr UserWithdrawTool::getCLProof() const { vector > secrets; // first sk_u, then s, then t secrets.push_back(make_pair(userSecretKey, partialCommitment[0])); @@ -101,20 +89,20 @@ ProofMessage* UserWithdrawTool::getCLProof() const { return signatureRecipient->getC(secrets, hashAlg); } -ProofMessage* UserWithdrawTool::preSignatureProof() { +Ptr UserWithdrawTool::preSignatureProof() { // need to prove that commitment to sk_u and public key contain // the same value in the exponent InterpreterProver prover; group_map g; g["cashGroup"] = bankParameters->getCashGroup(); - prover.check(CommonFunctions::getZKPDir()+"/presig.txt", g); + prover.check(CommonFunctions::getZKPDir()+"/presig.txt", g, false); variable_map v; v["A"] = partialCommitment[1]; v["r_u"] = partialCommitment[0]; v["pk_u"] = userPublicKey; v["sk_u"] = userSecretKey; prover.compute(v); - return new ProofMessage(prover.getPublicVariables(), + return new_ptr(prover.getPublicVariables(), prover.computeProof(hashAlg)); } @@ -126,7 +114,7 @@ void UserWithdrawTool::createSignatureRecipient() { } // compute s = s' + r' - const GroupPrime* cGroup = bankParameters->getCashGroup(); + Ptr cGroup = bankParameters->getCashGroup(); ZZ sPrime = partialCommitment[2]; ZZ s = AddMod(sPrime, bankContribution, cGroup->getOrder()); this->s = s; @@ -143,9 +131,9 @@ void UserWithdrawTool::createSignatureRecipient() { // 3 private messages: sk_u, s, t // 1 public message: walletSize - const GroupRSA* pk = bankParameters->getBankKey(coinDenom); - const GroupPrime* comGroup = bankParameters->getCashGroup(); - signatureRecipient = new CLBlindRecipient(pk, comGroup, lx, coms, 3, 1); + Ptr pk = bankParameters->getBankKey(coinDenom); + Ptr comGroup = bankParameters->getCashGroup(); + signatureRecipient = new_ptr(pk, comGroup, lx, coms, 3, 1); printTimer("[UserWithdrawTool] created recipient"); } diff --git a/src/UserWithdrawTool.h b/src/UserWithdrawTool.h index 6422cf1..e5d1d9f 100644 --- a/src/UserWithdrawTool.h +++ b/src/UserWithdrawTool.h @@ -12,14 +12,10 @@ class UserWithdrawTool { public: - UserWithdrawTool(int stat, int lx, const BankParameters *bp, + UserWithdrawTool(int stat, int lx, Ptr bp, const ZZ &userPK, const ZZ &userSK, const hashalg_t &hashAlg, int walletSize, int denom); - UserWithdrawTool(const UserWithdrawTool &original); - - ~UserWithdrawTool(); - /*! stores the vector * (r_sku, A_sku, s', r_s', A_s', t, r_t, A_t) where : * r_sku = randomness in opening of commitment to user secret key @@ -37,13 +33,13 @@ class UserWithdrawTool { /*! returns a SigmaProof that the first secret in the commitment * C (from the CLBlindRecipient) is the user's secret Key */ - ProofMessage* initiateSignature(const ZZ &bankContribution); + Ptr initiateSignature(const ZZ &bankContribution); /*! return individual commitments to private messages */ vector getIndividualCommitments(); /*! return randomized proof from signature recipient */ - ProofMessage* getCLProof() const; + Ptr getCLProof() const; /*! verifies bank's PoKoDLR of 1/e and returns signature if * it is valid */ @@ -66,12 +62,12 @@ class UserWithdrawTool { /*! returns a SigmaProof that the A_sku commitment in the partial * commitment is the user's secret Key */ - ProofMessage* preSignatureProof(); + Ptr preSignatureProof(); ZZ s; // stored so we can use it to get wallet int stat, lx; - const BankParameters *bankParameters; - const GroupPrime *userKeyGroup; + Ptr bankParameters; + Ptr userKeyGroup; ZZ userSecretKey; ZZ userPublicKey; @@ -83,7 +79,7 @@ class UserWithdrawTool { vector partialCommitment; ZZ bankContribution; - CLBlindRecipient *signatureRecipient; + Ptr signatureRecipient; // store whether or not bank's PoK of 1/e is valid bool verified; diff --git a/src/VECiphertext.h b/src/VECiphertext.h index 7bc34c8..34b09e1 100644 --- a/src/VECiphertext.h +++ b/src/VECiphertext.h @@ -23,7 +23,7 @@ class VECiphertext { : ciphertext(o.ciphertext), commitment(o.commitment), publicVariables(o.publicVariables), proof(o.proof) {} - VECiphertext(const string& s) { loadString(*this, s); } + //VECiphertext(const string& s) { loadGZString(*this, s); } VECiphertext() : ciphertext(), commitment(0), publicVariables(), proof() {} diff --git a/src/VEDecrypter.cpp b/src/VEDecrypter.cpp index 13219d0..7fedd4c 100644 --- a/src/VEDecrypter.cpp +++ b/src/VEDecrypter.cpp @@ -6,19 +6,19 @@ #include "ZKP/InterpreterProver.h" VEDecrypter::VEDecrypter(const int m, const int modLength, const int stat) { - setup(m, modLength, stat, 0); + setup(m, modLength, stat, Ptr()); } VEDecrypter::VEDecrypter(const int m, const int modLength, const int stat, - GroupRSA* auxGroup) { + Ptr auxGroup) { setup(m, modLength, stat, auxGroup); } void VEDecrypter::setup(const int m, const int modLength, - const int stat, GroupRSA* auxGroup) { - GroupRSA group1("arbiter", modLength, stat); - ZZ bigN = group1.getModulus(); - ZZ bigP = group1.getP(); + const int stat, Ptr auxGroup) { + Ptr group1 = new_ptr(string("arbiter"), modLength, stat); + ZZ bigN = group1->getModulus(); + ZZ bigP = group1->getP(); ZZ bigQ = bigN / bigP; ZZ bigNsquared = power(bigN, 2); // f0 is random element of Z_{N^2}* @@ -26,10 +26,10 @@ void VEDecrypter::setup(const int m, const int modLength, while (GCD(f0, bigNsquared) != 1) { f0 = RandomBnd(bigNsquared); } - GroupSquareMod* grp = new GroupSquareMod("arbiter", bigNsquared, stat); + Ptr grp = new_ptr("arbiter", bigNsquared, stat); group_map g; variable_map v; - g["RSAGroup"] = &group1; + g["RSAGroup"] = group1; g["G"] = grp; v["f0"] = f0; @@ -58,31 +58,31 @@ void VEDecrypter::setup(const int m, const int modLength, xs[m] = env.variables.at("y"); xs[m+1] = env.variables.at("z"); - GroupRSA *group2; + Ptr group2; // if we weren't given a group, make one - if (auxGroup == 0) { + if (auxGroup.get() == 0) { group2 = createSecondGroup(m, modLength, stat); } else { - group2 = auxGroup; + group2 = new_ptr(*auxGroup); // calls clearSecrets later } ZZ n = group2->getModulus(); ZZ p = group2->getP(); ZZ q = n / p; - sk = new VESecretKey(bigP, bigQ, xs, p, q); + sk = new_ptr(bigP, bigQ, xs, p, q); group2->clearSecrets(); // XXX obviously this will not stay with hashKey as "" string hashKey = ""; // won't call HMAC hashalg_t hashAlg = Hash::SHA1; // XXX should be input parameter - pk = new VEPublicKey(bigN, as, b, d, e, f, *group2, hashAlg, hashKey); + pk = new_ptr(bigN, as, b, d, e, f, *group2, hashAlg, hashKey); } -GroupRSA* VEDecrypter::createSecondGroup(const int m, const int modLength, +Ptr VEDecrypter::createSecondGroup(const int m, const int modLength, const int stat) { // now initialize second group - GroupRSA *group2 = new GroupRSA("arbiter", modLength, stat); + Ptr group2 = new_ptr("arbiter", modLength, stat); for (int i = 0; i < m; i++) { // create m additional generators group2->addNewGenerator(); diff --git a/src/VEDecrypter.h b/src/VEDecrypter.h index 5d84158..1d0076b 100644 --- a/src/VEDecrypter.h +++ b/src/VEDecrypter.h @@ -20,11 +20,11 @@ class VEDecrypter { * appropriate RSA group will be created in the course of the setup */ VEDecrypter(const int m, const int modLength, const int stat); VEDecrypter(const int m, const int modLength, const int stat, - GroupRSA* auxGroup); + Ptr auxGroup); /*! also allow the setup to be done elsewhere and the decrypter to * just be handed the public/secret keys */ - VEDecrypter(VEPublicKey *p, VESecretKey *s) : pk(p), sk(s) {} + VEDecrypter(Ptr p, Ptr s) : pk(p), sk(s) {} /*! copy constructor */ VEDecrypter(const VEDecrypter& o) : pk(o.pk), sk(o.sk) {} @@ -38,21 +38,21 @@ class VEDecrypter { const string &label, const hashalg_t &hashAlg) const; // getters - VEPublicKey* getPK() { return pk; } - VESecretKey* getSK() { return sk; } + Ptr getPK() { return pk; } + Ptr getSK() { return sk; } private: /*! does the key generation for verifiable encryption (so sets the * public and secret keys) */ void setup(const int m, const int modLength, const int stat, - GroupRSA* auxGroup); + Ptr auxGroup); /*! creates a group with the appropriate number of generators and * modLength */ - GroupRSA* createSecondGroup(const int m, const int modLength, - const int stat); - VEPublicKey *pk; - VESecretKey *sk; + Ptr createSecondGroup(const int m, const int modLength, + const int stat); + Ptr pk; + Ptr sk; }; #endif /*VEDECRYPTER_H_*/ diff --git a/src/VEProver.cpp b/src/VEProver.cpp index b1855b0..27589aa 100644 --- a/src/VEProver.cpp +++ b/src/VEProver.cpp @@ -11,9 +11,9 @@ vector VEProver::encrypt(const vector &messages, const string &label, Environment e; // first create and give in our group ZZ bigN = pk->getN(); - e.groups["RSAGroup"] = new GroupRSA("arbiter", bigN, stat); + e.groups["RSAGroup"] = new_ptr(string("arbiter"), bigN, stat); ZZ bigNSquared = power(bigN, 2); - e.groups["G"] = new GroupSquareMod("arbiter", bigNSquared, stat); + e.groups["G"] = new_ptr("arbiter", bigNSquared, stat); // now add in elements e.variables["f"] = pk->getF(); e.variables["b"] = pk->getB(); @@ -82,14 +82,14 @@ vector VEProver::encrypt(const vector &messages, const string &label, VECiphertext VEProver::verifiableEncrypt(const ZZ &commitment, const vector &opening, - const Group* grp, const string &label, + Ptr grp, const string &label, const hashalg_t &hashAlg, int stat) { // if we run encrypt, environment will have most of the information we need vector ciphertext = encrypt(opening, label, hashAlg, stat); // now need some more group information env.groups["cashGroup"] = grp; - const GroupRSA* second = new GroupRSA(pk->getSecondGroup()); + Ptr second = new_ptr(pk->getSecondGroup()); env.groups["secondGroup"] = second; env.variables["X"] = commitment; diff --git a/src/VEProver.h b/src/VEProver.h index 0513e71..f2e76b3 100644 --- a/src/VEProver.h +++ b/src/VEProver.h @@ -13,7 +13,7 @@ class VEProver { public: /*! constructor: takes in a VE public key as generated by the * arbiter (decrypter) */ - VEProver(const VEPublicKey* pk) : pk(pk) {} + VEProver(Ptr pk) : pk(pk) {} /*! copy constructor */ VEProver(const VEProver& o) : pk(o.pk) {} @@ -32,14 +32,14 @@ class VEProver { * proof that this is true. */ VECiphertext verifiableEncrypt(const ZZ &commitment, const vector &opening, - const Group* grp, const string &label, + Ptr grp, const string &label, const hashalg_t &hashAlg, int stat); vector encrypt(const vector &messages, const string &label, const hashalg_t &hashAlg, int stat); private: - const VEPublicKey* pk; + Ptr pk; Environment env; }; diff --git a/src/VEVerifier.cpp b/src/VEVerifier.cpp index fdb32fc..4451cfc 100644 --- a/src/VEVerifier.cpp +++ b/src/VEVerifier.cpp @@ -5,7 +5,7 @@ #include "Timer.h" bool VEVerifier::verify(const VECiphertext& text, const ZZ& x, - const Group *grp, const string& label, + Ptr grp, const string& label, const hashalg_t& hashAlg, int stat) { // set everything up (a lot like the prover side) Environment env; @@ -25,10 +25,10 @@ bool VEVerifier::verify(const VECiphertext& text, const ZZ& x, // set up all groups env.groups["cashGroup"] = grp; ZZ bigN = pk->getN(); - env.groups["RSAGroup"] = new GroupRSA("arbiter", bigN, stat); + env.groups["RSAGroup"] = new_ptr("arbiter", bigN, stat); ZZ bigNSquared = power(bigN, 2); - env.groups["G"] = new GroupSquareMod("arbiter", bigNSquared, stat); - const GroupRSA* second = new GroupRSA(pk->getSecondGroup()); + env.groups["G"] = new_ptr("arbiter", bigNSquared, stat); + Ptr second = new_ptr(pk->getSecondGroup()); env.groups["secondGroup"] = second; input_map inputs; inputs["m"] = text.getCiphertext().size() - 2; diff --git a/src/VEVerifier.h b/src/VEVerifier.h index c7b77fb..a5353ea 100644 --- a/src/VEVerifier.h +++ b/src/VEVerifier.h @@ -8,7 +8,7 @@ class VEVerifier { public: /*! constructor takes in the decrypter's public key */ - VEVerifier(const VEPublicKey *pk) : pk(pk) {} + VEVerifier(Ptr pk) : pk(pk) {} /*! copy constructor */ VEVerifier(const VEVerifier &original) : pk(original.pk) {} @@ -19,11 +19,11 @@ class VEVerifier { /*! given the output of a VEProver, checks to see that it is correct * (i.e. accepts or rejects the proof that the value contained in the * ciphertext corresponds to the opening of commitment x) */ - bool verify(const VECiphertext &text, const ZZ &x, const Group* grp, + bool verify(const VECiphertext &text, const ZZ &x, Ptr grp, const string &label, const hashalg_t &hashAlg, int stat); private: - const VEPublicKey* pk; + Ptr pk; }; #endif /*_VEVERIFIER_H_*/ diff --git a/src/Wallet.cpp b/src/Wallet.cpp index e377695..e444e31 100644 --- a/src/Wallet.cpp +++ b/src/Wallet.cpp @@ -2,7 +2,7 @@ #include "Wallet.h" Wallet::Wallet(const ZZ &sk, const ZZ &sIn, const ZZ &tIn, int size, - int d, const BankParameters* bp, int st, int l, + int d, Ptr bp, int st, int l, const hashalg_t &alg, const vector &sig) : sk_u(sk), s(sIn), t(tIn), walletSize(size), coinDenom(d), numCoinsUsed(0), params(bp), stat(st), lx(l), hashAlg(alg), @@ -48,18 +48,17 @@ int Wallet::nextCoinIndex() { return spendOrder[numCoinsUsed++]; } -Coin Wallet::nextCoin(const ZZ &rValue) { +Ptr Wallet::nextCoin(const ZZ &rValue) { int i = nextCoinIndex(); - Coin* c = newCoin(rValue, i); - Coin ret(*c); - delete c; - return ret; + return newCoin(rValue, i); } -Coin* Wallet::newCoin(const ZZ &rValue, int coinIndex) { - return new Coin(params, walletSize, coinIndex, - sk_u, s, t, signature, stat, - lx, rValue, coinDenom, hashAlg); +Ptr Wallet::newCoin(const ZZ &rValue, int coinIndex) { + // XXX new_ptr/make_shared supports only <= 9 constructor args + Ptr ret(new Coin(params, walletSize, coinIndex, + sk_u, s, t, signature, stat, + lx, rValue, coinDenom, hashAlg)); + return ret; } void Wallet::newCoin(Coin& coin, const ZZ &rValue, int coinIndex) { diff --git a/src/Wallet.h b/src/Wallet.h index b9002b9..2c1037c 100644 --- a/src/Wallet.h +++ b/src/Wallet.h @@ -5,16 +5,15 @@ #include "Coin.h" class Wallet { - public: Wallet(const ZZ &sk, const ZZ &sIn, const ZZ &tIn, int size, - int d, const BankParameters* b, int st, int l, + int d, Ptr b, int st, int l, const hashalg_t &alg, const vector &sig); Wallet(const Wallet &o); /*! constructor to load from file */ - Wallet(const char* fname, const BankParameters* bp) + Wallet(const char* fname, Ptr bp) : params(bp) { loadFile(make_nvp("Wallet", *this), fname); } @@ -23,10 +22,10 @@ class Wallet { int nextCoinIndex(); /*! returns the next coin to use */ - Coin nextCoin(const ZZ &R); + Ptr nextCoin(const ZZ &R); /*! returns a coin for a given index */ - Coin* newCoin(const ZZ &R, int coinIndex); + Ptr newCoin(const ZZ &R, int coinIndex); void newCoin(Coin& coin, const ZZ &R, int coinIndex); bool replaceCoin(ZZ &index); @@ -45,7 +44,7 @@ class Wallet { int coinDenom; int numCoinsUsed; - const BankParameters* params; + Ptr params; int stat; int lx; hashalg_t hashAlg; diff --git a/src/ZKP/ASTNode.cpp b/src/ZKP/ASTNode.cpp index 90147c5..b359404 100644 --- a/src/ZKP/ASTNode.cpp +++ b/src/ZKP/ASTNode.cpp @@ -130,9 +130,9 @@ ZZ ASTAdd::eval(Environment &env) { return lhs->eval(env) + rhs->eval(env); } else { - const Group* lGroup = env.groups.at(leftInfo.group); - const Group* rGroup = env.groups.at(rightInfo.group); - const Group* retGroup = (lGroup != 0 ? lGroup : rGroup); + Ptr lGroup = env.groups.at(leftInfo.group); + Ptr rGroup = env.groups.at(rightInfo.group); + Ptr retGroup = (lGroup != 0 ? lGroup : rGroup); assert(retGroup); ZZ mod = retGroup->getModulus(); return AddMod(lhs->eval(env), rhs->eval(env), mod); @@ -151,9 +151,9 @@ ZZ ASTSub::eval(Environment &env) { return lhs->eval(env) - rhs->eval(env); } else { - const Group* lGroup = env.groups.at(leftInfo.group); - const Group* rGroup = env.groups.at(rightInfo.group); - const Group* retGroup = (lGroup != 0 ? lGroup : rGroup); + Ptr lGroup = env.groups.at(leftInfo.group); + Ptr rGroup = env.groups.at(rightInfo.group); + Ptr retGroup = (lGroup != 0 ? lGroup : rGroup); assert(retGroup); ZZ mod = retGroup->getModulus(); return SubMod(lhs->eval(env), rhs->eval(env), mod); @@ -172,9 +172,9 @@ ZZ ASTMul::eval(Environment &env) { return lhs->eval(env) * rhs->eval(env); } else { - const Group* lGroup = env.groups.at(leftInfo.group); - const Group* rGroup = env.groups.at(rightInfo.group); - const Group* retGroup = (lGroup != 0 ? lGroup : rGroup); + Ptr lGroup = env.groups.at(leftInfo.group); + Ptr rGroup = env.groups.at(rightInfo.group); + Ptr retGroup = (lGroup != 0 ? lGroup : rGroup); assert(retGroup); ZZ mod = retGroup->getModulus(); return MulMod(lhs->eval(env), rhs->eval(env), mod); @@ -187,9 +187,9 @@ ZZ ASTDiv::eval(Environment &env) { VarInfo rightInfo = p.second; // XXX: this will cause a problem if we ever try to use // it during constant propagation/substitution - const Group* lGroup = env.groups.at(leftInfo.group); - const Group* rGroup = env.groups.at(rightInfo.group); - const Group* retGroup = (lGroup != 0 ? lGroup : rGroup); + Ptr lGroup = env.groups.at(leftInfo.group); + Ptr rGroup = env.groups.at(rightInfo.group); + Ptr retGroup = (lGroup != 0 ? lGroup : rGroup); // integers can just be divided if ((lGroup == 0 && rGroup == 0) || (leftInfo.type == VarInfo::MODULUS @@ -211,6 +211,7 @@ ZZ ASTDiv::eval(Environment &env) { ZZ right = InvMod(rhs->eval(env), ord); return lhs->eval(env) * right; } else { + cout << "ORDER " << retGroup->getOrder() << endl; throw CashException(CashException::CE_PARSE_ERROR, "That operation is not permitted in an RSA group"); } @@ -227,7 +228,7 @@ ZZ ASTPow::eval(Environment &env) { info = lhs->getExprType(env); else info = env.exprTypes.at(lhs->toString()); - const Group* lGroup = env.groups.at(info.group); + Ptr lGroup = env.groups.at(info.group); // if base is an exponent or integer, do it over integers if (lGroup == 0 || info.type == VarInfo::EXPONENT) { return power(lhs->eval(env), to_int(rhs->eval(env))); diff --git a/src/ZKP/ASTNode.h b/src/ZKP/ASTNode.h index e1a89a6..081571e 100644 --- a/src/ZKP/ASTNode.h +++ b/src/ZKP/ASTNode.h @@ -45,7 +45,7 @@ struct VarInfo { class ASTNode { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; virtual void visit(ASTVisitor& v) = 0; virtual void visitChildren(ASTVisitor& v) = 0; virtual ~ASTNode() {} @@ -68,7 +68,7 @@ class ASTIdentifierLit : public ASTNode, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents simple variable names, i.e. 'x' */ ASTIdentifierLit(string n, int l, int c) : name(n), line(l), column(c) {} @@ -108,7 +108,7 @@ class ASTIdentifierSub : public ASTNode, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents slightly more complex variable names, such * as x_1 */ ASTIdentifierSub(ASTIdentifierLitPtr b, string s) : base(b), sub(s) {} @@ -164,7 +164,7 @@ class ASTDeclIdentifierLit : public ASTDeclGeneral, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a variable name such as 'x' as it is being * declared, either on the left-hand side of a declaration * (so 'x := a * b') or in a list, such as 'exponent in G: x' */ @@ -194,13 +194,13 @@ class ASTDeclIdentifierLit : public ASTDeclGeneral, } }; typedef ASTDeclIdentifierLit::ptr_t ASTDeclIdentifierLitPtr; -typedef boost::shared_ptr ASTIdentifierLitPtr; +typedef Ptr ASTIdentifierLitPtr; class ASTDeclIdentifierSub : public ASTDeclGeneral, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a variable name such as 'x_1' as it is being * declared, either on the left-hand side of a declaration * (so 'x_1 := a * b') or in a list, such as 'exponent in G: x_1' */ @@ -241,7 +241,7 @@ typedef ASTDeclIdentifierSub::ptr_t ASTDeclIdentifierSubPtr; class ASTExpr : public ASTNode { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents the parent class for all our arithmetic * expressions, as well as the variables that are used in those * expressions */ @@ -257,7 +257,7 @@ class ASTExpr : public ASTNode { // clone sub-trees via a "virtual constructor", as in // http://www.parashift.com/c++-faq-lite/virtual-functions.html#faq-20.8 - virtual boost::shared_ptr clone() const = 0; + virtual Ptr clone() const = 0; private: friend class boost::serialization::access; @@ -266,14 +266,14 @@ class ASTExpr : public ASTNode { } }; typedef ASTExpr::ptr_t ASTExprPtr; -typedef boost::shared_ptr ASTExprPtr; +typedef Ptr ASTExprPtr; BOOST_SERIALIZATION_ASSUME_ABSTRACT(ASTExpr) class ASTExprInt : public ASTExpr, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents an integer literal such as '1' or '2' as * it is being used in an arithmetic expression */ ASTExprInt() {} @@ -307,7 +307,7 @@ class ASTExprIdentifier : public ASTExpr, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a variable such as 'x' or 'x_1' as it * is being used in an arithmetic expression */ ASTExprIdentifier(ASTIdentifierSubPtr i) : id(i) {} @@ -344,7 +344,7 @@ typedef ASTExprIdentifier::ptr_t ASTExprIdentifierPtr; class ASTUnaryOp : public ASTExpr { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents an operation on one variable or expression */ ASTUnaryOp(ASTExprPtr e) : expr(e) {} @@ -372,7 +372,7 @@ class ASTNegative : public ASTUnaryOp, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! given a variable 'x' (or a more complex expression), this class * represents -x */ ASTNegative(ASTExprPtr expr) : ASTUnaryOp(expr) {} @@ -398,7 +398,7 @@ typedef ASTNegative::ptr_t ASTNegativePtr; class ASTBinaryOp : public ASTExpr { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents operations on two variables or expressions * and so it stores a left-hand side and a right-hand side */ ASTBinaryOp(ASTExprPtr lhs, ASTExprPtr rhs) : lhs(lhs), rhs(rhs) {} @@ -438,7 +438,7 @@ class ASTAdd : public ASTBinaryOp, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents the addition of its two input expressions */ ASTAdd(ASTExprPtr lhs, ASTExprPtr rhs) : ASTBinaryOp(lhs,rhs) {} ASTExprPtr clone() const { return ptr_t(new ASTAdd(*this)); } @@ -470,7 +470,7 @@ class ASTSub : public ASTBinaryOp, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents the subtraction of the right-hand side * from the left-hand side */ ASTSub(ASTExprPtr lhs, ASTExprPtr rhs) : ASTBinaryOp(lhs,rhs) {} @@ -503,7 +503,7 @@ class ASTMul : public ASTBinaryOp, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents the multiplication of its two input * expressions */ ASTMul(ASTExprPtr lhs, ASTExprPtr rhs) : ASTBinaryOp(lhs,rhs) {} @@ -536,7 +536,7 @@ class ASTDiv : public ASTBinaryOp, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents the division of the right-hand side from * the left-hand side */ ASTDiv(ASTExprPtr lhs, ASTExprPtr rhs) : ASTBinaryOp(lhs,rhs) {} @@ -571,7 +571,7 @@ class ASTPow : public ASTBinaryOp, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents raising the left-hand side to the * right-hand side */ ASTPow(ASTExprPtr base, ASTExprPtr exp) : ASTBinaryOp(base,exp) {} @@ -606,7 +606,7 @@ class ASTList : public ASTNode, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class is the parent class for any type of parameterized list */ ASTList() {} @@ -639,7 +639,7 @@ typedef ASTList::ptr_t ASTListPtr; class ASTListIdentifierLit : public ASTList { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a list of variables 'x, y, z', etc */ ASTIdentifierLitPtr getLit(int x) { return dynamic_pointer_cast(list[x]); } @@ -658,7 +658,7 @@ typedef ASTListIdentifierLit::ptr_t ASTListIdentifierLitPtr; class ASTListIdentifierSub : public ASTList { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a list of variables 'x_1, x_2', etc */ ASTListIdentifierSub() {} @@ -693,7 +693,7 @@ typedef ASTListIdentifierSub::ptr_t ASTListIdentifierSubPtr; class ASTListDecl : public ASTList { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class is used as a parent for any list of declarations */ void visit(ASTVisitor& v){ v.applyASTListDecl(dynamic_pointer_cast(shared_from_this())); } @@ -708,7 +708,7 @@ typedef ASTListDecl::ptr_t ASTListDeclPtr; class ASTListDeclIdentifierLit : public ASTListDecl { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this represents a list of variables 'x, y, z' that are * being declared within the list */ void visit(ASTVisitor& v) { @@ -727,7 +727,7 @@ typedef ASTListDeclIdentifierLit::ptr_t ASTListDeclIdentifierLitPtr; class ASTListDeclIdentifierSub : public ASTListDecl { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this represents a list of variables 'x_1, x_2, x_3' that are * being declared within the list */ void visit(ASTVisitor& v) { @@ -747,7 +747,7 @@ class ASTDeclIDRange : public ASTDeclGeneral, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this represents a variable declaration of the form 'x[1:3]', which * is shorthand for declaring 'x_1, x_2, x_3' */ ASTDeclIDRange(ASTDeclIdentifierLitPtr b, ASTExprPtr lbound, ASTExprPtr ubound) @@ -808,7 +808,7 @@ typedef ASTDeclIDRange::ptr_t ASTDeclIDRangePtr; class ASTRelation : public ASTNode { public : - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents the relations between variables we will * want to be proving in our zero-knowledge proof */ virtual ptr_t clone() const = 0; @@ -825,7 +825,7 @@ class ASTForRel : public ASTRelation, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a line of the form * 'for(i, 1:4, c_i = g^x_i * h^r_i)' */ ASTForRel(ASTIdentifierLitPtr index, ASTExprPtr lbound, @@ -876,7 +876,7 @@ class ASTEqual : public ASTRelation, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a line of the form 'id = expr' */ ASTEqual(ASTIdentifierSubPtr i, ASTExprPtr e) : id(i), expr(e) {} @@ -913,7 +913,7 @@ class ASTCommitment : public ASTRelation, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a line of the form * 'commitment to x: c_x = g^x * h^r_x' */ ASTCommitment(ASTListIdentifierSubPtr c, ASTIdentifierSubPtr i, ASTExprPtr e) @@ -956,7 +956,7 @@ typedef ASTCommitment::ptr_t ASTCommitmentPtr; class ASTGiven : public ASTNode { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class is used to represent blocks of declarations */ ASTGiven(ASTListDeclPtr items) : items(items) {} @@ -978,7 +978,7 @@ class ASTRandomPrime : public ASTGiven, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a line of the form * 'random prime(s) of length {length}: idList */ ASTRandomPrime(ASTExprPtr length, ASTListDeclPtr idList) : @@ -1012,7 +1012,7 @@ class ASTRandomBnd : public ASTGiven, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a line of the form * 'random integer(s) in [lbound, ubound): idList */ ASTRandomBnd(ASTExprPtr lbound, ASTExprPtr ubound, ASTListDeclPtr idList) : @@ -1050,7 +1050,7 @@ class ASTDeclGroup : public ASTGiven, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a line of the form * 'group: G = * modulus: N', where specifying both the generators and the @@ -1090,7 +1090,7 @@ class ASTDeclIntegers : public ASTGiven, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a list such as 'integers: stat, m, l_x' */ ASTDeclIntegers(ASTListDeclPtr i) : ASTGiven(i) {} @@ -1112,7 +1112,7 @@ typedef ASTDeclIntegers::ptr_t ASTDeclIntegersPtr; class ASTListGiven : public ASTList { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a list of declarations that appear in * the given block of a program */ void visit(ASTVisitor& v) { @@ -1131,7 +1131,7 @@ typedef ASTListGiven::ptr_t ASTListGivenPtr; class ASTListRandoms : public ASTList { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a collection of random computations, * such as computing random primes, computing random integers in * a given range, and computing random exponents in a given group */ @@ -1151,7 +1151,7 @@ typedef ASTListRandoms::ptr_t ASTListRandomsPtr; class ASTListRelation : public ASTList { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a list of relations that will appear in * the 'such that' block of the program */ void visit(ASTVisitor& v) { @@ -1171,7 +1171,7 @@ class ASTDeclElements : public ASTGiven, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a declaration of group elements such as * 'elements in G: A, B, c[1:3]', with an optional area for declaring * relations (specifically for specifying the forms of commitments) */ @@ -1209,7 +1209,7 @@ class ASTDeclExponents : public ASTGiven, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a list of declarations of exponents, such as * 'exponents in G: a, b, c' */ ASTDeclExponents(ASTIdentifierLitPtr g, ASTListDeclPtr e) @@ -1241,7 +1241,7 @@ class ASTDeclRandExponents : public ASTGiven, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a list of declarations of random exponents * (only to be used in the compute block), such as * 'random exponents in G: r_a, r_b, r_c' */ @@ -1274,7 +1274,7 @@ class ASTDeclEqual : public ASTRelation, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a line of the form 'x := a * b */ ASTDeclEqual(ASTDeclIdentifierSubPtr i, ASTExprPtr e) : id(i), expr(e) {} @@ -1313,7 +1313,7 @@ class ASTRange : public ASTRelation, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class is the parent for two types of ranges */ ASTRange(ASTIdentifierLitPtr g, ASTExprPtr l, bool ls, ASTExprPtr c, bool us, ASTExprPtr u) @@ -1371,7 +1371,7 @@ class ASTForExpr : public ASTExpr, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents a line of the form * 'for(i, 1:3, *, g^x_i)' */ ASTForExpr(ASTIdentifierLitPtr i, ASTExprPtr l, ASTExprPtr u, @@ -1440,7 +1440,7 @@ class ASTComputation : public ASTNode, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents an entire computation block, in particular * the given block, and the two parts of the compute block: the * random computations and the declEqual computations */ @@ -1479,7 +1479,7 @@ class ASTProof : public ASTNode, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents an entire proof block: the given block, * the 'prove knowledge of' block, and the 'such that' block */ ASTProof(ASTListGivenPtr g, ASTListGivenPtr k, ASTListRelationPtr s) @@ -1517,7 +1517,7 @@ class ASTSpec : public ASTNode, public boost::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef Ptr ptr_t; /*! this class represents the whole program, consisting of the * computation block and the proof block (both of which are * optional) */ diff --git a/src/ZKP/ASTVisitor.h b/src/ZKP/ASTVisitor.h index 6d21ba0..5d747f5 100644 --- a/src/ZKP/ASTVisitor.h +++ b/src/ZKP/ASTVisitor.h @@ -2,6 +2,7 @@ #define _ASTVISITOR_H_ #include +#include "new_ptr.hpp" class ASTNode; class ASTIdentifierLit; @@ -52,65 +53,65 @@ class ASTVisitor { public: virtual ~ASTVisitor() {} - virtual void applyASTNode(boost::shared_ptr n) = 0; + virtual void applyASTNode(Ptr n) = 0; //Lists - virtual void applyASTList(boost::shared_ptr n) = 0; - virtual void applyASTListIdentifierLit(boost::shared_ptr n) = 0; - virtual void applyASTListIdentifierSub(boost::shared_ptr n) = 0; - virtual void applyASTListDeclIdentifierLit(boost::shared_ptr n) = 0; - virtual void applyASTListDeclIdentifierSub(boost::shared_ptr n) = 0; - virtual void applyASTListRelation(boost::shared_ptr n) = 0; - virtual void applyASTListGiven(boost::shared_ptr n) = 0; - virtual void applyASTListRandoms(boost::shared_ptr n) = 0; - virtual void applyASTListDecl(boost::shared_ptr n) = 0; - virtual void applyASTDeclIDRange(boost::shared_ptr n) = 0; + virtual void applyASTList(Ptr n) = 0; + virtual void applyASTListIdentifierLit(Ptr n) = 0; + virtual void applyASTListIdentifierSub(Ptr n) = 0; + virtual void applyASTListDeclIdentifierLit(Ptr n) = 0; + virtual void applyASTListDeclIdentifierSub(Ptr n) = 0; + virtual void applyASTListRelation(Ptr n) = 0; + virtual void applyASTListGiven(Ptr n) = 0; + virtual void applyASTListRandoms(Ptr n) = 0; + virtual void applyASTListDecl(Ptr n) = 0; + virtual void applyASTDeclIDRange(Ptr n) = 0; //Expressions - virtual void applyASTExpr(boost::shared_ptr n) = 0; - virtual void applyASTExprInt(boost::shared_ptr n) = 0; - virtual void applyASTUnaryOp(boost::shared_ptr n) = 0; - virtual void applyASTBinaryOp(boost::shared_ptr n) = 0; - virtual void applyASTNegative(boost::shared_ptr n) = 0; - virtual void applyASTExprIdentifier(boost::shared_ptr n) = 0; - virtual void applyASTPow(boost::shared_ptr n) = 0; - virtual void applyASTMul(boost::shared_ptr n) = 0; - virtual void applyASTDiv(boost::shared_ptr n) = 0; - virtual void applyASTAdd(boost::shared_ptr n) = 0; - virtual void applyASTSub(boost::shared_ptr n) = 0; + virtual void applyASTExpr(Ptr n) = 0; + virtual void applyASTExprInt(Ptr n) = 0; + virtual void applyASTUnaryOp(Ptr n) = 0; + virtual void applyASTBinaryOp(Ptr n) = 0; + virtual void applyASTNegative(Ptr n) = 0; + virtual void applyASTExprIdentifier(Ptr n) = 0; + virtual void applyASTPow(Ptr n) = 0; + virtual void applyASTMul(Ptr n) = 0; + virtual void applyASTDiv(Ptr n) = 0; + virtual void applyASTAdd(Ptr n) = 0; + virtual void applyASTSub(Ptr n) = 0; - virtual void applyASTForExpr(boost::shared_ptr n) = 0; - virtual void applyASTForRel(boost::shared_ptr n) = 0; + virtual void applyASTForExpr(Ptr n) = 0; + virtual void applyASTForRel(Ptr n) = 0; //Relations - virtual void applyASTRelation(boost::shared_ptr n) = 0; - virtual void applyASTEqual(boost::shared_ptr n) = 0; - virtual void applyASTCommitment(boost::shared_ptr n) = 0; - virtual void applyASTRange(boost::shared_ptr n) = 0; - virtual void applyASTDeclEqual(boost::shared_ptr n) = 0; - virtual void applyASTRandomBnd(boost::shared_ptr n) = 0; - virtual void applyASTRandomPrime(boost::shared_ptr n) = 0; + virtual void applyASTRelation(Ptr n) = 0; + virtual void applyASTEqual(Ptr n) = 0; + virtual void applyASTCommitment(Ptr n) = 0; + virtual void applyASTRange(Ptr n) = 0; + virtual void applyASTDeclEqual(Ptr n) = 0; + virtual void applyASTRandomBnd(Ptr n) = 0; + virtual void applyASTRandomPrime(Ptr n) = 0; //Declarations - virtual void applyASTDeclIdentifierLit(boost::shared_ptr n) = 0; - virtual void applyASTDeclIdentifierSub(boost::shared_ptr n) = 0; + virtual void applyASTDeclIdentifierLit(Ptr n) = 0; + virtual void applyASTDeclIdentifierSub(Ptr n) = 0; //"Given" Constructions - virtual void applyASTGiven(boost::shared_ptr n) = 0; - virtual void applyASTDeclElements(boost::shared_ptr n) = 0; - virtual void applyASTDeclExponents(boost::shared_ptr n) = 0; - virtual void applyASTDeclRandExponents(boost::shared_ptr n) = 0; - virtual void applyASTDeclGroup(boost::shared_ptr n) = 0; - virtual void applyASTDeclIntegers(boost::shared_ptr n) = 0; + virtual void applyASTGiven(Ptr n) = 0; + virtual void applyASTDeclElements(Ptr n) = 0; + virtual void applyASTDeclExponents(Ptr n) = 0; + virtual void applyASTDeclRandExponents(Ptr n) = 0; + virtual void applyASTDeclGroup(Ptr n) = 0; + virtual void applyASTDeclIntegers(Ptr n) = 0; //The Core Constructions - virtual void applyASTProof(boost::shared_ptr n) = 0; - virtual void applyASTComputation(boost::shared_ptr n) = 0; - virtual void applyASTSpec(boost::shared_ptr n) = 0; + virtual void applyASTProof(Ptr n) = 0; + virtual void applyASTComputation(Ptr n) = 0; + virtual void applyASTSpec(Ptr n) = 0; //Other - virtual void applyASTIdentifierLit(boost::shared_ptr n) = 0; - virtual void applyASTIdentifierSub(boost::shared_ptr n) = 0; + virtual void applyASTIdentifierLit(Ptr n) = 0; + virtual void applyASTIdentifierSub(Ptr n) = 0; }; #endif /*_ASTVISITOR_H_*/ diff --git a/src/ZKP/BindGroupValues.cpp b/src/ZKP/BindGroupValues.cpp index 07cccbc..de2bf1d 100644 --- a/src/ZKP/BindGroupValues.cpp +++ b/src/ZKP/BindGroupValues.cpp @@ -6,7 +6,7 @@ void BindGroupValues::applyASTDeclGroup(ASTDeclGroupPtr n) { string grpname = n->getGroup()->getName(); - const Group* grp = env.groups.at(grpname); + Ptr grp = env.groups.at(grpname); ASTListDeclPtr gens = n->getItems(); // first bind modulus if it has been specified diff --git a/src/ZKP/ComputationVisitor.cpp b/src/ZKP/ComputationVisitor.cpp index 8952d33..1d6f8fe 100644 --- a/src/ZKP/ComputationVisitor.cpp +++ b/src/ZKP/ComputationVisitor.cpp @@ -5,7 +5,7 @@ void ComputationVisitor::applyASTDeclRandExponents(ASTDeclRandExponentsPtr n) { ASTListDeclPtr exps = n->getExponents(); ASTIdentifierLitPtr grpname = n->getGroup(); - const Group* grp = env.groups.at(grpname->getName()); + Ptr grp = env.groups.at(grpname->getName()); ASTDeclIdentifierSubPtr exp; ASTDeclIDRangePtr expRange; diff --git a/src/ZKP/Environment.cpp b/src/ZKP/Environment.cpp index 267c677..bda29c1 100644 --- a/src/ZKP/Environment.cpp +++ b/src/ZKP/Environment.cpp @@ -37,7 +37,7 @@ void Environment::clearPrivates() { variables.erase(p.first); } -const Group* Environment::getGroup(const string &varName) const { +Ptr Environment::getGroup(const string &varName) const { try { return groups.at(varTypes.at(varName).group); } catch (std::out_of_range& e) { diff --git a/src/ZKP/Environment.h b/src/ZKP/Environment.h index ec811bb..d5b06de 100644 --- a/src/ZKP/Environment.h +++ b/src/ZKP/Environment.h @@ -4,6 +4,10 @@ #include "../Group.h" +#ifndef USE_STD_MAP +#define USE_STD_MAP 1 +#endif + #ifdef USE_STD_MAP // XXX for some reason, BuyMessages are not working when unordered_map // is used in ProofMessages: may have to do with map serialization @@ -40,7 +44,7 @@ struct DecompNames { std::size_t hash_value(const ZZ& n); typedef MAP_TYPE variable_map; -typedef MAP_TYPE group_map; +typedef MAP_TYPE > group_map; typedef MAP_TYPE commitment_map; typedef MAP_TYPE dlr_map; typedef MAP_TYPE > decomp_map; @@ -122,8 +126,8 @@ class Environment { * computed by verifier at runtime */ dlr_map rangeComs; /*! information for caching powers of known bases */ - boost::shared_ptr cache; - boost::shared_ptr multiCache; + Ptr cache; + Ptr multiCache; /*! clears out all the maps */ void clear(); @@ -131,7 +135,7 @@ class Environment { void clearPrivates(); /*! gets group object for a given variable */ - const Group* getGroup(const string &varName) const; + Ptr getGroup(const string &varName) const; /*! gets commitment description for a given committed variable * whose value has already been computed */ diff --git a/src/ZKP/Interpreter.cpp b/src/ZKP/Interpreter.cpp index 5aa1a50..ae792eb 100644 --- a/src/ZKP/Interpreter.cpp +++ b/src/ZKP/Interpreter.cpp @@ -22,10 +22,8 @@ #define UNUSED 0 -using boost::shared_ptr; - void Interpreter::check(const string &programName, input_map inputs, - group_map groups) { + group_map groups, bool enablePowerCache) { // first check if program has already been compiled, with the same groups // and inputs used cache_key_pair key = hashForCache(programName,inputs,groups); @@ -49,8 +47,8 @@ void Interpreter::check(const string &programName, input_map inputs, ASTSpecPtr n; try { - shared_ptr lexer(new ZKPLexer(stream)); - shared_ptr parser(new ZKPParser(*lexer)); + Ptr lexer(new ZKPLexer(stream)); + Ptr parser(new ZKPParser(*lexer)); n = parser->spec(); tree = n; } catch(antlr::ANTLRException& e) { @@ -112,10 +110,11 @@ void Interpreter::check(const string &programName, input_map inputs, // powers for bases that are used multiple times if (!groups.empty()) { env.groups = groups; - env.groups[Environment::NO_GROUP] = 0; + env.groups[Environment::NO_GROUP] = Ptr(); BindGroupValues binder(env); binder.apply(n); - cachePowers(); + if (enablePowerCache && getenv("CACHE_POWERS")) + cachePowers(); } // now want to store output in cache so we can load it up // again later if necessary @@ -137,7 +136,7 @@ void Interpreter::cachePowers() { vector baseNames; vector baseVals; DLRepresentation rep = it->second; - const Group* g = env.groups.at(rep.group); + Ptr g = env.groups.at(rep.group); for (unsigned i = 0; i < rep.bases.size(); i++) { string name = rep.bases[i]->toString(); baseNames.push_back(name); diff --git a/src/ZKP/Interpreter.h b/src/ZKP/Interpreter.h index c18b447..5b7ece1 100644 --- a/src/ZKP/Interpreter.h +++ b/src/ZKP/Interpreter.h @@ -27,13 +27,15 @@ class Interpreter { /*! this will run all the visitors that are meant to be used * BEFORE user has given any numeric values (maybe groups though) */ - void check(const string &programName, input_map inputs, group_map grps); - void check(const string &programName) - { check(programName, input_map(), group_map()); } - void check(const string &programName, input_map &inputs) - { check(programName, inputs, group_map()); } - void check(const string &programName, group_map &groups) - { check(programName, input_map(), groups); } + void check(const string &programName, input_map inputs, group_map grps, + bool enablePowerCache=true); + + void check(const string &programName, bool enablePowerCache=true) + { check(programName, input_map(), group_map(), enablePowerCache); } + void check(const string &programName, input_map &inputs, bool enablePowerCache=true) + { check(programName, inputs, group_map(), enablePowerCache); } + void check(const string &programName, group_map &groups, bool enablePowerCache=true) + { check(programName, input_map(), groups, enablePowerCache); } Environment getEnvironment() { return env; } diff --git a/src/ZKP/InterpreterCache.cpp b/src/ZKP/InterpreterCache.cpp new file mode 100644 index 0000000..3a8aead --- /dev/null +++ b/src/ZKP/InterpreterCache.cpp @@ -0,0 +1,11 @@ +#include "InterpreterCache.h" +#include + +// thead-local storage for the interpreter cache +boost::thread_specific_ptr localInterpreterCache; + +InterpreterCache& InterpreterCache::instance() { + if (localInterpreterCache.get() == 0) // no ICache for this thread + localInterpreterCache.reset(new InterpreterCache()); // create one + return *localInterpreterCache; +} diff --git a/src/ZKP/InterpreterCache.h b/src/ZKP/InterpreterCache.h index 5c27a89..beb865e 100644 --- a/src/ZKP/InterpreterCache.h +++ b/src/ZKP/InterpreterCache.h @@ -25,11 +25,10 @@ struct CacheValue { class InterpreterCache { public: - static InterpreterCache& instance() { - // local static object initialization - static InterpreterCache _icache; - return _icache; - } + /*! return a thread-local instance of the InterpreterCache. + * this should prevent different threads from invoking the + * same interpreter. */ + static InterpreterCache& instance(); typedef boost::unordered_map cache_t; @@ -54,7 +53,6 @@ class InterpreterCache { InterpreterCache( InterpreterCache const & ); // copy ctor is hidden // assignment operator is hidden InterpreterCache& operator=( InterpreterCache const & ); - ~InterpreterCache() {} // destructor (dtor) is hidden }; #endif /*_INTERPRETERCACHE_H_*/ diff --git a/src/ZKP/InterpreterProver.cpp b/src/ZKP/InterpreterProver.cpp index c23bb4c..f4488cb 100644 --- a/src/ZKP/InterpreterProver.cpp +++ b/src/ZKP/InterpreterProver.cpp @@ -27,7 +27,7 @@ void InterpreterProver::compute(variable_map &vars, group_map grps) { // add group information if this wasn't done at compile time env.groups = grps; env.variables = vars; - env.groups[Environment::NO_GROUP] = 0; + env.groups[Environment::NO_GROUP] = Ptr(); BindGroupValues groupBinder(env); groupBinder.apply(tree); } @@ -85,7 +85,7 @@ void InterpreterProver::decompose() { void InterpreterProver::formRandomExponents() { for (unsigned i = 0; i < env.randoms.size(); i++) { - const Group* grp = env.getGroup(env.randoms[i]); + Ptr grp = env.getGroup(env.randoms[i]); ZZ val = grp->randomExponent(); env.variables[env.randoms[i]] = val; } @@ -122,7 +122,7 @@ void InterpreterProver::computeIntermediateValues() { variable_map InterpreterProver::makeRandomizedExponents() { variable_map ret; // find a group which is type RSA, if none found just use first group - const Group* groupForRandomness = env.groups.begin()->second; + Ptr groupForRandomness = env.groups.begin()->second; for (group_map::iterator it = env.groups.begin(); it != env.groups.end(); ++it) { // remember that 0 is in the map to indicate 'no group' diff --git a/src/ZKP/InterpreterVerifier.cpp b/src/ZKP/InterpreterVerifier.cpp index f99801b..a840238 100644 --- a/src/ZKP/InterpreterVerifier.cpp +++ b/src/ZKP/InterpreterVerifier.cpp @@ -9,7 +9,7 @@ void InterpreterVerifier::compute(variable_map &v, const variable_map &p, if (!g.empty()) { env.groups = g; env.variables = v; - env.groups[Environment::NO_GROUP] = 0; + env.groups[Environment::NO_GROUP] = Ptr(); // run BindGroupValues BindGroupValues binder(env); binder.apply(tree); diff --git a/src/ZKP/ZKPLexer.cpp b/src/ZKP/ZKPLexer.cpp index 2540497..d23c850 100644 --- a/src/ZKP/ZKPLexer.cpp +++ b/src/ZKP/ZKPLexer.cpp @@ -1,4 +1,4 @@ -/* $ANTLR 2.7.7 (20090708): "zkp.g" -> "ZKPLexer.cpp"$ */ +/* $ANTLR 2.7.7 (20090830): "zkp.g" -> "ZKPLexer.cpp"$ */ #include "ZKPLexer.hpp" #include #include diff --git a/src/ZKP/ZKPLexer.hpp b/src/ZKP/ZKPLexer.hpp index 0233f22..307ea28 100644 --- a/src/ZKP/ZKPLexer.hpp +++ b/src/ZKP/ZKPLexer.hpp @@ -2,7 +2,7 @@ #define INC_ZKPLexer_hpp_ #include -/* $ANTLR 2.7.7 (20090708): "zkp.g" -> "ZKPLexer.hpp"$ */ +/* $ANTLR 2.7.7 (20090830): "zkp.g" -> "ZKPLexer.hpp"$ */ #include #include #include diff --git a/src/ZKP/ZKPParser.cpp b/src/ZKP/ZKPParser.cpp index 83485dc..92e37f9 100644 --- a/src/ZKP/ZKPParser.cpp +++ b/src/ZKP/ZKPParser.cpp @@ -1,4 +1,4 @@ -/* $ANTLR 2.7.7 (20090708): "zkp.g" -> "ZKPParser.cpp"$ */ +/* $ANTLR 2.7.7 (20090830): "zkp.g" -> "ZKPParser.cpp"$ */ #include "ZKPParser.hpp" #include #include diff --git a/src/ZKP/ZKPParser.hpp b/src/ZKP/ZKPParser.hpp index f60b1ad..2cb1e06 100644 --- a/src/ZKP/ZKPParser.hpp +++ b/src/ZKP/ZKPParser.hpp @@ -2,7 +2,7 @@ #define INC_ZKPParser_hpp_ #include -/* $ANTLR 2.7.7 (20090708): "zkp.g" -> "ZKPParser.hpp"$ */ +/* $ANTLR 2.7.7 (20090830): "zkp.g" -> "ZKPParser.hpp"$ */ #include #include #include "ZKPParserTokenTypes.hpp" diff --git a/src/ZKP/ZKPParserTokenTypes.hpp b/src/ZKP/ZKPParserTokenTypes.hpp index 0ff142d..50505ef 100644 --- a/src/ZKP/ZKPParserTokenTypes.hpp +++ b/src/ZKP/ZKPParserTokenTypes.hpp @@ -1,7 +1,7 @@ #ifndef INC_ZKPParserTokenTypes_hpp_ #define INC_ZKPParserTokenTypes_hpp_ -/* $ANTLR 2.7.7 (20090708): "zkp.g" -> "ZKPParserTokenTypes.hpp"$ */ +/* $ANTLR 2.7.7 (20090830): "zkp.g" -> "ZKPParserTokenTypes.hpp"$ */ #ifndef CUSTOM_API # define CUSTOM_API diff --git a/src/ZKP/ZKPParserTokenTypes.txt b/src/ZKP/ZKPParserTokenTypes.txt index acc8ed5..098f2c3 100644 --- a/src/ZKP/ZKPParserTokenTypes.txt +++ b/src/ZKP/ZKPParserTokenTypes.txt @@ -1,4 +1,4 @@ -// $ANTLR 2.7.7 (20090708): zkp.g -> ZKPParserTokenTypes.txt$ +// $ANTLR 2.7.7 (20090830): zkp.g -> ZKPParserTokenTypes.txt$ ZKPParser // output token vocab name LITERAL_computation="computation"=4 COLON=5 diff --git a/src/ZKP/ZKPTest.cpp b/src/ZKP/ZKPTest.cpp index 01bbbd0..f8724e5 100644 --- a/src/ZKP/ZKPTest.cpp +++ b/src/ZKP/ZKPTest.cpp @@ -36,13 +36,13 @@ void setupEnvironment(Environment &e, const string& fname) { // hack for known examples: set up environment if (fname.find("ecash.txt") != string::npos) { - GroupPrime* cashG = new GroupPrime("bank", 1024, stat*2, stat); // init gen is f + Ptr cashG = new_ptr("bank", 1024, stat*2, stat); // init gen is f cashG->addNewGenerator(); // this is g cashG->addNewGenerator(); // this is h cashG->addNewGenerator(); // this is h1 cashG->addNewGenerator(); // this is h2 - GroupRSA* rangeG = new GroupRSA("first", 1024, stat); // first gen is g1 + Ptr rangeG = new_ptr("first", 1024, stat); // first gen is g1 rangeG->addNewGenerator(); // second gen is g2 e.groups["rangeGroup"] = rangeG; e.groups["cashGroup"] = cashG; @@ -57,7 +57,7 @@ void setupEnvironment(Environment &e, const string& fname) { } else if (fname.find("multiplication.txt") != string::npos) { - GroupPrime* cashG = new GroupPrime("bank", 1024, 2*stat, stat); // this is g + Ptr cashG = new_ptr("bank", 1024, 2*stat, stat); // this is g cashG->addNewGenerator(); // this is h e.groups["G"] = cashG; // let's go ahead and give in a and b @@ -73,15 +73,15 @@ void setupEnvironment(Environment &e, const string& fname) { || fname.find("declRange.txt") != string::npos || fname.find("compute.txt") != string::npos || fname.find("modulus.txt") != string::npos) { - GroupPrime* cashG = new GroupPrime("bank", 1024, stat*2, stat); + Ptr cashG = new_ptr("bank", 1024, stat*2, stat); cashG->addNewGenerator(); // this is h e.groups["G"] = cashG; if (fname.find("badDLR.txt") != string::npos) e.variables["J"] = to_ZZ(51); } else if (fname.find("range.txt") != string::npos || fname.find("complicatedRange.txt") != string::npos) { - GroupRSA* cashG = new GroupRSA("bank", 1024, stat); // this is g - //GroupPrime* cashG = new GroupPrime("bank", 1024, stat*2, stat); + Ptr cashG = new_ptr("bank", 1024, stat); // this is g + //Ptr cashG = new_ptr("bank", 1024, stat*2, stat); cashG->addNewGenerator(); // this is h e.groups["G"] = cashG; e.variables["J"] = to_ZZ(51); @@ -119,8 +119,8 @@ int main(int argc, char** argv) { ifstream ifs(vm["input-file"].as().c_str()); try { - ZKPLexer* lexer = new ZKPLexer(ifs); - ZKPParser* parser = new ZKPParser(*lexer); + Ptr lexer( new ZKPLexer(ifs) ); + Ptr parser( new ZKPParser(*lexer) ); ASTSpecPtr n = parser->spec(); if (n) { diff --git a/src/bank.80.params b/src/bank.80.params index f363ace..36573ba 100644 --- a/src/bank.80.params +++ b/src/bank.80.params @@ -1,583 +1,1080 @@ - + 0 - - - 1024 - - 135218297597036027447710869998207208754674606065213053565477328119318307615909175526780620233213961426236879812016724358445271350587363396402647314849305621510012071242662065255846791249159498224132174763132326817952843159753470530205099792627946188037319629342446887089368727200769772054196948434863869529351 - - 160 - - 5 - 0 - - 18208244590241069583945724715874667682021402381869122752191191011908431102922032101750150575398954442568433700325906936509940645446026799664167551673847031697308843403021189608647351053797462122799257330721911677799321262955518693413213492091091575031816278740442189255351713608125699206715386379787631136553 - - - 131540008933434439797345948918394261880173787648911427732001625350824200688345754946399083539327263132740551020405739246247253074652019164142804882841356667895761572327083692446423627850400085866440853738034890285736115428435401625648425367295082976489978122036860020082169538328537073357748608207155548379323 - - - 91272725802016999926151875073739471182280652070511760378850930760962342713681923927240228531890954606645620919696449005573523123959193016212029127692446066052985178174169442856720775137926238522268128669447003671386368122267146212347585948046238834952090600178685872531305631839437669077746419434508311013383 - - - 3469882655055659224110796061184855363317387895617202437236151222595676437356010103862254518369649822515215063723506132692782175600271281713617198794137567836935269721890075460941750695290740788356081320228309732607034651115489632489205897080536002378820247683062542665099079636940180095369957072814768593231 - - - 30597361783781676797521480522484587284592145075325385388829200913267968937767278691821499603927812902193661100233957450599038048910138756474842188339778893991336983286399329800775281795383858969341862563509964623791941848182839037452532512334863582834255155110971223966672416785184918358620159650430082221670 - - - 1 - 1 - - - 1244736658805837004330109075480297814211691129853 - - 80 - - 108632052121579197510727782738809674259658270667513999458233547257208694922342747151016335495460550311128145055639237925983221319028074946360737371864153589540779403314101093667591328047044940954750182782695379846347426671180342818611100418161230058992137373950 - - - - 11 - 0 - - + + + 1024 - - 95288621726635968872770037150784213196985326131676843097938547136462929264841295546771500388417671294966257595433760953200547360249349740933546921081522125275115437397098973842360250826812492033263835470045512007784622189487961151941432994089813647862969606517420125770262374746820810455414109837014665020593 + + 102680714876620505251519589456529850089969700556564489253162684638539597335736793998411151385396668678457395604056076455447346438315008567850445832409559094642617108516105196798178870587832997740211486024550117558968151215813802257578385470372409470175519459389641067956632237921585676408120047405305262039181 - 1024 - - 6 + 160 + + 5 0 - 91765448215067823325795421667963131269512371058001714218791999926519624355910110183970996302294343489487711637666736326993210098027018038695140474955963214538087467579370979300852114793975820201555823972904294803171664470191975084609410844843699562290002166572267125918023256183462931816866438417011288387597 + 22923320959192453636423682385738922848216151492993760467429386172337582699603626592667966029063069617300543105850468927060751138940226489398256413607978816318065423599404211058602051331171774528282150565237472007558045410089374975467684411005456109694572501365211023547108753818220756570663968723659519304097 - 40294104858917502207884187657330535256083121883845488158774475159839995768781522379296790456727414484487297945298577860348991280709907143209769263860571497761805544744736759396126801492587046865066754602032016892804265697920244305298307566030270409229660322389503909826850364964925423148539479481422269333081 + 53945843214081887230506825685162514221944851452590973433147320105768347799035010333040104182762421540976644457898523154200390719416111152133906850059276116624692455403920555815325946146027238316284576081046322930997100925534589898400045746221732607763907326046366956881978962788748138738898197865947329746712 - 37181927301328601230229509824050779944931890417371371899093425328383585668806438133965151915167895804116880861939436384092456427888455471167585465876401001715893034711967342076190251284011995257843683345831106685333128346207762133410990676468736935851749651853413574904157556618055537455150277384533267079125 + 84070450444178810764801942593139363675201942216375234211388549548441399502573647392486982654665114331690463175765687779989817013063882187163233753732167024252613425512245014453169195391341163601305650730846456990348521068770085139213305228501503975315987245346014618040731218552889355850011776660968387243547 - 67347955068046617987078271939584408214616385355082946652652558963004113886368419385065451148614904475564270298464228947932932400883150877198113111247417898333396047869562351233676189346740404229714576046346513957179597233959209788707913957203885684064580064021423353037303259164004893420671864177938248968460 + 44698200531549202972232618323671999010830294896874839743157702137836602383560583870323823976773804259743506237545914357368122833664632525931647018821826400373691255566854594204199447306752422310463080619172699838408810456076477752430884838822369737010719356000558487625372180909172327760255616921931423991248 - 57669000393863291465997741294941801999274879223745070978194979170456208486599787020905477696350469460233194798640650624252822592978323224264539104432394194340083276480589910796208101428768941276014721718948586671096753212427551901667894807759957845419273976923255392385335476551662714791721228240704492903472 - - - 26693245241650097930528211048506005550361754351170897843150689991780056709581651682450255357597353232814904745727236148991266683037674349270826986976517570248012352181812879805573443388140013853869016411689779861764052607477431441788218487198174043217144077012585519677983607140788959524397744180396725947903 + 51872694200042776418703861731161005597647063174327775542825481250710848362720927717796283168056945768526737370976647132055902410582742570384884317599347064382929720903764261035793509472519152983496873672379499058845114238849894388800999929829175350045958631291831128454260459997110600204624172747502759593173 1 - 0 + 1 -

- 0 -

- - 0 - + + 1381926471275670696491547928550620506717346803979 + 80 + + 74302589183225406744708406598986697445626235129332961159539629660099003864681279676025057169598059221346100246653275027988998552977043535171844663879396255745429680604118860556814772359887881646573360468171271074105943974872534642719266485854337939537007792420 + +
+
+ + 11 + 1 + + + + 1024 + + 128057967809655946190316507735155452831314572900315216081434860144597217324346737671800302572587640910078110732912465466684478941477363845874613925338791275068167816621932721309235605381772586248486970010063355049965746801462578755831359666996420724229475198439645105729191854361248312605304734475323680662913 + + 1024 + + 6 + 0 + + 60811636929475187479807521649087606074793642064167945690350627603203118950323257675713133373687111123714663109087066267073458476631246485001894677569393649603260477149691339449729864039552273625864812610179069562367245786370215607199308088083101677805342992837524421920973047652387594443568045299878715104011 + + + 71560986262474260038579847733152867125395323692136727882523150181177145526050032346646815633503819181049097447083396963116870388315714388861158191811280162852633670260478236187402519672391362381543748430716574725648848677812893437556332455280083345503039177361800148373565541695573258846852919928924249154877 + + + 5358493014159018151110306019414188401443366482533390828878588153924237270657211162207396455592545292115596564966717448066974022571552087820343845293928484045368156700279200787884399405557838594314421227423879077160333472477688129275324340290022874614042967407069455935447388415804019834527557283355835583238 + + + 9440403911953510704955609199118462522546969159294361115679964001969095067128208202978671380235142495494192920664243060842431049236464627103331285996753378993464968648353139689202039972946351834805543874912252883016750152554402795151625609573033493183190907610839726606922080056808873159110535921110839225918 + + + 34601241858178235153992489154363566911322825930412755051942961530163789553279237024169967243263931210587905323687670939702730687998131084839805896091785126613296047470576600055262500331821637746680489652121076447750079042944735474064557177506619768477733608759334395601504750316910835074596407622363931297695 + + + 103450953660312905541961327136746359534991486059040490771968614429013794227835017626759804639288113432551732347712210332460709755012800755979360542019454727242090797411218789006851073710562599252458946620552051918314153874747184637728072116094587384838416002546398982033848043597058533784377942968102172250659 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
- - - 1024 - - 93754528746270947617601056633800291364861682298136548284561953146489022955904322738006597336491255826850217147425593207106178206216828010702018655449477593047795515376414948882934704904553519186055641276786533221369873508841086692167716664918409533164054262959579372586508029429553217016081926497726561694521 - - 1024 - - 6 - 0 - - 18718193641957314100730569270853083678067699981231377053218236440200570748514195983062189820845228989708114721036335865296839656769486571188331480498517073112230023384223396819136721032148578078215922950710122782193152236503585708948416278154158382262317851500701694633329332013554441192971028421049617669489 - - - 82896076754196599390958700658750134011593697922866943134696485394164355313829104791709121309680409072619102123137695639536409295590399553682662365861769296142916411017933128214043071624336717400223646514016780377509575552315798740608282027520372471946643222670649888877298101008604716866742635601384004923854 - - - 21409157001559082435198762389634006574011661991672395549556344452730268173323934115852207531740777161515961701461098746369193405027011628705790585563246956558634006855496001853186543137136893612905388690157500633486730387558679778087776089487182622558762079085605279790603515779276275365424877533098872706670 - - - 70565991640659014530782020171678876734088049089005570216201610770536518351424325792391149871467733547040543767770865459680906464111242548129734433235362473871904159393238510211564669982290551880614995619280240162572467822996375606151081508022082119563011842579690659846853164036860838326243732394765514573431 - - - 77371797128912592221963604938094942633911707145381583508738772419154024425791944438183290768376322858296041782716140964031431791761038113224908751332497360736934697933992269356158706338071119510267730514533442260161070478749011694884944792352277737582112505303044197289488663410941538147133378198748067540370 - - - 82906267256926337774982154418825451735160292585995227482630966060005770865073506792587615848461940397794441648783258220198681551004852811134622576927680502421722981730340736873927483483912074641562013505776184518064639060490292519532693639651522247920944720222077401382740855126956599277073236976642634255886 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 + + + + 1024 + + 91338861134529173742636614734321283317712406433818139285229062454925111527732609262828687047423080667973258817589805005737017416371360314088086808443898371429020158735259589920882443779130428607594850787634565846387075036083051955856286100630464641033224957452092909212599715224401427904042049536509604893693 + + 1024 + + 6 + 0 + + 88481512963655310506095083872998303955363103665395614689748950761935149130592150567352051526842435768907883513122638406071951993833483039104880894260670448994086429616644971856997369229550170174238792300740232364024915015016653492885640971890845653859579668498528250516917066920672069528744730214455335881003 + + + 71420609539497237732868765033013438071208066944625734387424793864620282249588182875061993503837717471514509627177747945260865425509223920765478106067601828682271744524355493795121669193837190303641492443480194307599715826281960573836394123684702869297115710345424755375986644023739445330856168082010838417938 + + + 36213374277915021187960501154206429350509009943784937342853640962344665273661370341432812162660134104129081769292257555453657933322026058920570002011215114885632603237420344104120014493999772566832623489577942137696416594059207873047026684531831127098662368796483679106715230357303209903005563129291440998125 + + + 88784875219103004490867409187796580439336028275646934064032325734642172796350750877782655631487263690600595545185986973949637793376040039529334242727841787186152368722684829777472113434707623526142748869410906573019822447060135044716736888756586491608663760971724703067383426197232527066117239191970436021914 + + + 57669682815414213701829150785790139820922208365396385382451270040015047105011059602270677532141334599848749895445377163377797098101769663138915670832338561398070313576223809679656089041902001668549387570675942187547921753080749715443394968434937329744189522351133848627606864859717699163427995004551470140014 + + + 19430387956073665040008742545168228237366626380409449215616316415682054432029605888008345798193251163116713132110293851289775570086405711097037612492724618955613522669964620645767675728759532995017555557036656920568589220029848250912688353596366989096421783410644212433994547565209779383923475304673100010441 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
- - - 1024 - - 117121510340484883218702815716016593017369400197866007284904378631159197139001634351397099006348261090254639042478158024516471273585541723720875693552232460895578362633596275449655253304174140947289638902997286514465275801294597279338210032808446791251347509758362087729471534556332712094330499939197910698121 - - 1024 - - 6 - 0 - - 15107464790949779810848925539036116589164680473165481843812014434604020175520176471688364414295094594789131782714144993286259674728780246748998301348736396420755743906492330603688120075762111416310712907772599039447961132953865243297778270824554218777752426713792107606639541765351560469580417085799109151109 - - - 113132619367906663802193126722604452247067407379700239211440005578163970000183414500162238958023667292239182925037826362117516957239919821570280746619833192108348188339728009997904509491615767024576962472478540005115623781145645859430146502168842179897232042057741008928306919479034320821732539898654106307802 - - - 78831244758190029101616472362891555519371645829273483715261840379070989387145987292415360310610897488118375589143503280479343341807586436831967002903765461858758240031822865686048256893617339372987036343650345119947926372267957827867520649710294149310400270822176566699466347972287709536682523581276108603165 - - - 89583752214253883440042346912037084568006500039317399385601176574344374326678906556169715887314185264099152754269356405558198400381910728064450965723135896789762010431669178119883031744022651457596440185119193793176699852604878873526015261656614848828142855743809311777609303941862248597137943126610861447582 - - - 684918354387786416205491044839255104512468520452805205068164464332390890861013726899159853659380168702172547004069779846306014103550976054178864271837177474931121067671438226162027556594210608928930392798386737184879547657514532124037440133147012810854365196162946992675626655050241753400618846478941872959 - - - 2827090550656972121690688796630460105969591925581289110535338322165933007662678927433743438230413437638688120784053460847485119328516825633705134738699602887927163627101863584369718271691217967413302030401970248252827616171028363054960352533790801024629520084292963540458837640796067532543489914339488634793 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 + + + + 1024 + + 171795367802537336198216850040760302817719433285673072064016704297509263294972920968862879995019333546807716681922194952612358665832924006994420672781322683935998563828829629166676961578310364216820723333284118541610355614763234524893877254301205676826968663616237843247997193664755408992255295724018758287453 + + 1024 + + 6 + 0 + + 138781939743420141798085654234587085378791442750844156618218315519623156030775014083940843628427157991650536995512183146050090364430217798889903276779395691314769341501283521555441395248293145295446229257598584303226472282606025256289516823083353133125249557574662930559464988881796972570415006594877835195261 + + + 168420371175596160385314346470541456127930556988792934601264980767954150761074401191883764002057676025574635595559453082438403114835695017344400960903147888338845250647685131378444914574667053754042483424927960459645361430078126904416924147233083786086593890435155965855696708192722757613306648217414021209339 + + + 164599507864917269230220181044130466242640054454386799153052272100119238662434506377210871322725801768535465849520862187042461522458751851837119010844326508994699806461980159073458635731317238484887665362257435016594387971946664996341942792674855452076757886270233668811767159399329679444242304826944461878356 + + + 112022954554594868430694861746706902810007259966892035372848716164773714721760248918761857377457366770462246217862095078291990529093104794681337350992919876990886726535142991553290065736768419334005963502455897767959870639353796998608846837617297713305741565185682566104560690180553705181428610482999491959762 + + + 20795710379390313360149837901235593902809611922782438280826554162582584185176550436631972790505407403299851110962435492486911884529635673218790787915570636384717044595376003628898518022547995524968409598599237503027024128328270655662334146591298270627006489949537312823974893037600566816074625503584300399503 + + + 4461068203835146920397273122878996496925951644023334909782795888195924230363311467297500231054245083629066539839024032350563196843805187870921285704555947110972472049763739700924273806542377974583744547273338787688284998293736197541473212310650426901783545952048410414287416361433915264087521382790658628498 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
- - - 1024 - - 99079153840397804685867478704958595964211219785958155284881016629530195136827933093286116921421314259616351394960959112126590774558615068567723955791014044034246784512429519014013254580736277387087599956862163226669530087515094282327896617665735736838287894898186772994803726158745804341613911571374382274217 - - 1024 - - 6 - 0 - - 35578547039971283982645110066508624345573610232317627247471510693463768653398865835272238114026351004271431932575111890233938763056151590366620841232654704061531541940982892684581803302511323727831984614028154198292407031303845418948998407737432474830158607617228291146032822031461125981880732591780383080312 - - - 2839520020939910414585072396053942201285418477164512070052267230831770336300588444747762843759096401075210098436532138784880804799932247566970642529121364066612216811270441923475539213363391876709967520432970001189613754468394504726917294243804597283185825885394444717803465042728107614758510510324174671273 - - - 4257103436738693167679988473229289136213965822055009836429122086227208976617015158554335685934033709081255434321021922411600352023894639658729306158101602153035636660388068573921523812704376829383643150036396507460136150352573845700348414072481768647411162438985157824104787655967389449019995413270282384725 - - - 31273849552494023387697146195164619556065892108955510829954275657213643062645495427357887929042406068050763274296028240982751299109488666543364710271423257790548527234106226429899957206169892445232737790590754462461209360892073592865787825317580388584134032992457155327142814088810984081589994609099547807103 - - - 35347178693259636224425976955506604359014275201911436639125947893572572942967879891723093129361271536461729305849344256272804438952413715869305278809953911268349508791262359453574584301723678348219958163537617880479600787349102851371503927614310858588626874124144067272631324900475250505683917036436021292017 - - - 52102732689033856356640226142441703447547338607766799410243675288006455786150047981514503689756076319154821254787434210207714021249333494274124947142471750583698934512751038996632656769981162124907250526920201757770741572757079121833484338311748881797371896129073537143638484841938341861907569264174122123347 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 + + + + 1024 + + 107678493864345648666726963381598843005045134906745773568855127179729298765945796229988935480734186762723475076589458553114861073591179889992284613957887798550444135071834300620151269193028269405467525155137973905598460168964059816679287733081423902287277428322195154969572934367847409309681954541961841211929 + + 1024 + + 6 + 0 + + 34780567649645587652662047318280460216197594322629290659397343806640717111602043777551795972363990570490561518129361133754971748815062877457811980871870613895746761204692874944262181605786891503668206019069701677551111685254064897625906904673396799614054762342291638726110702862138766341205373553864835127477 + + + 76770578985664099191449798911850613016440202975139749844785468106943538467941487623782662375335620379715667015148235397661770125559100524256505138827952950374296533996410404476470347577736554558794350087928716157046782489969073300743386412321573188949782078100848155826141059164451205262811577282438487833155 + + + 19375132007991059652876546182462672768720429677050803522934111565324016495763732172744623907045335493048740541182304274405106110493850369225158004210873483104238595711350247509966292622988932139561490663242014148110393502548086758118819001913181597386000596861820476450726333113377798106479230138706277155435 + + + 60332745111136671951489671083751897003291069716229419557442175701860610038139875996851654495020782497922916125497030526867835842055895873784260108184155213565134969114645958871640895775675472360543614497922018081777590790520072701770098022598964534954182431602697737796983390272144688966305745888541862833949 + + + 33206030625501357397902828493305862279894195856045523813806319914644617357371406587381751252409214237464923457683937662308696252667537129026830911327626477920950026367523422037741403916073653057335758700270326029776865721695045422550695292453931419295319756838382198216938790815705554550670037002167896435708 + + + 33699591887245320183352886957374795158953603724548326397696125237452265579267587282433792785552885615789973016310923276732538075279246287329477093697179355796742915804057038950601496710139911151519055346593812515824483642829165138763105492040862107512334441962031341198253373030460133402288720613467576919651 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
- - - 1024 - - 99954730175178004845131539653721707390533824134606712982410587911600868971245047100506766033962983317090892319656867952029116781250661480710843185739353918573345334339835797435830424130435498802133973879689630984537203490181103875802086600280921230328725473474449200859216711406629174468133378669755826399289 - - 1024 - - 6 - 0 - - 58613911232307388786240529740987000882039067599860437772060847031357515586839511997150614558368535541427251986791314469299365847701391023351538654534248928653505326544257910522636722321510290544008094306357049503882695532643010370246985543037398842826556465466041122607877993972401850373499349505467940128480 - - - 23759200450495340002812814650036411105104184704810382581836582136381499246372180158982092762319176354865585492876056145343997330165572678887761521089111659694764726321928033912931120570410344269003877152629946202983994387902650140832036058989562136543699053859110798004475607769263425530430095499690012867361 - - - 27782425796445607511552503734068694227876277361913927009841359267890284063272744867098761749380021187439414183495224952502774379338236771979358642185898028829503362239763322899537168530813926957477896747390629838050847130063594861856714553628317263751461531880058526762279151869539133638780577291661705004927 - - - 8784981056185286950712849504706542909851983675476684831378521579437874438781947443207971368861700013318831210277930183684008548888491900029215961830883091576228665510223450239592867424261582734977160146810093587216625525411002439629017874997945384679431426050351258078369390184459312181275581036833509779471 - - - 67438312305077819888962412973544875116933726924127002079831365096482645787717754904826762149733256426407804919023613760756645934824283717354322616471896981039882491744840529505847451034873496543558273551287489104242041014171297514449081571270617393454781665775168456916896840386566994664178411923865986659586 - - - 3464604326727829206934168876456004920457656854740648111041341919379642725442948759261114328466645767790382904740245997674525442848992126187113268087612395494538879214628114838356903347298883717235497237827971476139254978851080082281176240683715669897361209280214505681097167531557140873892635301719665778459 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 + + + + 1024 + + 123460587970465722399480599701446111042791049424678164510782348298178989524706869827218072757318065802572872977206189692439610889543998303448261820274781115343738147716328254096174904353808537339736300386924394267507766388682907861666597761952802807474810395363126049870826035575374238638068965983199376357813 + + 1024 + + 6 + 0 + + 117318302352368229229163809607702479318456428030157262995598611780776136494163450278418011369672196225024705223924157260734348678181103931116903595932563324645629923260513068155684589997607606713365161836567403767936006638718885167253192939940642824452024816730744123545240701916149057716603434108694989710429 + + + 79166656374368484214654356495255053395213742590584206280310930719755653489957925930346542517512620192097650425359579247070837443830862748231859562053718573394014868991678211219437490529223024342458612272327848652593110612340785752785585712120010687405752536405399684337596148008796260805479427829450136814686 + + + 40871868938993875410426205996751811587721008167871813439166564189762055623031521920195950886062485740929198925966775524584648439881883879228755988003547754790287586711275993853306093079373185290320968524077798129432974504079981251722944994855192019937284992580655570885903256271403090577186422692725459831875 + + + 89892620900640290140283566392805476442834511036692916092709883776370123872836264775868321860590685970283545083118729182759253902758383167687729739268452078465233562037688700620432639773342196188561501129246210605848453748122752153274263445164184465697547705606339433632142128437959746969173608800415728397931 + + + 121709777035471737364513670422914240357059445755508125094002474776054087244214559702633254647901247822895427221568520569724729995389163298559564480170015494003587855303221851200035414262844476231232261394773812801023837394666069091883472673028207084029985001140015089782123008327089253959339518752984564005371 + + + 118368291349285147157585550327202423335817645258822478079337019930721123815468331635525068128544253736950377216631099734999157547924851998471340790034858629390897530180532960195293567558086925678406847565038276833217752653830262850771875793504960255927890257698780412927440166594709334246027496966288743344300 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
- - - 1024 - - 148196264683866983246056824641461916553727188878286846814207149952700786295989140546602219816499052248745376771762136245911508160658056925812311366238900528068507706459965567045224239023241599326102923853309769022811634949971343037071212919062146382997355248278317770400104265846506381194883209546789678257953 - - 1024 - - 6 - 0 - - 18228509827232960358109377366125905423396651073282009255000634400639380520576157033263066403255727758538148196007410118445711222636928632798833981031757422495552319975431175939254099574893434799433886121282995060105902206634281977941044087776314177795281177970367372303622719093916858010157621949175537375437 - - - 90741052971361642071954400353930918473049330103806494303478914341240604429740160266927238572355901048839288876493430663768138981859097012674365597674038606403261541063513022898915424660284139220319595247352870395164358600167094743461905071137254013807294601497510689150945162000419459659619999603827775332678 - - - 52734335451280775701279135902793102618804746933648573572440269533476207593955736723943187629344792274001509257176599036967710480587413456988273865241932371090713054609684326983191462176991220730297153396836508515256005211749658852141138853888828449929462905950872738295586503848336537871567551750808215082154 - - - 121858449637190773866676289376800522277568993915277707214462950174058584758252432920947572621722050668109626466687582272873980762806089036347506636343533340986613090442509515739606515227484919838200607799752117413416448281331606056270182334689643276303764467680282413521568568120011182673925501023231082406153 - - - 37196825733132964338623996101449346202869180967029642202058352423341650421724872464278502908541095717874629388572535601572954340968281300632852357761510380827733721910298105144168674114000458492760192448497375493358162287626785807975379359987001469882105036987321265846856757528606901421058839136798700287397 - - - 75089855211101765747300894547085312949871336795292159964546821502857006262710931284436535591390767143045054287236700353745766551337135697641239389214003872913304473085672132743841053938472186773425817048000547738177259207808092058727324924409903592113635766451695610110034720923274183936484960662875433336362 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 + + + + 1024 + + 115193322549187017758632085674974727024742715278872315780926012027804032179761766503288065034565716892785818153660349164554433828067796365626741896969380114418490544104123599167386238983295022270967054328089602503480562145153230657099035975059011144762714926206594556617956114445259820923651026107726741377073 + + 1024 + + 6 + 0 + + 24958892788118393840566891402925212894261112686881756396217607457946596306978104211815943994414797105011718075194617345672726305027536665064724927900756862036945765691966423524893153682261745384165128816990435797199717205467355245097126693946214610135412865735012562961328364927779026079460708512689938357459 + + + 24288255554756812624762197103340158750190223778765519768405807403357684268583138358422886605098116268755079717463816662298139317595939687753107981126116196500860143071528623840509966635777831057754249172610936632021767758934196939105040316041127363794901161035243044698624148907282589708017305528332080549401 + + + 98573529002331715221466911082616318301300017750678680593832916072820765087229700809543111818625003499979817183312145679122909425246500434114287363675204505267732119319754784623466080567913652584576116756111506044251229410873182774035682045895464671545948436513530383740487677985431898275771829011975467387636 + + + 15353985435509734717647205939924424374297140311254436480413662376519872061599819892959995176175891437756042491481998969903341756892089428475760114248462830393435227191729623914880110584220456903870872511626091038462298582250901312945423814102221099309496784542055234964849111850334835617876760601457927418206 + + + 17455735070449738054682884370746228687686045089020396998083887583650988955042976829464912841928464950070337180970573621151968757420751546020224392735386909098113189353739054276774294071884697288831510878855213838041505870499205405393921909645992766577060606810395305981595413168173038810933707942671713337798 + + + 99078282433460334122518009685435268135390495565166370788375980674406524442600154170383521782130678737146346515697587435130336220692226983416874121180076768315197607852814628471856417469605509753709709939138595158453850817740160745949448738764045233343710173080910805476352529406131342795794391893459845853249 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
- - - 1024 - - 105921949191653130859423411775455174812642918848669759359209486362932598819678144087209481182550147678529129567658791265359717569767628215894734409001006779022322289698515237895707269420956251973406350695311822182673083730764296195817297540780868975477123852203726080688004629860517990328589192081987644050229 - - 1024 - - 6 - 0 - - 86809400749152861743901567276848272927167445497006079265900998087562865265602440835156566344510296704141655423477235937471795088316625845837856447310120665238699640116252577611027501208177910037535632605368178096550493728239151536133777140960209848761693689914935806579004427834951787425614424456419297157510 - - - 84986197247511436399667031576140728639886927069411759928791244212693888161425776856726174455028312620459053949666751815466973657597394187896486659471058818599622253530061625009497213318036240988480751591194064567662021711447798444988895990719137206080680744526229981752063726938789038885269097160956167285566 - - - 12431205654625222881707000710728606382090929111990041388059059946907607046548243604353853640940005905715357216784232240313960881905454724897804957781475751038209721410086085767242939434308439807150162545625051293193433624790643565812552903666506190662522259255795554682338285362255530961345229551611440343519 - - - 62883235755082005523686546548606789143770348860378546277745391562811162140335817900845352214174699090463099544541601029119065647315851429798873533063329837639373217180256975002663524244050145680516763942257347656552764882712032814090180931672955198158069467918914707575354901887685922556718370751575138342589 - - - 39849433607740902504402507874016885026871507213461501810264903771866537152481854388265980706007990086277706589042473112769024003147970075181100851394556059066286357588607531753104924164102535180160270351409239344423986742160630582682803306956751475609550461013854012988551751425448894542674892017443824734012 - - - 85402225442112559560680078698274218019993940361574204599118634528616463142138719233262976451961276991618853156780942664995492868531530624507421313975512606915096058618792443156198101790705909662504630168187270536791683734761412420713398341369713188166278602069035350011783353145233527044956434445304512600650 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 + + + + 1024 + + 153256019031673973848391853908671616024035351852333113222956212092935054851555144537037154882131071118335109565772920677334385665987953763710322752551766091084637014937633351768184250877579165516584609222393690507834529036303945036774013832353124798268158248184389671641362425541416312746250270416649359548041 + + 1024 + + 6 + 0 + + 15220542722079887934163021578416557040815588753014948049895358680874401987354756483638187693890778200226187944576153001580318905767308325025251868319513838639170229388887094978609944368236261084829465326382756814026047924860100572370509240911903760108844191920274365232194821110327754051188671927504786123847 + + + 143004036495287445500008244565089775614807488065311228319771443644042556939728810959906482515000410036341359319395672341423672298834030730662358936098971678898328809479500096931876973317120818472883465991015596717523641856810286626439287667681040066261020458108584755098587931772918575340120380122391279580630 + + + 25677830626343122473800267766987258667661454338633409925057452295050792502934635228012969731952432090824067546127184820674269109763072029928071755085679552707171555102523382002859000834013865264250888579699016146722510456747010192496630995123022435395781861793364259724814673958020662700602026307416209911222 + + + 62246636121089263731371807945897520167051837454698735241698439734694730001470335211863614247823007078485077900778766898167190790567301408855375740484748340320700390073275392868823940948653806683445411202776990790067823595294042946536030310357110325099679964532575421698733314704640641895828452919877756100011 + + + 109179195904717079139512297958344482754488860947001124419866306632211947700557001412569449694611680557227002345132253379015047209028361122554436255825724641792181226048045416132300441370043533054296640636019094847912470011225895961907747561407131402046285049780521232862899425601689434905370686341564422790289 + + + 72256199900300051197332501127222934244256559778006179914521739477500706464599171904600643790797361089413358501039731833363101680832368594873645195342133343135647784788351460716476460798313313942000048638227363109185805859595520325671335898545619147866290785844770980165710956429961244551737499380764677597447 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
- - - 1024 - - 108440748919252450268428286731731896396610163026933503975849925663492334776921174398497109505538747057893434317250808469760213233529336913398085925870706542294714657431121759666156575676722682156151413720356321723309169997769639095210994084916522091702333943625021802404556103531364881274617202822828310848153 - - 1024 - - 6 - 0 - - 66366383659085004160581858686068110323987677633068554408731820055937312391603116323527462447105256578555787138213126535928787848971976541459974948337601213550884956798828607581314470984305212507805730810283981952589260529852613686591965244366260752647049304254010848262444064395193144695135425020863379006256 - - - 76945724108134514476845806024636683902509514081378625453698025707233689344313131316105525545539579926429167457073332412872790363136331080030707890397365463990420679800561805613345351927011441895347629470989024367971421806479256556337062265729708476344598157347724009574637722602080586962935931878380448404266 - - - 91945329973224060248558889328744255046597767263343203901720894520436658305695307815971264787080717251578623712083670325402817260476998336830698287676420656098045289735223431738396971319193824104754894276305608143683285127818367138056317944418094268645782094697587442950453451099229969927726915095865444522094 - - - 71371194814401374673127041666269343887336750774645785365973831168673801465656031844499219442062352660855087164791888562838903522706610239539435340535864232794707954647487039513635041583341855480149907762844377270478905725702421973086424891767443863000735666109119321036123589669276816773800922411249576027546 - - - 53718436417526636858730643071130396923526708450985497713286303484760405006322845800085165613155450183026982545846694095243620426398424635300019928951028659679765785677107062221527213905354703614993367947430698278405310236478443546679988798318205559042482374923767602250464637773429717300281505631064612985081 - - - 85230469722743515304402648589847925000201154330027354125047810198070022725031542612895149579396712621532910796627591852488733918035116059401887268218978788971949898670298569884150675654662295808772549913103127258327197135266119807509485752123513682985319604190596813804839912737937728219384325250171411540887 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 + + + + 1024 + + 135358305767271858027595880716111530935123928737890043873187024055476620530906467130993033452699358704424795550755169128359841746123492797756886097936671355386621176058979935393331413499392989299082084359031846630046001377108741347076252627789379769344457517235001038532356319713316214499718115421425871569433 + + 1024 + + 6 + 0 + + 54594747011594798877885888974944176740233826058214590608446121481719016646101845365461669609593284564003581366359995275781810124519910313811380876256508679688339828939491429288889804388749815124253867496416627880709040603044538402764027705232404679640769755327219879688706197760711345784098387646185164981152 + + + 132783808999394318707408962088834983207010415125168788915872658758155889296838532193150695880199623917302322850691457856799843846471181568246727469377964494204689790089312937443605415487457400789095132034217110410411016988079403293808537223974569707930874192773033393470383855778863425429691879481694667628909 + + + 9473430635930700050486617160141204494342095550189134899476751191276019107931129114087093973056080555668662930307913633328246702572209665502366737090850431132340577394193612418080423291630390780237790223606432359088325373896719506291987815760514899446327539193574576164858114835145863147018536204496364575294 + + + 90024838355001075777783195974135066596911088933953254044502969121509346778938214241043930641227033089129624800092043075809246544470625613932569785625492513957934084324845138958744207292453298491639912468882105563813341034734148686353752495183156303339463108993280522860556963638419864094636988429994370751743 + + + 45914980508142788475969536593414423447529386876252836641757988714678457126161180788769040893130014877283087923780361131128613703067760746100124401445607902733176021029401905908890233576832489405771907746137014120822037941005000384307118527309121044551993381248785336586579186345829608419256901639247803554604 + + + 32911404065014905616571735182748738235851543040766582724263411775153690607184929086994340376410140178669625764641435927432683863591301353627927154715686151567872995056710033783341401210111884942070839872351093132272880604910175334910646752963148483903851675232134333338877843861382949858872798355076941765109 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
- - - 1024 - - 103432042254953094027999928574250715964500891045142387105955201932618522113984190182166706020884933161447941491385637733523319614167734344468728413306447688694643223282152714640407364090919183137006284201884535802398403524505317171875956878874168571207572265824173861602627771714795571730952163007208142820237 - - 1024 - - 6 - 0 - - 72735857654996330036308578750037768707512446485674661426090344826756269113965804188268267650912305793719752190143646093227347682752079327651194810856984810512909164395531967789876907601998849500709695834360721633503971686727031033634428158149145749257438769804777610989050845392734398678464304671042690689175 - - - 40354197327776309644557445446598247511877805740566355719587647166808789073448238334020156687581688473278073371655120817040636086978579601886371654352774729778337067600125687099708508209515703504788115675665658396923040920295778105284271940275617551147714430295447383909281391532478964687175643491947382829869 - - - 26968813628185832884730391035851987751870560318430849916723371498400782087349207710865186129239304189549444082550532948832976767259584865952574643740037079740215589837871761474656629795571319987839311742585360362081712716843606865678855283492160943131234448889819908044401388366435372206735181092989882690610 - - - 44457756325918210432882749039045279802693637901659165506229652641196771463619711136701874027949976037693870830860638977238468910265640234729073206675396560391192913720942212407458029980943194950742066637775931509413627536969881602485810181257639579907992687706506901124298572869645460421266928082601925747112 - - - 17923816029308169688209802751254596783750808205473920711963121223110109870977619253002898105372250772280013117032657917924973651135856341002576602124287460305553253303790018252719017423511552791332813099369856129658602326535776342375244816034773978221082034151281828464402757244302554451737031177234874936733 - - - 58173516169174283964719668683473056584525739571524859721047404025100657870657926179915235481899922046403049387657375246255178245370444590309046031552510281811181831088860285782828294445034384018959362706962339714212986805788263200055409728428500955125311148857260741294606734880811179920282935017488093954695 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 + + + + 1024 + + 154218268867696507002031865996832738977246724680896068886617497685938467688459935868916544652628785991317792030286811386804084216509428288684761196875989322260388889257097276677216400072227578520525641529006704269719639306215286673007408730828431211470630255070235631883821820735534893283207489831811866541573 + + 1024 + + 6 + 0 + + 27428799928169371477008314260818876148937722875877046040065001415256050285544612261240610068898749426541489168818274025311879557094462504325465143718226701031270459513481171715674711056192203762896591318737473272520615104809732143483277690473125331986133481516425478801944037361281857855867037438256343773679 + + + 105450822515849266246824784593332752863996144824625198279966526580096181889146860866466836912483527896334247490301097916546476481609859267630501968068493335890437763132841945935390933265030348476193713724966585347250648751479602155322327667705579310128424156557476020295924929348119910434857695122123769715348 + + + 17917586169419969792153843627847724624582303970451816452874219660498616008632452910042480347537075057133325092544315346979734775101435525533629606020738633039620963234297245636824119587829479049303232294479234284130684993231299911772911374146097317218619653947965414360245657311825149559284315208240541584049 + + + 83614794643827277304010494713733702635853026857962232621115526420680432673836574945397242148810823271595098760695291447287587902753143969200514260996554707598388279117974226336910323931721647138761776637137666044994683003226962992826724806567215542394880283109239037221417111570642218445097975627548527092539 + + + 98025334882817542595051261918088236466491396073054003041122381828466061599594157519317917789905097080123705591326984935802933433391754654298972150414662017901502818342450898330664054579806253102093229112778500389727696035428993861323041972409204375141288230032727654233984733937127115582284964721572192907628 + + + 103461867044654386108007921528414895482662948754475387341985070060736686576950492180848716520576397704988373242928703953709705994705234961029080392502757613196202086877221834313994327801773914413507546181585432001324248533541087174089562102726527826866350806480335498036140946354815641124317115290718066663234 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
- - - 1024 - - 126228903767442190738148096183580491175038013895363063255063879407638776222007762640020963679700983981505819346117331332097744171511439132259106773717665842976406975673619367222219945376954037887793874062977933096988373359681541459886631958588231575466518127177060945684448323334830138905052399414218163921421 - - 1024 - - 6 - 0 - - 97539931636318677461475619122054540059104052317022399756575154292552051870858044057227021169523273160051067173161809677608371202374236595169900819410518245929982550711392322042314682950608013639486222401760902052975068868934717538248202265198283607804041217016155626510986296204640357633562628725262540901308 - - - 17056048088041119848885497185187738234341957332739548911174241850674169289366712176470014650655283087514808671532359181973245193579686505807246886039638542093762471617521947338468427670697788979094939538614633506767486848270358174624110579657908121127644226601122674835651841028567546912507950233461561314311 - - - 31717709189699030137875842801316834424645064031847570293530325225334129025771209881989868755679274813087722642958802113724122792623999410285511001585168859463078978573404425652982888882289493612951079566418713192311092484146177732644672658032091895076062007702891319957382778438919270892273974397851698486802 - - - 52701408784517534567979255300945480765809161198465471154967839240963141730818870689354317216286196381556788622550165176263143040912951902845119716643679329549799829193894570784536684136260779179477022420722664058284142073288038418969152156881985103589172969912151842893647108788505003435443026642491812317969 - - - 15916170466240831405710269071326971495003989098632832660085003103077847286202099441873708133501162524440579674719437136363718867648113746692100804664108054776712148615544501485090998986423172752761257930805965506564375676115179462856206417265463968081226820646414689722755150455107075664424251782354607115997 - - - 119874392493908971774593399912229045812669019257958357082614870704163802485902701553073252681759628404556483986983935409150939979774709275900622818557001714033801638980212024983490579855036873618987603097875751122714671577192226926342520061281357579934217951516213006849868891095137524137512935354897389930481 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 + + + + 1024 + + 120098847776259535343644334068493409247155794818213113642226621008837548248809756144435391881962615325304472487122528549774300242072619974184058684501061116769021957277559333567971936578385761656133295119311274656165996325688816719676095627842254071860445539705183362636859341285726107647847880667038640384469 + + 1024 + + 6 + 0 + + 78341596191867165364462798149613513767187976045933270925524314074332359105916239984156112944388741605555584315673330918240662669972383036695380216369645786077675668119525313091263106903931060310783249892173696572488213764160500898695655888234795022024571259931035380458667979043363731060752523060256425326493 + + + 92197697267850835637041615816893083978440979223485010849369520091954329556817022954840969220750091574955501530801737742911131398158522167774789346516688492204741057116830688290864687904235809951324327245011263476463848478977798273152839939981363192465690825435376744018481972214855855772912890637337396617871 + + + 4748293030592378955093724566571489011651125070696427417853949295886768378111152102495476227775576523833542397763054262265966439448479602453489588304595952626064095178127493676309959239982750742094802606536171334162655130645407695836907472484934442915849957480725551564249920896993846998541219569493436633204 + + + 104584900904542556799078527703080866806316560026256596079705108220072609345471701770134318641946110143937813605502326970885364040335672893811516334052832715982398959853556119074396097391674101956889279124105778371957287930683941038772719876857983940733827806167120908159325650830304989434548687189098427086091 + + + 91477000374004348014105246188180409651649243135776551322813142142044628230484208001614477763449794744746082101984365227478095962810916246503069968738835364911647338508489896420278550004430041982623071421860079472688566117689119362544066175205618057687399701666608286724650867268340276001512993623664623275609 + + + 27335022029071511973872915368479831202151720242800820669365572158467591925687227633305136848793235934543162969534704442560517668695149887836214069200974132339079102773406068766037767764420212459478276529948373667413279044542607587605142289772231063326758841771162863193523221664294299814482921047353670436699 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
- - - 1024 - - 130984031670979893855543842480345875518508410205548385455401787667182043276909712853992897091674870836021665068146327054461603450458407290201372558787290109357683738428013567907514516775559018701817491758213188304978093675528268199327422042148541505303706207770150984130237176790872039958140095900892697292761 - - 1024 - - 6 - 0 - - 77111031511076776748383055590862571648674736492772474529961718646938316725304876527853934806892564363406371656844786106299018421240298065574103119127179436601308127134820838280671592776233104655784461864696507484750746141074714338613753312756700370784915468572345403051130346709078319417883115672974802169835 - - - 3128131951563621685781519514589290396078543084150675317713253716044387307905521327893562744421717071028534528094967705348771755396568977554185830341410613830519127494248441161017549347924906597526952413022501285246828769224407661000067457541358719277808165554742389274830650941000817519093291137439421649691 - - - 24954141405440090689976175252555167972525713681839903660616337028203242900712021559077665304276350472093427384187451836674689185805100258168917640061516156543626305008035523276260649599372451478761753446079713760095403758829516730955461756588789162979921765890451415813246841487242760610785376086909463933797 - - - 10083134356469565434820655937850585425146227225076587201691007206376287612169498960565670490848694021370067252342213688465673488420651484169267195969254736060823678091580860232493159013856793525376166944993634152015542702135847543328581535175016508032979250811181479986919377039311967364297745111283924007008 - - - 113848733397666003768323762636821213490695764177128020789115723590466213187341258833452173134117916819367401260647045106530664613037790726812093687986435876985971021971510207916178699329669683834822651456959414265166368467473058891635488094103090980035908623302936245578454636917795970043625492656294734023452 - - - 86136816068775947939443892035798452754540048307990163601582410345529875583874238629932272530008216513299726778108060514260087906788536911056614574118478556477474027724459155894339604045879892134387001046080544595464847107133404856959533587474371075416239607580582640652535022808207241217726978029145005615879 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 + + + + 1024 + + 167849747908102684615783031952151303487318618058226134276355868669627336908402995742916429082816062902544246840315676375600682020395918653886440543549039685487527686497944229453172069154889512786032054308546997135806844060341575216655718028005098196791080486235476250761566643135320439910817103719665970114189 + + 1024 + + 6 + 0 + + 124697971864257013069199803276420735672381775609467161633368671004811398338592994292357677388507254846498502768389738866111523924342131234320910182832156897093603904400854292861082845611922732284956492433793209240106822872232125951145778177387397679039918621121927819973078906987741480262525622005602565399227 + + + 108887781890361525299548949264309573612532412215054221866945026350960909252554790687820537292488822159239096136095460817189450475839784419203908369203805504902414189148576907397548005367318289848718165066768409808513010231990171238509327686404013042691377114557387525251911427307934702480124889546002434153883 + + + 99965937256071531833352267584518740705187568678398481975025487900445929854870225696845831801035897840798993192645749908958835960887390699965754669201895122689762609842067032782947025374191336414827383420980245403487860703320619493841364508653990560873053561052051848165272882782658715485304580849894447481984 + + + 135464487014068006350241183417277199933512080629319393539084556152088647569462879342427336794694607292779308330281931121306851709112290516904611886868248721653328973827011082831762202172003407136709090048796766379233700381954200275601566017619852103033202510881086909114257203408422383001855075728038739087666 + + + 116087460929649477650719239236850579624411409915463138669472799334909075618371332653913172377800254417621211492605964716808216033497729198457377469580439281611985552152638264761588841398460105860435413320874653840732276755863584448068058447432518834882323032920701627821579231087160538498920135097072056339130 + + + 87022481899114200452477329439521478334907267121400160768484310083510672665816499561166856734334611173826744984646636728146751086237799447687536072677043559995690196109619136304467129246411278102278767648846219215263506982413472377610126752110280476180152080765605425555155921191279654185124388043571147181327 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
- + 11 0 - - + + + + + 1024 + + 128057967809655946190316507735155452831314572900315216081434860144597217324346737671800302572587640910078110732912465466684478941477363845874613925338791275068167816621932721309235605381772586248486970010063355049965746801462578755831359666996420724229475198439645105729191854361248312605304734475323680662913 + + 1024 + + 6 + 0 + + 60811636929475187479807521649087606074793642064167945690350627603203118950323257675713133373687111123714663109087066267073458476631246485001894677569393649603260477149691339449729864039552273625864812610179069562367245786370215607199308088083101677805342992837524421920973047652387594443568045299878715104011 + + + 71560986262474260038579847733152867125395323692136727882523150181177145526050032346646815633503819181049097447083396963116870388315714388861158191811280162852633670260478236187402519672391362381543748430716574725648848677812893437556332455280083345503039177361800148373565541695573258846852919928924249154877 + + + 5358493014159018151110306019414188401443366482533390828878588153924237270657211162207396455592545292115596564966717448066974022571552087820343845293928484045368156700279200787884399405557838594314421227423879077160333472477688129275324340290022874614042967407069455935447388415804019834527557283355835583238 + + + 9440403911953510704955609199118462522546969159294361115679964001969095067128208202978671380235142495494192920664243060842431049236464627103331285996753378993464968648353139689202039972946351834805543874912252883016750152554402795151625609573033493183190907610839726606922080056808873159110535921110839225918 + + + 34601241858178235153992489154363566911322825930412755051942961530163789553279237024169967243263931210587905323687670939702730687998131084839805896091785126613296047470576600055262500331821637746680489652121076447750079042944735474064557177506619768477733608759334395601504750316910835074596407622363931297695 + + + 103450953660312905541961327136746359534991486059040490771968614429013794227835017626759804639288113432551732347712210332460709755012800755979360542019454727242090797411218789006851073710562599252458946620552051918314153874747184637728072116094587384838416002546398982033848043597058533784377942968102172250659 + + + 1 + 0 + +

+ 12932030508236240029500379006897241129956579101695632927019316457384709196393771888005191041903025893215144948249883093198348475278546477203390317270105679 +

+ + 9902386769664478589840240464665057831133423813801796716114600855905375529754843999999225688343006241702587573209999717516477696656645009688715730598624047 + + 80 +
+
1
- + + + + 1024 + + 91338861134529173742636614734321283317712406433818139285229062454925111527732609262828687047423080667973258817589805005737017416371360314088086808443898371429020158735259589920882443779130428607594850787634565846387075036083051955856286100630464641033224957452092909212599715224401427904042049536509604893693 + + 1024 + + 6 + 0 + + 88481512963655310506095083872998303955363103665395614689748950761935149130592150567352051526842435768907883513122638406071951993833483039104880894260670448994086429616644971856997369229550170174238792300740232364024915015016653492885640971890845653859579668498528250516917066920672069528744730214455335881003 + + + 71420609539497237732868765033013438071208066944625734387424793864620282249588182875061993503837717471514509627177747945260865425509223920765478106067601828682271744524355493795121669193837190303641492443480194307599715826281960573836394123684702869297115710345424755375986644023739445330856168082010838417938 + + + 36213374277915021187960501154206429350509009943784937342853640962344665273661370341432812162660134104129081769292257555453657933322026058920570002011215114885632603237420344104120014493999772566832623489577942137696416594059207873047026684531831127098662368796483679106715230357303209903005563129291440998125 + + + 88784875219103004490867409187796580439336028275646934064032325734642172796350750877782655631487263690600595545185986973949637793376040039529334242727841787186152368722684829777472113434707623526142748869410906573019822447060135044716736888756586491608663760971724703067383426197232527066117239191970436021914 + + + 57669682815414213701829150785790139820922208365396385382451270040015047105011059602270677532141334599848749895445377163377797098101769663138915670832338561398070313576223809679656089041902001668549387570675942187547921753080749715443394968434937329744189522351133848627606864859717699163427995004551470140014 + + + 19430387956073665040008742545168228237366626380409449215616316415682054432029605888008345798193251163116713132110293851289775570086405711097037612492724618955613522669964620645767675728759532995017555557036656920568589220029848250912688353596366989096421783410644212433994547565209779383923475304673100010441 + + + 1 + 0 + +

+ 7590313132316003273918078590302512319095378293744922263631882454117055270026174894373664622063534944373597887745176839805114252442895212090845009070876059 +

+ + 12033609093892453905143611421316260116392442619100420560800021219786194165358425170485864622027203788410560571310992155037737755554341786034296519732793927 + + 80 +
+
2
- + + + + 1024 + + 171795367802537336198216850040760302817719433285673072064016704297509263294972920968862879995019333546807716681922194952612358665832924006994420672781322683935998563828829629166676961578310364216820723333284118541610355614763234524893877254301205676826968663616237843247997193664755408992255295724018758287453 + + 1024 + + 6 + 0 + + 138781939743420141798085654234587085378791442750844156618218315519623156030775014083940843628427157991650536995512183146050090364430217798889903276779395691314769341501283521555441395248293145295446229257598584303226472282606025256289516823083353133125249557574662930559464988881796972570415006594877835195261 + + + 168420371175596160385314346470541456127930556988792934601264980767954150761074401191883764002057676025574635595559453082438403114835695017344400960903147888338845250647685131378444914574667053754042483424927960459645361430078126904416924147233083786086593890435155965855696708192722757613306648217414021209339 + + + 164599507864917269230220181044130466242640054454386799153052272100119238662434506377210871322725801768535465849520862187042461522458751851837119010844326508994699806461980159073458635731317238484887665362257435016594387971946664996341942792674855452076757886270233668811767159399329679444242304826944461878356 + + + 112022954554594868430694861746706902810007259966892035372848716164773714721760248918761857377457366770462246217862095078291990529093104794681337350992919876990886726535142991553290065736768419334005963502455897767959870639353796998608846837617297713305741565185682566104560690180553705181428610482999491959762 + + + 20795710379390313360149837901235593902809611922782438280826554162582584185176550436631972790505407403299851110962435492486911884529635673218790787915570636384717044595376003628898518022547995524968409598599237503027024128328270655662334146591298270627006489949537312823974893037600566816074625503584300399503 + + + 4461068203835146920397273122878996496925951644023334909782795888195924230363311467297500231054245083629066539839024032350563196843805187870921285704555947110972472049763739700924273806542377974583744547273338787688284998293736197541473212310650426901783545952048410414287416361433915264087521382790658628498 + + + 1 + 0 + +

+ 12984815465718139976464939024875001723229509524339667690378713583638428557083258852077827822717623083472588218407867051847898495798522333139201280857415519 +

+ + 13230482039279100231549510012632674263858285311407266814423211632024536906105987751850169694421467822291911960770965201757888760198835329800602452213646787 + + 80 +
+
4
- + + + + 1024 + + 107678493864345648666726963381598843005045134906745773568855127179729298765945796229988935480734186762723475076589458553114861073591179889992284613957887798550444135071834300620151269193028269405467525155137973905598460168964059816679287733081423902287277428322195154969572934367847409309681954541961841211929 + + 1024 + + 6 + 0 + + 34780567649645587652662047318280460216197594322629290659397343806640717111602043777551795972363990570490561518129361133754971748815062877457811980871870613895746761204692874944262181605786891503668206019069701677551111685254064897625906904673396799614054762342291638726110702862138766341205373553864835127477 + + + 76770578985664099191449798911850613016440202975139749844785468106943538467941487623782662375335620379715667015148235397661770125559100524256505138827952950374296533996410404476470347577736554558794350087928716157046782489969073300743386412321573188949782078100848155826141059164451205262811577282438487833155 + + + 19375132007991059652876546182462672768720429677050803522934111565324016495763732172744623907045335493048740541182304274405106110493850369225158004210873483104238595711350247509966292622988932139561490663242014148110393502548086758118819001913181597386000596861820476450726333113377798106479230138706277155435 + + + 60332745111136671951489671083751897003291069716229419557442175701860610038139875996851654495020782497922916125497030526867835842055895873784260108184155213565134969114645958871640895775675472360543614497922018081777590790520072701770098022598964534954182431602697737796983390272144688966305745888541862833949 + + + 33206030625501357397902828493305862279894195856045523813806319914644617357371406587381751252409214237464923457683937662308696252667537129026830911327626477920950026367523422037741403916073653057335758700270326029776865721695045422550695292453931419295319756838382198216938790815705554550670037002167896435708 + + + 33699591887245320183352886957374795158953603724548326397696125237452265579267587282433792785552885615789973016310923276732538075279246287329477093697179355796742915804057038950601496710139911151519055346593812515824483642829165138763105492040862107512334441962031341198253373030460133402288720613467576919651 + + + 1 + 0 + +

+ 8086445429826466766976840778602128556427763126861092718555085428344325918560612728005964357058814370039705887555080490065308264985839108620298163559066147 +

+ + 13315924134871259995943889972263783197676570583006459035153156240747027875844241230942104155569988885879710233246386342305956396267067502039128111156418707 + + 80 +
+
8
- + + + + 1024 + + 123460587970465722399480599701446111042791049424678164510782348298178989524706869827218072757318065802572872977206189692439610889543998303448261820274781115343738147716328254096174904353808537339736300386924394267507766388682907861666597761952802807474810395363126049870826035575374238638068965983199376357813 + + 1024 + + 6 + 0 + + 117318302352368229229163809607702479318456428030157262995598611780776136494163450278418011369672196225024705223924157260734348678181103931116903595932563324645629923260513068155684589997607606713365161836567403767936006638718885167253192939940642824452024816730744123545240701916149057716603434108694989710429 + + + 79166656374368484214654356495255053395213742590584206280310930719755653489957925930346542517512620192097650425359579247070837443830862748231859562053718573394014868991678211219437490529223024342458612272327848652593110612340785752785585712120010687405752536405399684337596148008796260805479427829450136814686 + + + 40871868938993875410426205996751811587721008167871813439166564189762055623031521920195950886062485740929198925966775524584648439881883879228755988003547754790287586711275993853306093079373185290320968524077798129432974504079981251722944994855192019937284992580655570885903256271403090577186422692725459831875 + + + 89892620900640290140283566392805476442834511036692916092709883776370123872836264775868321860590685970283545083118729182759253902758383167687729739268452078465233562037688700620432639773342196188561501129246210605848453748122752153274263445164184465697547705606339433632142128437959746969173608800415728397931 + + + 121709777035471737364513670422914240357059445755508125094002474776054087244214559702633254647901247822895427221568520569724729995389163298559564480170015494003587855303221851200035414262844476231232261394773812801023837394666069091883472673028207084029985001140015089782123008327089253959339518752984564005371 + + + 118368291349285147157585550327202423335817645258822478079337019930721123815468331635525068128544253736950377216631099734999157547924851998471340790034858629390897530180532960195293567558086925678406847565038276833217752653830262850771875793504960255927890257698780412927440166594709334246027496966288743344300 + + + 1 + 0 + +

+ 9555708939079495611355915185979699054940167384681225047725748670929850843599516084564504017739835259712298489561139897471949689101632199222485821907536339 +

+ + 12920086699748173672215351475621638389273860195435770401619903340348767410733675655724985891607786607181490238978036873680082748103544680734516847406362967 + + 80 +
+
16
- + + + + 1024 + + 115193322549187017758632085674974727024742715278872315780926012027804032179761766503288065034565716892785818153660349164554433828067796365626741896969380114418490544104123599167386238983295022270967054328089602503480562145153230657099035975059011144762714926206594556617956114445259820923651026107726741377073 + + 1024 + + 6 + 0 + + 24958892788118393840566891402925212894261112686881756396217607457946596306978104211815943994414797105011718075194617345672726305027536665064724927900756862036945765691966423524893153682261745384165128816990435797199717205467355245097126693946214610135412865735012562961328364927779026079460708512689938357459 + + + 24288255554756812624762197103340158750190223778765519768405807403357684268583138358422886605098116268755079717463816662298139317595939687753107981126116196500860143071528623840509966635777831057754249172610936632021767758934196939105040316041127363794901161035243044698624148907282589708017305528332080549401 + + + 98573529002331715221466911082616318301300017750678680593832916072820765087229700809543111818625003499979817183312145679122909425246500434114287363675204505267732119319754784623466080567913652584576116756111506044251229410873182774035682045895464671545948436513530383740487677985431898275771829011975467387636 + + + 15353985435509734717647205939924424374297140311254436480413662376519872061599819892959995176175891437756042491481998969903341756892089428475760114248462830393435227191729623914880110584220456903870872511626091038462298582250901312945423814102221099309496784542055234964849111850334835617876760601457927418206 + + + 17455735070449738054682884370746228687686045089020396998083887583650988955042976829464912841928464950070337180970573621151968757420751546020224392735386909098113189353739054276774294071884697288831510878855213838041505870499205405393921909645992766577060606810395305981595413168173038810933707942671713337798 + + + 99078282433460334122518009685435268135390495565166370788375980674406524442600154170383521782130678737146346515697587435130336220692226983416874121180076768315197607852814628471856417469605509753709709939138595158453850817740160745949448738764045233343710173080910805476352529406131342795794391893459845853249 + + + 1 + 0 + +

+ 12673289315868749623674662876792526399689105251553138253832866963657700201414882030685426404271074917375018034885700283434611314390001132581350346803957507 +

+ + 9089457336458712030766629429550151802473559635837189343206196901440327945060996267506637537707282012347200095016039598579224618836771879940545740195754939 + + 80 +
+
32
- + + + + 1024 + + 153256019031673973848391853908671616024035351852333113222956212092935054851555144537037154882131071118335109565772920677334385665987953763710322752551766091084637014937633351768184250877579165516584609222393690507834529036303945036774013832353124798268158248184389671641362425541416312746250270416649359548041 + + 1024 + + 6 + 0 + + 15220542722079887934163021578416557040815588753014948049895358680874401987354756483638187693890778200226187944576153001580318905767308325025251868319513838639170229388887094978609944368236261084829465326382756814026047924860100572370509240911903760108844191920274365232194821110327754051188671927504786123847 + + + 143004036495287445500008244565089775614807488065311228319771443644042556939728810959906482515000410036341359319395672341423672298834030730662358936098971678898328809479500096931876973317120818472883465991015596717523641856810286626439287667681040066261020458108584755098587931772918575340120380122391279580630 + + + 25677830626343122473800267766987258667661454338633409925057452295050792502934635228012969731952432090824067546127184820674269109763072029928071755085679552707171555102523382002859000834013865264250888579699016146722510456747010192496630995123022435395781861793364259724814673958020662700602026307416209911222 + + + 62246636121089263731371807945897520167051837454698735241698439734694730001470335211863614247823007078485077900778766898167190790567301408855375740484748340320700390073275392868823940948653806683445411202776990790067823595294042946536030310357110325099679964532575421698733314704640641895828452919877756100011 + + + 109179195904717079139512297958344482754488860947001124419866306632211947700557001412569449694611680557227002345132253379015047209028361122554436255825724641792181226048045416132300441370043533054296640636019094847912470011225895961907747561407131402046285049780521232862899425601689434905370686341564422790289 + + + 72256199900300051197332501127222934244256559778006179914521739477500706464599171904600643790797361089413358501039731833363101680832368594873645195342133343135647784788351460716476460798313313942000048638227363109185805859595520325671335898545619147866290785844770980165710956429961244551737499380764677597447 + + + 1 + 0 + +

+ 12342925706968186973716394535438921214235596704954293960842039701459560221839812692276085541622342123471691734600034990812679842472477393419982807837038439 +

+ + 12416506642760835382914337605608007021637845840379701356494020719607002466778798575874134408246939316921404868882276829304115457690088629985078174708274319 + + 80 +
+
64
- + + + + 1024 + + 135358305767271858027595880716111530935123928737890043873187024055476620530906467130993033452699358704424795550755169128359841746123492797756886097936671355386621176058979935393331413499392989299082084359031846630046001377108741347076252627789379769344457517235001038532356319713316214499718115421425871569433 + + 1024 + + 6 + 0 + + 54594747011594798877885888974944176740233826058214590608446121481719016646101845365461669609593284564003581366359995275781810124519910313811380876256508679688339828939491429288889804388749815124253867496416627880709040603044538402764027705232404679640769755327219879688706197760711345784098387646185164981152 + + + 132783808999394318707408962088834983207010415125168788915872658758155889296838532193150695880199623917302322850691457856799843846471181568246727469377964494204689790089312937443605415487457400789095132034217110410411016988079403293808537223974569707930874192773033393470383855778863425429691879481694667628909 + + + 9473430635930700050486617160141204494342095550189134899476751191276019107931129114087093973056080555668662930307913633328246702572209665502366737090850431132340577394193612418080423291630390780237790223606432359088325373896719506291987815760514899446327539193574576164858114835145863147018536204496364575294 + + + 90024838355001075777783195974135066596911088933953254044502969121509346778938214241043930641227033089129624800092043075809246544470625613932569785625492513957934084324845138958744207292453298491639912468882105563813341034734148686353752495183156303339463108993280522860556963638419864094636988429994370751743 + + + 45914980508142788475969536593414423447529386876252836641757988714678457126161180788769040893130014877283087923780361131128613703067760746100124401445607902733176021029401905908890233576832489405771907746137014120822037941005000384307118527309121044551993381248785336586579186345829608419256901639247803554604 + + + 32911404065014905616571735182748738235851543040766582724263411775153690607184929086994340376410140178669625764641435927432683863591301353627927154715686151567872995056710033783341401210111884942070839872351093132272880604910175334910646752963148483903851675232134333338877843861382949858872798355076941765109 + + + 1 + 0 + +

+ 13318107756312790859351398116542175724849222734068960781305693360971589188723148557676433655469259538839570794714793364814074380377642061943802625475030007 +

+ + 10163478794734330182377840913723115665713256953124119469242480062221283140639606280259659552725660927524440315179857892001570482716740571281058839906999919 + + 80 +
+
128
- + + + + 1024 + + 154218268867696507002031865996832738977246724680896068886617497685938467688459935868916544652628785991317792030286811386804084216509428288684761196875989322260388889257097276677216400072227578520525641529006704269719639306215286673007408730828431211470630255070235631883821820735534893283207489831811866541573 + + 1024 + + 6 + 0 + + 27428799928169371477008314260818876148937722875877046040065001415256050285544612261240610068898749426541489168818274025311879557094462504325465143718226701031270459513481171715674711056192203762896591318737473272520615104809732143483277690473125331986133481516425478801944037361281857855867037438256343773679 + + + 105450822515849266246824784593332752863996144824625198279966526580096181889146860866466836912483527896334247490301097916546476481609859267630501968068493335890437763132841945935390933265030348476193713724966585347250648751479602155322327667705579310128424156557476020295924929348119910434857695122123769715348 + + + 17917586169419969792153843627847724624582303970451816452874219660498616008632452910042480347537075057133325092544315346979734775101435525533629606020738633039620963234297245636824119587829479049303232294479234284130684993231299911772911374146097317218619653947965414360245657311825149559284315208240541584049 + + + 83614794643827277304010494713733702635853026857962232621115526420680432673836574945397242148810823271595098760695291447287587902753143969200514260996554707598388279117974226336910323931721647138761776637137666044994683003226962992826724806567215542394880283109239037221417111570642218445097975627548527092539 + + + 98025334882817542595051261918088236466491396073054003041122381828466061599594157519317917789905097080123705591326984935802933433391754654298972150414662017901502818342450898330664054579806253102093229112778500389727696035428993861323041972409204375141288230032727654233984733937127115582284964721572192907628 + + + 103461867044654386108007921528414895482662948754475387341985070060736686576950492180848716520576397704988373242928703953709705994705234961029080392502757613196202086877221834313994327801773914413507546181585432001324248533541087174089562102726527826866350806480335498036140946354815641124317115290718066663234 + + + 1 + 0 + +

+ 12536655577251435153297128528495279017070952231480978492276109251795186322333973692359731778853961591868183555794714823581445343414531738768400801564320547 +

+ + 12301388350138248799753824840982869068812246029803271748337924627397472168580398090458209842652194733464336605766181794711010942109258987663347521456971959 + + 80 +
+
256
- + + + + 1024 + + 120098847776259535343644334068493409247155794818213113642226621008837548248809756144435391881962615325304472487122528549774300242072619974184058684501061116769021957277559333567971936578385761656133295119311274656165996325688816719676095627842254071860445539705183362636859341285726107647847880667038640384469 + + 1024 + + 6 + 0 + + 78341596191867165364462798149613513767187976045933270925524314074332359105916239984156112944388741605555584315673330918240662669972383036695380216369645786077675668119525313091263106903931060310783249892173696572488213764160500898695655888234795022024571259931035380458667979043363731060752523060256425326493 + + + 92197697267850835637041615816893083978440979223485010849369520091954329556817022954840969220750091574955501530801737742911131398158522167774789346516688492204741057116830688290864687904235809951324327245011263476463848478977798273152839939981363192465690825435376744018481972214855855772912890637337396617871 + + + 4748293030592378955093724566571489011651125070696427417853949295886768378111152102495476227775576523833542397763054262265966439448479602453489588304595952626064095178127493676309959239982750742094802606536171334162655130645407695836907472484934442915849957480725551564249920896993846998541219569493436633204 + + + 104584900904542556799078527703080866806316560026256596079705108220072609345471701770134318641946110143937813605502326970885364040335672893811516334052832715982398959853556119074396097391674101956889279124105778371957287930683941038772719876857983940733827806167120908159325650830304989434548687189098427086091 + + + 91477000374004348014105246188180409651649243135776551322813142142044628230484208001614477763449794744746082101984365227478095962810916246503069968738835364911647338508489896420278550004430041982623071421860079472688566117689119362544066175205618057687399701666608286724650867268340276001512993623664623275609 + + + 27335022029071511973872915368479831202151720242800820669365572158467591925687227633305136848793235934543162969534704442560517668695149887836214069200974132339079102773406068766037767764420212459478276529948373667413279044542607587605142289772231063326758841771162863193523221664294299814482921047353670436699 + + + 1 + 0 + +

+ 12065972956960263054303683531293153220877545209080865782763360344896177242905958506299126614232867538807178063979363544150515696532612909118238113675335407 +

+ + 9953515411036989749571851292635891899300129938693414036200774667401727577909694530750019470986492657545284851625143349646524000492135746632402749851724667 + + 80 +
+
512
- + + + + 1024 + + 167849747908102684615783031952151303487318618058226134276355868669627336908402995742916429082816062902544246840315676375600682020395918653886440543549039685487527686497944229453172069154889512786032054308546997135806844060341575216655718028005098196791080486235476250761566643135320439910817103719665970114189 + + 1024 + + 6 + 0 + + 124697971864257013069199803276420735672381775609467161633368671004811398338592994292357677388507254846498502768389738866111523924342131234320910182832156897093603904400854292861082845611922732284956492433793209240106822872232125951145778177387397679039918621121927819973078906987741480262525622005602565399227 + + + 108887781890361525299548949264309573612532412215054221866945026350960909252554790687820537292488822159239096136095460817189450475839784419203908369203805504902414189148576907397548005367318289848718165066768409808513010231990171238509327686404013042691377114557387525251911427307934702480124889546002434153883 + + + 99965937256071531833352267584518740705187568678398481975025487900445929854870225696845831801035897840798993192645749908958835960887390699965754669201895122689762609842067032782947025374191336414827383420980245403487860703320619493841364508653990560873053561052051848165272882782658715485304580849894447481984 + + + 135464487014068006350241183417277199933512080629319393539084556152088647569462879342427336794694607292779308330281931121306851709112290516904611886868248721653328973827011082831762202172003407136709090048796766379233700381954200275601566017619852103033202510881086909114257203408422383001855075728038739087666 + + + 116087460929649477650719239236850579624411409915463138669472799334909075618371332653913172377800254417621211492605964716808216033497729198457377469580439281611985552152638264761588841398460105860435413320874653840732276755863584448068058447432518834882323032920701627821579231087160538498920135097072056339130 + + + 87022481899114200452477329439521478334907267121400160768484310083510672665816499561166856734334611173826744984646636728146751086237799447687536072677043559995690196109619136304467129246411278102278767648846219215263506982413472377610126752110280476180152080765605425555155921191279654185124388043571147181327 + + + 1 + 0 + +

+ 12636642715417859827101007353201088998153392966769625361518956454328272594691632711789366661263629504337888950179922382595129311605158283150634452408979463 +

+ + 13282780220042989825847520435951613240963422612857516952397101500145285194109725467697923880234771831873607951414903374146816937585493435872195952405446603 + + 80 +
+
1024
- + 11 0 - + 1 - + + + 2 - + + + 4 - + + + 8 - + + + 16 - + + + 32 - + + + 64 - + + + 128 - + + + 256 - + + + 512 - + + + 1024 - + + + diff --git a/src/new_ptr.hpp b/src/new_ptr.hpp index 7c297bc..d369aa1 100644 --- a/src/new_ptr.hpp +++ b/src/new_ptr.hpp @@ -1,106 +1,16 @@ -/* - * new_ptr: allows you to do: - * new_ptr(args) - * where you would usually do: - * shared_ptr(new T(args)) - * - * from http://www.boostcookbook.com/Recipe:/1234950 - */ - #ifndef __NEW_PTR_HPP__ #define __NEW_PTR_HPP__ -#include -#include -#include -#include - -#ifndef NEW_PTR_MAX_PARAMS - #define NEW_PTR_MAX_PARAMS 16 -#endif // NEW_PTR_MAX_PARAMS - -#define NEW_PTR_PARAM_DECL(z, n, _) BOOST_PP_COMMA_IF(n) A ## n const & a ## n - -class new_ptr_access { - private: - template - static void destroy(T* pT) { - typedef char typeMustBeCompleteType[sizeof(T) ? 1 : -1]; - (void)sizeof(typeMustBeCompleteType); - delete pT; - } - - #define NEW_PTR_ACCESS_CREATE_FUNCTION(z, n, _) \ - template< class T BOOST_PP_ENUM_TRAILING_PARAMS(n, class A) > \ - static boost::shared_ptr create(BOOST_PP_REPEAT(n, NEW_PTR_PARAM_DECL, _)) { \ - return boost::shared_ptr(new T(BOOST_PP_ENUM_PARAMS(n, a)), destroy); \ - } \ - - - BOOST_PP_REPEAT(BOOST_PP_INC(NEW_PTR_MAX_PARAMS), NEW_PTR_ACCESS_CREATE_FUNCTION, _) - - #undef NEW_PTR_ACCESS_CREATE_FUNCTION - - #define NEW_PTR_ACCESS_FRIEND_DECL(z, n, _) \ - template \ - friend boost::shared_ptr new_ptr(BOOST_PP_REPEAT(n, NEW_PTR_PARAM_DECL, _)); \ - - - BOOST_PP_REPEAT(BOOST_PP_INC(NEW_PTR_MAX_PARAMS), NEW_PTR_ACCESS_FRIEND_DECL, _) - - #undef NEW_PTR_ACCESS_FRIEND_DECL - - private: - new_ptr_access(); -}; - -#define NEW_PTR_FUNCTION_DECL(z, n, _) \ - template< class T BOOST_PP_ENUM_TRAILING_PARAMS(n, class A)> \ - boost::shared_ptr new_ptr(BOOST_PP_REPEAT(n, NEW_PTR_PARAM_DECL, _)) { \ - return new_ptr_access::create(BOOST_PP_ENUM_PARAMS(n, a)); \ - } \ +// wrapper for shared_ptr +// +// could also use tr1::shared_ptr +// http://gcc.gnu.org/onlinedocs/libstdc++/manual/shared_ptr.html +#include +#include -BOOST_PP_REPEAT(BOOST_PP_INC(NEW_PTR_MAX_PARAMS), NEW_PTR_FUNCTION_DECL, _) -#undef NEW_PTR_FUNCTION_DECL -#undef NEW_PTR_PARAM_DECL -#undef NEW_PTR_DECL - -/* -// Example: -class foo { - private: - foo() - : name_("My Name") - { } - - foo(const std::string name) - : name_(name) - { } - - foo(int i, int j) - : name_("I & J") - { } - - ~foo() { } - - friend class new_ptr_access; - - public: - const std::string& name() const { return name_; } - - private: - std::string name_; -}; - -shared_ptr bar1 = new_ptr(); -shared_ptr bar2 = new_ptr("example"); -shared_ptr bar3 = new_ptr(1, 2); - -delete bar1.get(); // won't compile - -foo stackInstance("example"); // won't compile -foo* heapInstance = new foo("example") // won't compile +// XXX use brownie namespace +#define Ptr boost::shared_ptr +#define new_ptr boost::make_shared -*/ #endif diff --git a/src/precompiled.h b/src/precompiled.h new file mode 100644 index 0000000..60a2d2d --- /dev/null +++ b/src/precompiled.h @@ -0,0 +1,55 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/src/tool.80.bank b/src/tool.80.bank index 4347159..03d8607 100644 --- a/src/tool.80.bank +++ b/src/tool.80.bank @@ -1,1199 +1,1768 @@ - + 80 160 0 - - 1 - - - 1024 - - 135218297597036027447710869998207208754674606065213053565477328119318307615909175526780620233213961426236879812016724358445271350587363396402647314849305621510012071242662065255846791249159498224132174763132326817952843159753470530205099792627946188037319629342446887089368727200769772054196948434863869529351 - - 160 - - 5 - 0 - - 18208244590241069583945724715874667682021402381869122752191191011908431102922032101750150575398954442568433700325906936509940645446026799664167551673847031697308843403021189608647351053797462122799257330721911677799321262955518693413213492091091575031816278740442189255351713608125699206715386379787631136553 - - - 131540008933434439797345948918394261880173787648911427732001625350824200688345754946399083539327263132740551020405739246247253074652019164142804882841356667895761572327083692446423627850400085866440853738034890285736115428435401625648425367295082976489978122036860020082169538328537073357748608207155548379323 - - - 91272725802016999926151875073739471182280652070511760378850930760962342713681923927240228531890954606645620919696449005573523123959193016212029127692446066052985178174169442856720775137926238522268128669447003671386368122267146212347585948046238834952090600178685872531305631839437669077746419434508311013383 - - - 3469882655055659224110796061184855363317387895617202437236151222595676437356010103862254518369649822515215063723506132692782175600271281713617198794137567836935269721890075460941750695290740788356081320228309732607034651115489632489205897080536002378820247683062542665099079636940180095369957072814768593231 - - - 30597361783781676797521480522484587284592145075325385388829200913267968937767278691821499603927812902193661100233957450599038048910138756474842188339778893991336983286399329800775281795383858969341862563509964623791941848182839037452532512334863582834255155110971223966672416785184918358620159650430082221670 - - - 1 - 1 - - - 1244736658805837004330109075480297814211691129853 - - 80 - - 108632052121579197510727782738809674259658270667513999458233547257208694922342747151016335495460550311128145055639237925983221319028074946360737371864153589540779403314101093667591328047044940954750182782695379846347426671180342818611100418161230058992137373950 - - - - 11 - 0 - - - 1024 - - 95288621726635968872770037150784213196985326131676843097938547136462929264841295546771500388417671294966257595433760953200547360249349740933546921081522125275115437397098973842360250826812492033263835470045512007784622189487961151941432994089813647862969606517420125770262374746820810455414109837014665020593 - - 1024 - - 6 - 0 - - 91765448215067823325795421667963131269512371058001714218791999926519624355910110183970996302294343489487711637666736326993210098027018038695140474955963214538087467579370979300852114793975820201555823972904294803171664470191975084609410844843699562290002166572267125918023256183462931816866438417011288387597 - - - 40294104858917502207884187657330535256083121883845488158774475159839995768781522379296790456727414484487297945298577860348991280709907143209769263860571497761805544744736759396126801492587046865066754602032016892804265697920244305298307566030270409229660322389503909826850364964925423148539479481422269333081 - - - 37181927301328601230229509824050779944931890417371371899093425328383585668806438133965151915167895804116880861939436384092456427888455471167585465876401001715893034711967342076190251284011995257843683345831106685333128346207762133410990676468736935851749651853413574904157556618055537455150277384533267079125 - - - 67347955068046617987078271939584408214616385355082946652652558963004113886368419385065451148614904475564270298464228947932932400883150877198113111247417898333396047869562351233676189346740404229714576046346513957179597233959209788707913957203885684064580064021423353037303259164004893420671864177938248968460 - - - 57669000393863291465997741294941801999274879223745070978194979170456208486599787020905477696350469460233194798640650624252822592978323224264539104432394194340083276480589910796208101428768941276014721718948586671096753212427551901667894807759957845419273976923255392385335476551662714791721228240704492903472 - - - 26693245241650097930528211048506005550361754351170897843150689991780056709581651682450255357597353232814904745727236148991266683037674349270826986976517570248012352181812879805573443388140013853869016411689779861764052607477431441788218487198174043217144077012585519677983607140788959524397744180396725947903 - - - 1 - 0 - -

- 12945228753730753010799769308073904192740186358719876267195328129219509437411417573953218759295559598225286103870215718789833621752665010750790287315319939 -

- - 7360906751004631250663929850554567318649550553171792610854559855412670519030817242584407983255129240033300713502277730430122399107318722593126054332128187 - - 80 -
- - - 1024 - - 93754528746270947617601056633800291364861682298136548284561953146489022955904322738006597336491255826850217147425593207106178206216828010702018655449477593047795515376414948882934704904553519186055641276786533221369873508841086692167716664918409533164054262959579372586508029429553217016081926497726561694521 - - 1024 - - 6 - 0 - - 18718193641957314100730569270853083678067699981231377053218236440200570748514195983062189820845228989708114721036335865296839656769486571188331480498517073112230023384223396819136721032148578078215922950710122782193152236503585708948416278154158382262317851500701694633329332013554441192971028421049617669489 - - - 82896076754196599390958700658750134011593697922866943134696485394164355313829104791709121309680409072619102123137695639536409295590399553682662365861769296142916411017933128214043071624336717400223646514016780377509575552315798740608282027520372471946643222670649888877298101008604716866742635601384004923854 - - - 21409157001559082435198762389634006574011661991672395549556344452730268173323934115852207531740777161515961701461098746369193405027011628705790585563246956558634006855496001853186543137136893612905388690157500633486730387558679778087776089487182622558762079085605279790603515779276275365424877533098872706670 - - - 70565991640659014530782020171678876734088049089005570216201610770536518351424325792391149871467733547040543767770865459680906464111242548129734433235362473871904159393238510211564669982290551880614995619280240162572467822996375606151081508022082119563011842579690659846853164036860838326243732394765514573431 - - - 77371797128912592221963604938094942633911707145381583508738772419154024425791944438183290768376322858296041782716140964031431791761038113224908751332497360736934697933992269356158706338071119510267730514533442260161070478749011694884944792352277737582112505303044197289488663410941538147133378198748067540370 - - - 82906267256926337774982154418825451735160292585995227482630966060005770865073506792587615848461940397794441648783258220198681551004852811134622576927680502421722981730340736873927483483912074641562013505776184518064639060490292519532693639651522247920944720222077401382740855126956599277073236976642634255886 - - - 1 - 0 - -

- 8140140402670500074827086978592887781641220395541539234547541038812605490013535213539557271263723713211620806619763966987005864890332854132366684407666847 -

- - 11517556713826866125245357271716490213591260670938001540496416425981617727927140436095943977970211512553910762852027978664642953948792430097326141275778343 - - 80 -
- - - 1024 - - 117121510340484883218702815716016593017369400197866007284904378631159197139001634351397099006348261090254639042478158024516471273585541723720875693552232460895578362633596275449655253304174140947289638902997286514465275801294597279338210032808446791251347509758362087729471534556332712094330499939197910698121 - - 1024 - - 6 - 0 - - 15107464790949779810848925539036116589164680473165481843812014434604020175520176471688364414295094594789131782714144993286259674728780246748998301348736396420755743906492330603688120075762111416310712907772599039447961132953865243297778270824554218777752426713792107606639541765351560469580417085799109151109 - - - 113132619367906663802193126722604452247067407379700239211440005578163970000183414500162238958023667292239182925037826362117516957239919821570280746619833192108348188339728009997904509491615767024576962472478540005115623781145645859430146502168842179897232042057741008928306919479034320821732539898654106307802 - - - 78831244758190029101616472362891555519371645829273483715261840379070989387145987292415360310610897488118375589143503280479343341807586436831967002903765461858758240031822865686048256893617339372987036343650345119947926372267957827867520649710294149310400270822176566699466347972287709536682523581276108603165 - - - 89583752214253883440042346912037084568006500039317399385601176574344374326678906556169715887314185264099152754269356405558198400381910728064450965723135896789762010431669178119883031744022651457596440185119193793176699852604878873526015261656614848828142855743809311777609303941862248597137943126610861447582 - - - 684918354387786416205491044839255104512468520452805205068164464332390890861013726899159853659380168702172547004069779846306014103550976054178864271837177474931121067671438226162027556594210608928930392798386737184879547657514532124037440133147012810854365196162946992675626655050241753400618846478941872959 - - - 2827090550656972121690688796630460105969591925581289110535338322165933007662678927433743438230413437638688120784053460847485119328516825633705134738699602887927163627101863584369718271691217967413302030401970248252827616171028363054960352533790801024629520084292963540458837640796067532543489914339488634793 - - - 1 - 0 - -

- 12630499922891895046013117100282886592162286502968270762082302629751001474994425717473886356760776740909996679625680712692434516132328086691314811018797963 -

- - 9272911686433754068745356771668009301724290378683563181975851091754486121030555283603751744260025115485113642974886345217742417979894572131881209044334267 - - 80 -
- - - 1024 - - 99079153840397804685867478704958595964211219785958155284881016629530195136827933093286116921421314259616351394960959112126590774558615068567723955791014044034246784512429519014013254580736277387087599956862163226669530087515094282327896617665735736838287894898186772994803726158745804341613911571374382274217 - - 1024 - - 6 - 0 - - 35578547039971283982645110066508624345573610232317627247471510693463768653398865835272238114026351004271431932575111890233938763056151590366620841232654704061531541940982892684581803302511323727831984614028154198292407031303845418948998407737432474830158607617228291146032822031461125981880732591780383080312 - - - 2839520020939910414585072396053942201285418477164512070052267230831770336300588444747762843759096401075210098436532138784880804799932247566970642529121364066612216811270441923475539213363391876709967520432970001189613754468394504726917294243804597283185825885394444717803465042728107614758510510324174671273 - - - 4257103436738693167679988473229289136213965822055009836429122086227208976617015158554335685934033709081255434321021922411600352023894639658729306158101602153035636660388068573921523812704376829383643150036396507460136150352573845700348414072481768647411162438985157824104787655967389449019995413270282384725 - - - 31273849552494023387697146195164619556065892108955510829954275657213643062645495427357887929042406068050763274296028240982751299109488666543364710271423257790548527234106226429899957206169892445232737790590754462461209360892073592865787825317580388584134032992457155327142814088810984081589994609099547807103 - - - 35347178693259636224425976955506604359014275201911436639125947893572572942967879891723093129361271536461729305849344256272804438952413715869305278809953911268349508791262359453574584301723678348219958163537617880479600787349102851371503927614310858588626874124144067272631324900475250505683917036436021292017 - - - 52102732689033856356640226142441703447547338607766799410243675288006455786150047981514503689756076319154821254787434210207714021249333494274124947142471750583698934512751038996632656769981162124907250526920201757770741572757079121833484338311748881797371896129073537143638484841938341861907569264174122123347 - - - 1 - 0 - -

- 9748964991505723546543868536062010971127128589119526939115913892146554593940386237933184712599429913743924002118610126365074816440430469386062335494458683 -

- - 10163043351445564172351159513591606430238448020421438472421789942995840932802561871322912366647551980193514226111956183684759285693928375857878407269416299 - - 80 -
- - - 1024 - - 99954730175178004845131539653721707390533824134606712982410587911600868971245047100506766033962983317090892319656867952029116781250661480710843185739353918573345334339835797435830424130435498802133973879689630984537203490181103875802086600280921230328725473474449200859216711406629174468133378669755826399289 - - 1024 - - 6 - 0 - - 58613911232307388786240529740987000882039067599860437772060847031357515586839511997150614558368535541427251986791314469299365847701391023351538654534248928653505326544257910522636722321510290544008094306357049503882695532643010370246985543037398842826556465466041122607877993972401850373499349505467940128480 - - - 23759200450495340002812814650036411105104184704810382581836582136381499246372180158982092762319176354865585492876056145343997330165572678887761521089111659694764726321928033912931120570410344269003877152629946202983994387902650140832036058989562136543699053859110798004475607769263425530430095499690012867361 - - - 27782425796445607511552503734068694227876277361913927009841359267890284063272744867098761749380021187439414183495224952502774379338236771979358642185898028829503362239763322899537168530813926957477896747390629838050847130063594861856714553628317263751461531880058526762279151869539133638780577291661705004927 - - - 8784981056185286950712849504706542909851983675476684831378521579437874438781947443207971368861700013318831210277930183684008548888491900029215961830883091576228665510223450239592867424261582734977160146810093587216625525411002439629017874997945384679431426050351258078369390184459312181275581036833509779471 - - - 67438312305077819888962412973544875116933726924127002079831365096482645787717754904826762149733256426407804919023613760756645934824283717354322616471896981039882491744840529505847451034873496543558273551287489104242041014171297514449081571270617393454781665775168456916896840386566994664178411923865986659586 - - - 3464604326727829206934168876456004920457656854740648111041341919379642725442948759261114328466645767790382904740245997674525442848992126187113268087612395494538879214628114838356903347298883717235497237827971476139254978851080082281176240683715669897361209280214505681097167531557140873892635301719665778459 - - - 1 - 0 - -

- 12939786488932276262323245278120924916535303702878428896930720195905603784347901951774974364977511870729292166884453413790631637944449943023839811207539187 -

- - 7724604286220007653749798947053474710559334667556480008209607824527906328856312857409846221987440911537516799761373127400163478907588364051834985163072547 - - 80 -
- - - 1024 - - 148196264683866983246056824641461916553727188878286846814207149952700786295989140546602219816499052248745376771762136245911508160658056925812311366238900528068507706459965567045224239023241599326102923853309769022811634949971343037071212919062146382997355248278317770400104265846506381194883209546789678257953 - - 1024 - - 6 - 0 - - 18228509827232960358109377366125905423396651073282009255000634400639380520576157033263066403255727758538148196007410118445711222636928632798833981031757422495552319975431175939254099574893434799433886121282995060105902206634281977941044087776314177795281177970367372303622719093916858010157621949175537375437 - - - 90741052971361642071954400353930918473049330103806494303478914341240604429740160266927238572355901048839288876493430663768138981859097012674365597674038606403261541063513022898915424660284139220319595247352870395164358600167094743461905071137254013807294601497510689150945162000419459659619999603827775332678 - - - 52734335451280775701279135902793102618804746933648573572440269533476207593955736723943187629344792274001509257176599036967710480587413456988273865241932371090713054609684326983191462176991220730297153396836508515256005211749658852141138853888828449929462905950872738295586503848336537871567551750808215082154 - - - 121858449637190773866676289376800522277568993915277707214462950174058584758252432920947572621722050668109626466687582272873980762806089036347506636343533340986613090442509515739606515227484919838200607799752117413416448281331606056270182334689643276303764467680282413521568568120011182673925501023231082406153 - - - 37196825733132964338623996101449346202869180967029642202058352423341650421724872464278502908541095717874629388572535601572954340968281300632852357761510380827733721910298105144168674114000458492760192448497375493358162287626785807975379359987001469882105036987321265846856757528606901421058839136798700287397 - - - 75089855211101765747300894547085312949871336795292159964546821502857006262710931284436535591390767143045054287236700353745766551337135697641239389214003872913304473085672132743841053938472186773425817048000547738177259207808092058727324924409903592113635766451695610110034720923274183936484960662875433336362 - - - 1 - 0 - -

- 12016202947303825023531335799913322382551195536742761139748076703098880974673847071754302534819834807871631469091115549435730929542440094686445020447774447 -

- - 12333036095825845430773725375739290139313531934846121709971815833613318772350157498961858315340781451390953760021411275599252153249166477673811092356969199 - - 80 -
- - - 1024 - - 105921949191653130859423411775455174812642918848669759359209486362932598819678144087209481182550147678529129567658791265359717569767628215894734409001006779022322289698515237895707269420956251973406350695311822182673083730764296195817297540780868975477123852203726080688004629860517990328589192081987644050229 - - 1024 - - 6 - 0 - - 86809400749152861743901567276848272927167445497006079265900998087562865265602440835156566344510296704141655423477235937471795088316625845837856447310120665238699640116252577611027501208177910037535632605368178096550493728239151536133777140960209848761693689914935806579004427834951787425614424456419297157510 - - - 84986197247511436399667031576140728639886927069411759928791244212693888161425776856726174455028312620459053949666751815466973657597394187896486659471058818599622253530061625009497213318036240988480751591194064567662021711447798444988895990719137206080680744526229981752063726938789038885269097160956167285566 - - - 12431205654625222881707000710728606382090929111990041388059059946907607046548243604353853640940005905715357216784232240313960881905454724897804957781475751038209721410086085767242939434308439807150162545625051293193433624790643565812552903666506190662522259255795554682338285362255530961345229551611440343519 - - - 62883235755082005523686546548606789143770348860378546277745391562811162140335817900845352214174699090463099544541601029119065647315851429798873533063329837639373217180256975002663524244050145680516763942257347656552764882712032814090180931672955198158069467918914707575354901887685922556718370751575138342589 - - - 39849433607740902504402507874016885026871507213461501810264903771866537152481854388265980706007990086277706589042473112769024003147970075181100851394556059066286357588607531753104924164102535180160270351409239344423986742160630582682803306956751475609550461013854012988551751425448894542674892017443824734012 - - - 85402225442112559560680078698274218019993940361574204599118634528616463142138719233262976451961276991618853156780942664995492868531530624507421313975512606915096058618792443156198101790705909662504630168187270536791683734761412420713398341369713188166278602069035350011783353145233527044956434445304512600650 - - - 1 - 0 - -

- 10543874413531138420552183302585089176867519635900090544987728636485354541478216632345467492041256889049596555096460358381763174812313358589354315818141427 -

- - 10045828036013179477466574983046463468665971382225481892440329537900748631696449009169658805056073780192181226505594061785793484031084774712279015886307127 - - 80 -
- - - 1024 - - 108440748919252450268428286731731896396610163026933503975849925663492334776921174398497109505538747057893434317250808469760213233529336913398085925870706542294714657431121759666156575676722682156151413720356321723309169997769639095210994084916522091702333943625021802404556103531364881274617202822828310848153 - - 1024 - - 6 - 0 - - 66366383659085004160581858686068110323987677633068554408731820055937312391603116323527462447105256578555787138213126535928787848971976541459974948337601213550884956798828607581314470984305212507805730810283981952589260529852613686591965244366260752647049304254010848262444064395193144695135425020863379006256 - - - 76945724108134514476845806024636683902509514081378625453698025707233689344313131316105525545539579926429167457073332412872790363136331080030707890397365463990420679800561805613345351927011441895347629470989024367971421806479256556337062265729708476344598157347724009574637722602080586962935931878380448404266 - - - 91945329973224060248558889328744255046597767263343203901720894520436658305695307815971264787080717251578623712083670325402817260476998336830698287676420656098045289735223431738396971319193824104754894276305608143683285127818367138056317944418094268645782094697587442950453451099229969927726915095865444522094 - - - 71371194814401374673127041666269343887336750774645785365973831168673801465656031844499219442062352660855087164791888562838903522706610239539435340535864232794707954647487039513635041583341855480149907762844377270478905725702421973086424891767443863000735666109119321036123589669276816773800922411249576027546 - - - 53718436417526636858730643071130396923526708450985497713286303484760405006322845800085165613155450183026982545846694095243620426398424635300019928951028659679765785677107062221527213905354703614993367947430698278405310236478443546679988798318205559042482374923767602250464637773429717300281505631064612985081 - - - 85230469722743515304402648589847925000201154330027354125047810198070022725031542612895149579396712621532910796627591852488733918035116059401887268218978788971949898670298569884150675654662295808772549913103127258327197135266119807509485752123513682985319604190596813804839912737937728219384325250171411540887 - - - 1 - 0 - -

- 9862981227862769368797719041463487267278452213802595900845335192390244678171432992590431200800304335341042208011653698525699059678409008267720275077835187 -

- - 10994723239755238747222553832315806507041992287431672695148498427805959589047328029147288267156720835206221791909854520270379355562497057005241762831090819 - - 80 -
- - - 1024 - - 103432042254953094027999928574250715964500891045142387105955201932618522113984190182166706020884933161447941491385637733523319614167734344468728413306447688694643223282152714640407364090919183137006284201884535802398403524505317171875956878874168571207572265824173861602627771714795571730952163007208142820237 - - 1024 - - 6 - 0 - - 72735857654996330036308578750037768707512446485674661426090344826756269113965804188268267650912305793719752190143646093227347682752079327651194810856984810512909164395531967789876907601998849500709695834360721633503971686727031033634428158149145749257438769804777610989050845392734398678464304671042690689175 - - - 40354197327776309644557445446598247511877805740566355719587647166808789073448238334020156687581688473278073371655120817040636086978579601886371654352774729778337067600125687099708508209515703504788115675665658396923040920295778105284271940275617551147714430295447383909281391532478964687175643491947382829869 - - - 26968813628185832884730391035851987751870560318430849916723371498400782087349207710865186129239304189549444082550532948832976767259584865952574643740037079740215589837871761474656629795571319987839311742585360362081712716843606865678855283492160943131234448889819908044401388366435372206735181092989882690610 - - - 44457756325918210432882749039045279802693637901659165506229652641196771463619711136701874027949976037693870830860638977238468910265640234729073206675396560391192913720942212407458029980943194950742066637775931509413627536969881602485810181257639579907992687706506901124298572869645460421266928082601925747112 - - - 17923816029308169688209802751254596783750808205473920711963121223110109870977619253002898105372250772280013117032657917924973651135856341002576602124287460305553253303790018252719017423511552791332813099369856129658602326535776342375244816034773978221082034151281828464402757244302554451737031177234874936733 - - - 58173516169174283964719668683473056584525739571524859721047404025100657870657926179915235481899922046403049387657375246255178245370444590309046031552510281811181831088860285782828294445034384018959362706962339714212986805788263200055409728428500955125311148857260741294606734880811179920282935017488093954695 - - - 1 - 0 - -

- 8672679680974973236690094113821641963666823374664779083333166639271801771951001348655097212003109871176706115983422580452706137508604577065592031926797663 -

- - 11926191910655851191252641261867726308467148179594475161094159206820033462251798048601413600297517962989506123688221777174124884142170100911794792428913299 - - 80 -
- - - 1024 - - 126228903767442190738148096183580491175038013895363063255063879407638776222007762640020963679700983981505819346117331332097744171511439132259106773717665842976406975673619367222219945376954037887793874062977933096988373359681541459886631958588231575466518127177060945684448323334830138905052399414218163921421 - - 1024 - - 6 - 0 - - 97539931636318677461475619122054540059104052317022399756575154292552051870858044057227021169523273160051067173161809677608371202374236595169900819410518245929982550711392322042314682950608013639486222401760902052975068868934717538248202265198283607804041217016155626510986296204640357633562628725262540901308 - - - 17056048088041119848885497185187738234341957332739548911174241850674169289366712176470014650655283087514808671532359181973245193579686505807246886039638542093762471617521947338468427670697788979094939538614633506767486848270358174624110579657908121127644226601122674835651841028567546912507950233461561314311 - - - 31717709189699030137875842801316834424645064031847570293530325225334129025771209881989868755679274813087722642958802113724122792623999410285511001585168859463078978573404425652982888882289493612951079566418713192311092484146177732644672658032091895076062007702891319957382778438919270892273974397851698486802 - - - 52701408784517534567979255300945480765809161198465471154967839240963141730818870689354317216286196381556788622550165176263143040912951902845119716643679329549799829193894570784536684136260779179477022420722664058284142073288038418969152156881985103589172969912151842893647108788505003435443026642491812317969 - - - 15916170466240831405710269071326971495003989098632832660085003103077847286202099441873708133501162524440579674719437136363718867648113746692100804664108054776712148615544501485090998986423172752761257930805965506564375676115179462856206417265463968081226820646414689722755150455107075664424251782354607115997 - - - 119874392493908971774593399912229045812669019257958357082614870704163802485902701553073252681759628404556483986983935409150939979774709275900622818557001714033801638980212024983490579855036873618987603097875751122714671577192226926342520061281357579934217951516213006849868891095137524137512935354897389930481 - - - 1 - 0 - -

- 11499339520580758253509229542741225135216456664063086084643722193312156847548408792529910681561333510768537871682042164700109432915244830423884287811578399 -

- - 10977056859789732894814562646715921877560763338630006106256821434974143239426025326128125137005756931804906605036182079761254305228156010117994276009412179 - - 80 -
- - - 1024 - - 130984031670979893855543842480345875518508410205548385455401787667182043276909712853992897091674870836021665068146327054461603450458407290201372558787290109357683738428013567907514516775559018701817491758213188304978093675528268199327422042148541505303706207770150984130237176790872039958140095900892697292761 - - 1024 - - 6 - 0 - - 77111031511076776748383055590862571648674736492772474529961718646938316725304876527853934806892564363406371656844786106299018421240298065574103119127179436601308127134820838280671592776233104655784461864696507484750746141074714338613753312756700370784915468572345403051130346709078319417883115672974802169835 - - - 3128131951563621685781519514589290396078543084150675317713253716044387307905521327893562744421717071028534528094967705348771755396568977554185830341410613830519127494248441161017549347924906597526952413022501285246828769224407661000067457541358719277808165554742389274830650941000817519093291137439421649691 - - - 24954141405440090689976175252555167972525713681839903660616337028203242900712021559077665304276350472093427384187451836674689185805100258168917640061516156543626305008035523276260649599372451478761753446079713760095403758829516730955461756588789162979921765890451415813246841487242760610785376086909463933797 - - - 10083134356469565434820655937850585425146227225076587201691007206376287612169498960565670490848694021370067252342213688465673488420651484169267195969254736060823678091580860232493159013856793525376166944993634152015542702135847543328581535175016508032979250811181479986919377039311967364297745111283924007008 - - - 113848733397666003768323762636821213490695764177128020789115723590466213187341258833452173134117916819367401260647045106530664613037790726812093687986435876985971021971510207916178699329669683834822651456959414265166368467473058891635488094103090980035908623302936245578454636917795970043625492656294734023452 - - - 86136816068775947939443892035798452754540048307990163601582410345529875583874238629932272530008216513299726778108060514260087906788536911056614574118478556477474027724459155894339604045879892134387001046080544595464847107133404856959533587474371075416239607580582640652535022808207241217726978029145005615879 - - - 1 - 0 - -

- 11408267927097292494421943021465092136859879230869963933878914044554698647201802346515123627079086986924606947152921819597576136415744791007252593064665323 -

- - 11481500303815824823701066311521986224668615318467744164273472355691092578076228467001390049803731395942719303679007978248732870976540462998083308693938507 - - 80 -
-
- - 11 - 0 - - - 1 - - - - 8 - - - - 16 - - - - 2 - - - - 4 - - - - 32 - - - - 64 - - - - 128 - - - - 256 - - - - 512 - - - - 1024 - - - - 11 - 0 - - 1 - - - - 2 - - - - 4 - - - - 8 - - - - 16 - - - - 32 - - - - 64 - - - - 128 - - - - 256 - - - - 512 - - - - 1024 - - - - - 11 - 0 - 1 - 2 - 4 - 8 - 16 - 32 - 64 - 128 - 256 - 512 - 1024 - + + + 1 + + + + 1024 + + 102680714876620505251519589456529850089969700556564489253162684638539597335736793998411151385396668678457395604056076455447346438315008567850445832409559094642617108516105196798178870587832997740211486024550117558968151215813802257578385470372409470175519459389641067956632237921585676408120047405305262039181 + + 160 + + 5 + 0 + + 22923320959192453636423682385738922848216151492993760467429386172337582699603626592667966029063069617300543105850468927060751138940226489398256413607978816318065423599404211058602051331171774528282150565237472007558045410089374975467684411005456109694572501365211023547108753818220756570663968723659519304097 + + + 53945843214081887230506825685162514221944851452590973433147320105768347799035010333040104182762421540976644457898523154200390719416111152133906850059276116624692455403920555815325946146027238316284576081046322930997100925534589898400045746221732607763907326046366956881978962788748138738898197865947329746712 + + + 84070450444178810764801942593139363675201942216375234211388549548441399502573647392486982654665114331690463175765687779989817013063882187163233753732167024252613425512245014453169195391341163601305650730846456990348521068770085139213305228501503975315987245346014618040731218552889355850011776660968387243547 + + + 44698200531549202972232618323671999010830294896874839743157702137836602383560583870323823976773804259743506237545914357368122833664632525931647018821826400373691255566854594204199447306752422310463080619172699838408810456076477752430884838822369737010719356000558487625372180909172327760255616921931423991248 + + + 51872694200042776418703861731161005597647063174327775542825481250710848362720927717796283168056945768526737370976647132055902410582742570384884317599347064382929720903764261035793509472519152983496873672379499058845114238849894388800999929829175350045958631291831128454260459997110600204624172747502759593173 + + + 1 + 1 + + + 1381926471275670696491547928550620506717346803979 + + 80 + + 74302589183225406744708406598986697445626235129332961159539629660099003864681279676025057169598059221346100246653275027988998552977043535171844663879396255745429680604118860556814772359887881646573360468171271074105943974872534642719266485854337939537007792420 + + + + + 11 + 1 + + + + 1024 + + 128057967809655946190316507735155452831314572900315216081434860144597217324346737671800302572587640910078110732912465466684478941477363845874613925338791275068167816621932721309235605381772586248486970010063355049965746801462578755831359666996420724229475198439645105729191854361248312605304734475323680662913 + + 1024 + + 6 + 0 + + 60811636929475187479807521649087606074793642064167945690350627603203118950323257675713133373687111123714663109087066267073458476631246485001894677569393649603260477149691339449729864039552273625864812610179069562367245786370215607199308088083101677805342992837524421920973047652387594443568045299878715104011 + + + 71560986262474260038579847733152867125395323692136727882523150181177145526050032346646815633503819181049097447083396963116870388315714388861158191811280162852633670260478236187402519672391362381543748430716574725648848677812893437556332455280083345503039177361800148373565541695573258846852919928924249154877 + + + 5358493014159018151110306019414188401443366482533390828878588153924237270657211162207396455592545292115596564966717448066974022571552087820343845293928484045368156700279200787884399405557838594314421227423879077160333472477688129275324340290022874614042967407069455935447388415804019834527557283355835583238 + + + 9440403911953510704955609199118462522546969159294361115679964001969095067128208202978671380235142495494192920664243060842431049236464627103331285996753378993464968648353139689202039972946351834805543874912252883016750152554402795151625609573033493183190907610839726606922080056808873159110535921110839225918 + + + 34601241858178235153992489154363566911322825930412755051942961530163789553279237024169967243263931210587905323687670939702730687998131084839805896091785126613296047470576600055262500331821637746680489652121076447750079042944735474064557177506619768477733608759334395601504750316910835074596407622363931297695 + + + 103450953660312905541961327136746359534991486059040490771968614429013794227835017626759804639288113432551732347712210332460709755012800755979360542019454727242090797411218789006851073710562599252458946620552051918314153874747184637728072116094587384838416002546398982033848043597058533784377942968102172250659 + + + 1 + 0 + +

+ 12932030508236240029500379006897241129956579101695632927019316457384709196393771888005191041903025893215144948249883093198348475278546477203390317270105679 +

+ + 9902386769664478589840240464665057831133423813801796716114600855905375529754843999999225688343006241702587573209999717516477696656645009688715730598624047 + + 80 +
+
+ + + + 1024 + + 91338861134529173742636614734321283317712406433818139285229062454925111527732609262828687047423080667973258817589805005737017416371360314088086808443898371429020158735259589920882443779130428607594850787634565846387075036083051955856286100630464641033224957452092909212599715224401427904042049536509604893693 + + 1024 + + 6 + 0 + + 88481512963655310506095083872998303955363103665395614689748950761935149130592150567352051526842435768907883513122638406071951993833483039104880894260670448994086429616644971856997369229550170174238792300740232364024915015016653492885640971890845653859579668498528250516917066920672069528744730214455335881003 + + + 71420609539497237732868765033013438071208066944625734387424793864620282249588182875061993503837717471514509627177747945260865425509223920765478106067601828682271744524355493795121669193837190303641492443480194307599715826281960573836394123684702869297115710345424755375986644023739445330856168082010838417938 + + + 36213374277915021187960501154206429350509009943784937342853640962344665273661370341432812162660134104129081769292257555453657933322026058920570002011215114885632603237420344104120014493999772566832623489577942137696416594059207873047026684531831127098662368796483679106715230357303209903005563129291440998125 + + + 88784875219103004490867409187796580439336028275646934064032325734642172796350750877782655631487263690600595545185986973949637793376040039529334242727841787186152368722684829777472113434707623526142748869410906573019822447060135044716736888756586491608663760971724703067383426197232527066117239191970436021914 + + + 57669682815414213701829150785790139820922208365396385382451270040015047105011059602270677532141334599848749895445377163377797098101769663138915670832338561398070313576223809679656089041902001668549387570675942187547921753080749715443394968434937329744189522351133848627606864859717699163427995004551470140014 + + + 19430387956073665040008742545168228237366626380409449215616316415682054432029605888008345798193251163116713132110293851289775570086405711097037612492724618955613522669964620645767675728759532995017555557036656920568589220029848250912688353596366989096421783410644212433994547565209779383923475304673100010441 + + + 1 + 0 + +

+ 7590313132316003273918078590302512319095378293744922263631882454117055270026174894373664622063534944373597887745176839805114252442895212090845009070876059 +

+ + 12033609093892453905143611421316260116392442619100420560800021219786194165358425170485864622027203788410560571310992155037737755554341786034296519732793927 + + 80 +
+
+ + + + 1024 + + 171795367802537336198216850040760302817719433285673072064016704297509263294972920968862879995019333546807716681922194952612358665832924006994420672781322683935998563828829629166676961578310364216820723333284118541610355614763234524893877254301205676826968663616237843247997193664755408992255295724018758287453 + + 1024 + + 6 + 0 + + 138781939743420141798085654234587085378791442750844156618218315519623156030775014083940843628427157991650536995512183146050090364430217798889903276779395691314769341501283521555441395248293145295446229257598584303226472282606025256289516823083353133125249557574662930559464988881796972570415006594877835195261 + + + 168420371175596160385314346470541456127930556988792934601264980767954150761074401191883764002057676025574635595559453082438403114835695017344400960903147888338845250647685131378444914574667053754042483424927960459645361430078126904416924147233083786086593890435155965855696708192722757613306648217414021209339 + + + 164599507864917269230220181044130466242640054454386799153052272100119238662434506377210871322725801768535465849520862187042461522458751851837119010844326508994699806461980159073458635731317238484887665362257435016594387971946664996341942792674855452076757886270233668811767159399329679444242304826944461878356 + + + 112022954554594868430694861746706902810007259966892035372848716164773714721760248918761857377457366770462246217862095078291990529093104794681337350992919876990886726535142991553290065736768419334005963502455897767959870639353796998608846837617297713305741565185682566104560690180553705181428610482999491959762 + + + 20795710379390313360149837901235593902809611922782438280826554162582584185176550436631972790505407403299851110962435492486911884529635673218790787915570636384717044595376003628898518022547995524968409598599237503027024128328270655662334146591298270627006489949537312823974893037600566816074625503584300399503 + + + 4461068203835146920397273122878996496925951644023334909782795888195924230363311467297500231054245083629066539839024032350563196843805187870921285704555947110972472049763739700924273806542377974583744547273338787688284998293736197541473212310650426901783545952048410414287416361433915264087521382790658628498 + + + 1 + 0 + +

+ 12984815465718139976464939024875001723229509524339667690378713583638428557083258852077827822717623083472588218407867051847898495798522333139201280857415519 +

+ + 13230482039279100231549510012632674263858285311407266814423211632024536906105987751850169694421467822291911960770965201757888760198835329800602452213646787 + + 80 +
+
+ + + + 1024 + + 107678493864345648666726963381598843005045134906745773568855127179729298765945796229988935480734186762723475076589458553114861073591179889992284613957887798550444135071834300620151269193028269405467525155137973905598460168964059816679287733081423902287277428322195154969572934367847409309681954541961841211929 + + 1024 + + 6 + 0 + + 34780567649645587652662047318280460216197594322629290659397343806640717111602043777551795972363990570490561518129361133754971748815062877457811980871870613895746761204692874944262181605786891503668206019069701677551111685254064897625906904673396799614054762342291638726110702862138766341205373553864835127477 + + + 76770578985664099191449798911850613016440202975139749844785468106943538467941487623782662375335620379715667015148235397661770125559100524256505138827952950374296533996410404476470347577736554558794350087928716157046782489969073300743386412321573188949782078100848155826141059164451205262811577282438487833155 + + + 19375132007991059652876546182462672768720429677050803522934111565324016495763732172744623907045335493048740541182304274405106110493850369225158004210873483104238595711350247509966292622988932139561490663242014148110393502548086758118819001913181597386000596861820476450726333113377798106479230138706277155435 + + + 60332745111136671951489671083751897003291069716229419557442175701860610038139875996851654495020782497922916125497030526867835842055895873784260108184155213565134969114645958871640895775675472360543614497922018081777590790520072701770098022598964534954182431602697737796983390272144688966305745888541862833949 + + + 33206030625501357397902828493305862279894195856045523813806319914644617357371406587381751252409214237464923457683937662308696252667537129026830911327626477920950026367523422037741403916073653057335758700270326029776865721695045422550695292453931419295319756838382198216938790815705554550670037002167896435708 + + + 33699591887245320183352886957374795158953603724548326397696125237452265579267587282433792785552885615789973016310923276732538075279246287329477093697179355796742915804057038950601496710139911151519055346593812515824483642829165138763105492040862107512334441962031341198253373030460133402288720613467576919651 + + + 1 + 0 + +

+ 8086445429826466766976840778602128556427763126861092718555085428344325918560612728005964357058814370039705887555080490065308264985839108620298163559066147 +

+ + 13315924134871259995943889972263783197676570583006459035153156240747027875844241230942104155569988885879710233246386342305956396267067502039128111156418707 + + 80 +
+
+ + + + 1024 + + 123460587970465722399480599701446111042791049424678164510782348298178989524706869827218072757318065802572872977206189692439610889543998303448261820274781115343738147716328254096174904353808537339736300386924394267507766388682907861666597761952802807474810395363126049870826035575374238638068965983199376357813 + + 1024 + + 6 + 0 + + 117318302352368229229163809607702479318456428030157262995598611780776136494163450278418011369672196225024705223924157260734348678181103931116903595932563324645629923260513068155684589997607606713365161836567403767936006638718885167253192939940642824452024816730744123545240701916149057716603434108694989710429 + + + 79166656374368484214654356495255053395213742590584206280310930719755653489957925930346542517512620192097650425359579247070837443830862748231859562053718573394014868991678211219437490529223024342458612272327848652593110612340785752785585712120010687405752536405399684337596148008796260805479427829450136814686 + + + 40871868938993875410426205996751811587721008167871813439166564189762055623031521920195950886062485740929198925966775524584648439881883879228755988003547754790287586711275993853306093079373185290320968524077798129432974504079981251722944994855192019937284992580655570885903256271403090577186422692725459831875 + + + 89892620900640290140283566392805476442834511036692916092709883776370123872836264775868321860590685970283545083118729182759253902758383167687729739268452078465233562037688700620432639773342196188561501129246210605848453748122752153274263445164184465697547705606339433632142128437959746969173608800415728397931 + + + 121709777035471737364513670422914240357059445755508125094002474776054087244214559702633254647901247822895427221568520569724729995389163298559564480170015494003587855303221851200035414262844476231232261394773812801023837394666069091883472673028207084029985001140015089782123008327089253959339518752984564005371 + + + 118368291349285147157585550327202423335817645258822478079337019930721123815468331635525068128544253736950377216631099734999157547924851998471340790034858629390897530180532960195293567558086925678406847565038276833217752653830262850771875793504960255927890257698780412927440166594709334246027496966288743344300 + + + 1 + 0 + +

+ 9555708939079495611355915185979699054940167384681225047725748670929850843599516084564504017739835259712298489561139897471949689101632199222485821907536339 +

+ + 12920086699748173672215351475621638389273860195435770401619903340348767410733675655724985891607786607181490238978036873680082748103544680734516847406362967 + + 80 +
+
+ + + + 1024 + + 115193322549187017758632085674974727024742715278872315780926012027804032179761766503288065034565716892785818153660349164554433828067796365626741896969380114418490544104123599167386238983295022270967054328089602503480562145153230657099035975059011144762714926206594556617956114445259820923651026107726741377073 + + 1024 + + 6 + 0 + + 24958892788118393840566891402925212894261112686881756396217607457946596306978104211815943994414797105011718075194617345672726305027536665064724927900756862036945765691966423524893153682261745384165128816990435797199717205467355245097126693946214610135412865735012562961328364927779026079460708512689938357459 + + + 24288255554756812624762197103340158750190223778765519768405807403357684268583138358422886605098116268755079717463816662298139317595939687753107981126116196500860143071528623840509966635777831057754249172610936632021767758934196939105040316041127363794901161035243044698624148907282589708017305528332080549401 + + + 98573529002331715221466911082616318301300017750678680593832916072820765087229700809543111818625003499979817183312145679122909425246500434114287363675204505267732119319754784623466080567913652584576116756111506044251229410873182774035682045895464671545948436513530383740487677985431898275771829011975467387636 + + + 15353985435509734717647205939924424374297140311254436480413662376519872061599819892959995176175891437756042491481998969903341756892089428475760114248462830393435227191729623914880110584220456903870872511626091038462298582250901312945423814102221099309496784542055234964849111850334835617876760601457927418206 + + + 17455735070449738054682884370746228687686045089020396998083887583650988955042976829464912841928464950070337180970573621151968757420751546020224392735386909098113189353739054276774294071884697288831510878855213838041505870499205405393921909645992766577060606810395305981595413168173038810933707942671713337798 + + + 99078282433460334122518009685435268135390495565166370788375980674406524442600154170383521782130678737146346515697587435130336220692226983416874121180076768315197607852814628471856417469605509753709709939138595158453850817740160745949448738764045233343710173080910805476352529406131342795794391893459845853249 + + + 1 + 0 + +

+ 12673289315868749623674662876792526399689105251553138253832866963657700201414882030685426404271074917375018034885700283434611314390001132581350346803957507 +

+ + 9089457336458712030766629429550151802473559635837189343206196901440327945060996267506637537707282012347200095016039598579224618836771879940545740195754939 + + 80 +
+
+ + + + 1024 + + 153256019031673973848391853908671616024035351852333113222956212092935054851555144537037154882131071118335109565772920677334385665987953763710322752551766091084637014937633351768184250877579165516584609222393690507834529036303945036774013832353124798268158248184389671641362425541416312746250270416649359548041 + + 1024 + + 6 + 0 + + 15220542722079887934163021578416557040815588753014948049895358680874401987354756483638187693890778200226187944576153001580318905767308325025251868319513838639170229388887094978609944368236261084829465326382756814026047924860100572370509240911903760108844191920274365232194821110327754051188671927504786123847 + + + 143004036495287445500008244565089775614807488065311228319771443644042556939728810959906482515000410036341359319395672341423672298834030730662358936098971678898328809479500096931876973317120818472883465991015596717523641856810286626439287667681040066261020458108584755098587931772918575340120380122391279580630 + + + 25677830626343122473800267766987258667661454338633409925057452295050792502934635228012969731952432090824067546127184820674269109763072029928071755085679552707171555102523382002859000834013865264250888579699016146722510456747010192496630995123022435395781861793364259724814673958020662700602026307416209911222 + + + 62246636121089263731371807945897520167051837454698735241698439734694730001470335211863614247823007078485077900778766898167190790567301408855375740484748340320700390073275392868823940948653806683445411202776990790067823595294042946536030310357110325099679964532575421698733314704640641895828452919877756100011 + + + 109179195904717079139512297958344482754488860947001124419866306632211947700557001412569449694611680557227002345132253379015047209028361122554436255825724641792181226048045416132300441370043533054296640636019094847912470011225895961907747561407131402046285049780521232862899425601689434905370686341564422790289 + + + 72256199900300051197332501127222934244256559778006179914521739477500706464599171904600643790797361089413358501039731833363101680832368594873645195342133343135647784788351460716476460798313313942000048638227363109185805859595520325671335898545619147866290785844770980165710956429961244551737499380764677597447 + + + 1 + 0 + +

+ 12342925706968186973716394535438921214235596704954293960842039701459560221839812692276085541622342123471691734600034990812679842472477393419982807837038439 +

+ + 12416506642760835382914337605608007021637845840379701356494020719607002466778798575874134408246939316921404868882276829304115457690088629985078174708274319 + + 80 +
+
+ + + + 1024 + + 135358305767271858027595880716111530935123928737890043873187024055476620530906467130993033452699358704424795550755169128359841746123492797756886097936671355386621176058979935393331413499392989299082084359031846630046001377108741347076252627789379769344457517235001038532356319713316214499718115421425871569433 + + 1024 + + 6 + 0 + + 54594747011594798877885888974944176740233826058214590608446121481719016646101845365461669609593284564003581366359995275781810124519910313811380876256508679688339828939491429288889804388749815124253867496416627880709040603044538402764027705232404679640769755327219879688706197760711345784098387646185164981152 + + + 132783808999394318707408962088834983207010415125168788915872658758155889296838532193150695880199623917302322850691457856799843846471181568246727469377964494204689790089312937443605415487457400789095132034217110410411016988079403293808537223974569707930874192773033393470383855778863425429691879481694667628909 + + + 9473430635930700050486617160141204494342095550189134899476751191276019107931129114087093973056080555668662930307913633328246702572209665502366737090850431132340577394193612418080423291630390780237790223606432359088325373896719506291987815760514899446327539193574576164858114835145863147018536204496364575294 + + + 90024838355001075777783195974135066596911088933953254044502969121509346778938214241043930641227033089129624800092043075809246544470625613932569785625492513957934084324845138958744207292453298491639912468882105563813341034734148686353752495183156303339463108993280522860556963638419864094636988429994370751743 + + + 45914980508142788475969536593414423447529386876252836641757988714678457126161180788769040893130014877283087923780361131128613703067760746100124401445607902733176021029401905908890233576832489405771907746137014120822037941005000384307118527309121044551993381248785336586579186345829608419256901639247803554604 + + + 32911404065014905616571735182748738235851543040766582724263411775153690607184929086994340376410140178669625764641435927432683863591301353627927154715686151567872995056710033783341401210111884942070839872351093132272880604910175334910646752963148483903851675232134333338877843861382949858872798355076941765109 + + + 1 + 0 + +

+ 13318107756312790859351398116542175724849222734068960781305693360971589188723148557676433655469259538839570794714793364814074380377642061943802625475030007 +

+ + 10163478794734330182377840913723115665713256953124119469242480062221283140639606280259659552725660927524440315179857892001570482716740571281058839906999919 + + 80 +
+
+ + + + 1024 + + 154218268867696507002031865996832738977246724680896068886617497685938467688459935868916544652628785991317792030286811386804084216509428288684761196875989322260388889257097276677216400072227578520525641529006704269719639306215286673007408730828431211470630255070235631883821820735534893283207489831811866541573 + + 1024 + + 6 + 0 + + 27428799928169371477008314260818876148937722875877046040065001415256050285544612261240610068898749426541489168818274025311879557094462504325465143718226701031270459513481171715674711056192203762896591318737473272520615104809732143483277690473125331986133481516425478801944037361281857855867037438256343773679 + + + 105450822515849266246824784593332752863996144824625198279966526580096181889146860866466836912483527896334247490301097916546476481609859267630501968068493335890437763132841945935390933265030348476193713724966585347250648751479602155322327667705579310128424156557476020295924929348119910434857695122123769715348 + + + 17917586169419969792153843627847724624582303970451816452874219660498616008632452910042480347537075057133325092544315346979734775101435525533629606020738633039620963234297245636824119587829479049303232294479234284130684993231299911772911374146097317218619653947965414360245657311825149559284315208240541584049 + + + 83614794643827277304010494713733702635853026857962232621115526420680432673836574945397242148810823271595098760695291447287587902753143969200514260996554707598388279117974226336910323931721647138761776637137666044994683003226962992826724806567215542394880283109239037221417111570642218445097975627548527092539 + + + 98025334882817542595051261918088236466491396073054003041122381828466061599594157519317917789905097080123705591326984935802933433391754654298972150414662017901502818342450898330664054579806253102093229112778500389727696035428993861323041972409204375141288230032727654233984733937127115582284964721572192907628 + + + 103461867044654386108007921528414895482662948754475387341985070060736686576950492180848716520576397704988373242928703953709705994705234961029080392502757613196202086877221834313994327801773914413507546181585432001324248533541087174089562102726527826866350806480335498036140946354815641124317115290718066663234 + + + 1 + 0 + +

+ 12536655577251435153297128528495279017070952231480978492276109251795186322333973692359731778853961591868183555794714823581445343414531738768400801564320547 +

+ + 12301388350138248799753824840982869068812246029803271748337924627397472168580398090458209842652194733464336605766181794711010942109258987663347521456971959 + + 80 +
+
+ + + + 1024 + + 120098847776259535343644334068493409247155794818213113642226621008837548248809756144435391881962615325304472487122528549774300242072619974184058684501061116769021957277559333567971936578385761656133295119311274656165996325688816719676095627842254071860445539705183362636859341285726107647847880667038640384469 + + 1024 + + 6 + 0 + + 78341596191867165364462798149613513767187976045933270925524314074332359105916239984156112944388741605555584315673330918240662669972383036695380216369645786077675668119525313091263106903931060310783249892173696572488213764160500898695655888234795022024571259931035380458667979043363731060752523060256425326493 + + + 92197697267850835637041615816893083978440979223485010849369520091954329556817022954840969220750091574955501530801737742911131398158522167774789346516688492204741057116830688290864687904235809951324327245011263476463848478977798273152839939981363192465690825435376744018481972214855855772912890637337396617871 + + + 4748293030592378955093724566571489011651125070696427417853949295886768378111152102495476227775576523833542397763054262265966439448479602453489588304595952626064095178127493676309959239982750742094802606536171334162655130645407695836907472484934442915849957480725551564249920896993846998541219569493436633204 + + + 104584900904542556799078527703080866806316560026256596079705108220072609345471701770134318641946110143937813605502326970885364040335672893811516334052832715982398959853556119074396097391674101956889279124105778371957287930683941038772719876857983940733827806167120908159325650830304989434548687189098427086091 + + + 91477000374004348014105246188180409651649243135776551322813142142044628230484208001614477763449794744746082101984365227478095962810916246503069968738835364911647338508489896420278550004430041982623071421860079472688566117689119362544066175205618057687399701666608286724650867268340276001512993623664623275609 + + + 27335022029071511973872915368479831202151720242800820669365572158467591925687227633305136848793235934543162969534704442560517668695149887836214069200974132339079102773406068766037767764420212459478276529948373667413279044542607587605142289772231063326758841771162863193523221664294299814482921047353670436699 + + + 1 + 0 + +

+ 12065972956960263054303683531293153220877545209080865782763360344896177242905958506299126614232867538807178063979363544150515696532612909118238113675335407 +

+ + 9953515411036989749571851292635891899300129938693414036200774667401727577909694530750019470986492657545284851625143349646524000492135746632402749851724667 + + 80 +
+
+ + + + 1024 + + 167849747908102684615783031952151303487318618058226134276355868669627336908402995742916429082816062902544246840315676375600682020395918653886440543549039685487527686497944229453172069154889512786032054308546997135806844060341575216655718028005098196791080486235476250761566643135320439910817103719665970114189 + + 1024 + + 6 + 0 + + 124697971864257013069199803276420735672381775609467161633368671004811398338592994292357677388507254846498502768389738866111523924342131234320910182832156897093603904400854292861082845611922732284956492433793209240106822872232125951145778177387397679039918621121927819973078906987741480262525622005602565399227 + + + 108887781890361525299548949264309573612532412215054221866945026350960909252554790687820537292488822159239096136095460817189450475839784419203908369203805504902414189148576907397548005367318289848718165066768409808513010231990171238509327686404013042691377114557387525251911427307934702480124889546002434153883 + + + 99965937256071531833352267584518740705187568678398481975025487900445929854870225696845831801035897840798993192645749908958835960887390699965754669201895122689762609842067032782947025374191336414827383420980245403487860703320619493841364508653990560873053561052051848165272882782658715485304580849894447481984 + + + 135464487014068006350241183417277199933512080629319393539084556152088647569462879342427336794694607292779308330281931121306851709112290516904611886868248721653328973827011082831762202172003407136709090048796766379233700381954200275601566017619852103033202510881086909114257203408422383001855075728038739087666 + + + 116087460929649477650719239236850579624411409915463138669472799334909075618371332653913172377800254417621211492605964716808216033497729198457377469580439281611985552152638264761588841398460105860435413320874653840732276755863584448068058447432518834882323032920701627821579231087160538498920135097072056339130 + + + 87022481899114200452477329439521478334907267121400160768484310083510672665816499561166856734334611173826744984646636728146751086237799447687536072677043559995690196109619136304467129246411278102278767648846219215263506982413472377610126752110280476180152080765605425555155921191279654185124388043571147181327 + + + 1 + 0 + +

+ 12636642715417859827101007353201088998153392966769625361518956454328272594691632711789366661263629504337888950179922382595129311605158283150634452408979463 +

+ + 13282780220042989825847520435951613240963422612857516952397101500145285194109725467697923880234771831873607951414903374146816937585493435872195952405446603 + + 80 +
+
+
+ + 11 + 0 + + + + + 1 + + + + + + 8 + + + + + + 16 + + + + + + 512 + + + + + + 1024 + + + + + + 2 + + + + + + 4 + + + + + + 32 + + + + + + 64 + + + + + + 128 + + + + + + 256 + + + + 11 + 0 + + 1 + + + + + + 2 + + + + + + 4 + + + + + + 8 + + + + + + 16 + + + + + + 32 + + + + + + 64 + + + + + + 128 + + + + + + 256 + + + + + + 512 + + + + + + 1024 + + + + + + + 11 + 0 + 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512 + 1024 + +
- - 0 - - - 1024 - - 135218297597036027447710869998207208754674606065213053565477328119318307615909175526780620233213961426236879812016724358445271350587363396402647314849305621510012071242662065255846791249159498224132174763132326817952843159753470530205099792627946188037319629342446887089368727200769772054196948434863869529351 - - 160 - - 5 - 0 - - 18208244590241069583945724715874667682021402381869122752191191011908431102922032101750150575398954442568433700325906936509940645446026799664167551673847031697308843403021189608647351053797462122799257330721911677799321262955518693413213492091091575031816278740442189255351713608125699206715386379787631136553 - - - 131540008933434439797345948918394261880173787648911427732001625350824200688345754946399083539327263132740551020405739246247253074652019164142804882841356667895761572327083692446423627850400085866440853738034890285736115428435401625648425367295082976489978122036860020082169538328537073357748608207155548379323 - - - 91272725802016999926151875073739471182280652070511760378850930760962342713681923927240228531890954606645620919696449005573523123959193016212029127692446066052985178174169442856720775137926238522268128669447003671386368122267146212347585948046238834952090600178685872531305631839437669077746419434508311013383 - - - 3469882655055659224110796061184855363317387895617202437236151222595676437356010103862254518369649822515215063723506132692782175600271281713617198794137567836935269721890075460941750695290740788356081320228309732607034651115489632489205897080536002378820247683062542665099079636940180095369957072814768593231 - - - 30597361783781676797521480522484587284592145075325385388829200913267968937767278691821499603927812902193661100233957450599038048910138756474842188339778893991336983286399329800775281795383858969341862563509964623791941848182839037452532512334863582834255155110971223966672416785184918358620159650430082221670 - - - 1 - 1 - - - 1244736658805837004330109075480297814211691129853 - - 80 - - 108632052121579197510727782738809674259658270667513999458233547257208694922342747151016335495460550311128145055639237925983221319028074946360737371864153589540779403314101093667591328047044940954750182782695379846347426671180342818611100418161230058992137373950 - - - - 11 - 0 - - - 1024 - - 95288621726635968872770037150784213196985326131676843097938547136462929264841295546771500388417671294966257595433760953200547360249349740933546921081522125275115437397098973842360250826812492033263835470045512007784622189487961151941432994089813647862969606517420125770262374746820810455414109837014665020593 - - 1024 - - 6 - 0 - - 91765448215067823325795421667963131269512371058001714218791999926519624355910110183970996302294343489487711637666736326993210098027018038695140474955963214538087467579370979300852114793975820201555823972904294803171664470191975084609410844843699562290002166572267125918023256183462931816866438417011288387597 - - - 40294104858917502207884187657330535256083121883845488158774475159839995768781522379296790456727414484487297945298577860348991280709907143209769263860571497761805544744736759396126801492587046865066754602032016892804265697920244305298307566030270409229660322389503909826850364964925423148539479481422269333081 - - - 37181927301328601230229509824050779944931890417371371899093425328383585668806438133965151915167895804116880861939436384092456427888455471167585465876401001715893034711967342076190251284011995257843683345831106685333128346207762133410990676468736935851749651853413574904157556618055537455150277384533267079125 - - - 67347955068046617987078271939584408214616385355082946652652558963004113886368419385065451148614904475564270298464228947932932400883150877198113111247417898333396047869562351233676189346740404229714576046346513957179597233959209788707913957203885684064580064021423353037303259164004893420671864177938248968460 - - - 57669000393863291465997741294941801999274879223745070978194979170456208486599787020905477696350469460233194798640650624252822592978323224264539104432394194340083276480589910796208101428768941276014721718948586671096753212427551901667894807759957845419273976923255392385335476551662714791721228240704492903472 - - - 26693245241650097930528211048506005550361754351170897843150689991780056709581651682450255357597353232814904745727236148991266683037674349270826986976517570248012352181812879805573443388140013853869016411689779861764052607477431441788218487198174043217144077012585519677983607140788959524397744180396725947903 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 -
- - - 1024 - - 93754528746270947617601056633800291364861682298136548284561953146489022955904322738006597336491255826850217147425593207106178206216828010702018655449477593047795515376414948882934704904553519186055641276786533221369873508841086692167716664918409533164054262959579372586508029429553217016081926497726561694521 - - 1024 - - 6 - 0 - - 18718193641957314100730569270853083678067699981231377053218236440200570748514195983062189820845228989708114721036335865296839656769486571188331480498517073112230023384223396819136721032148578078215922950710122782193152236503585708948416278154158382262317851500701694633329332013554441192971028421049617669489 - - - 82896076754196599390958700658750134011593697922866943134696485394164355313829104791709121309680409072619102123137695639536409295590399553682662365861769296142916411017933128214043071624336717400223646514016780377509575552315798740608282027520372471946643222670649888877298101008604716866742635601384004923854 - - - 21409157001559082435198762389634006574011661991672395549556344452730268173323934115852207531740777161515961701461098746369193405027011628705790585563246956558634006855496001853186543137136893612905388690157500633486730387558679778087776089487182622558762079085605279790603515779276275365424877533098872706670 - - - 70565991640659014530782020171678876734088049089005570216201610770536518351424325792391149871467733547040543767770865459680906464111242548129734433235362473871904159393238510211564669982290551880614995619280240162572467822996375606151081508022082119563011842579690659846853164036860838326243732394765514573431 - - - 77371797128912592221963604938094942633911707145381583508738772419154024425791944438183290768376322858296041782716140964031431791761038113224908751332497360736934697933992269356158706338071119510267730514533442260161070478749011694884944792352277737582112505303044197289488663410941538147133378198748067540370 - - - 82906267256926337774982154418825451735160292585995227482630966060005770865073506792587615848461940397794441648783258220198681551004852811134622576927680502421722981730340736873927483483912074641562013505776184518064639060490292519532693639651522247920944720222077401382740855126956599277073236976642634255886 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 -
- - - 1024 - - 117121510340484883218702815716016593017369400197866007284904378631159197139001634351397099006348261090254639042478158024516471273585541723720875693552232460895578362633596275449655253304174140947289638902997286514465275801294597279338210032808446791251347509758362087729471534556332712094330499939197910698121 - - 1024 - - 6 - 0 - - 15107464790949779810848925539036116589164680473165481843812014434604020175520176471688364414295094594789131782714144993286259674728780246748998301348736396420755743906492330603688120075762111416310712907772599039447961132953865243297778270824554218777752426713792107606639541765351560469580417085799109151109 - - - 113132619367906663802193126722604452247067407379700239211440005578163970000183414500162238958023667292239182925037826362117516957239919821570280746619833192108348188339728009997904509491615767024576962472478540005115623781145645859430146502168842179897232042057741008928306919479034320821732539898654106307802 - - - 78831244758190029101616472362891555519371645829273483715261840379070989387145987292415360310610897488118375589143503280479343341807586436831967002903765461858758240031822865686048256893617339372987036343650345119947926372267957827867520649710294149310400270822176566699466347972287709536682523581276108603165 - - - 89583752214253883440042346912037084568006500039317399385601176574344374326678906556169715887314185264099152754269356405558198400381910728064450965723135896789762010431669178119883031744022651457596440185119193793176699852604878873526015261656614848828142855743809311777609303941862248597137943126610861447582 - - - 684918354387786416205491044839255104512468520452805205068164464332390890861013726899159853659380168702172547004069779846306014103550976054178864271837177474931121067671438226162027556594210608928930392798386737184879547657514532124037440133147012810854365196162946992675626655050241753400618846478941872959 - - - 2827090550656972121690688796630460105969591925581289110535338322165933007662678927433743438230413437638688120784053460847485119328516825633705134738699602887927163627101863584369718271691217967413302030401970248252827616171028363054960352533790801024629520084292963540458837640796067532543489914339488634793 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 -
- - - 1024 - - 99079153840397804685867478704958595964211219785958155284881016629530195136827933093286116921421314259616351394960959112126590774558615068567723955791014044034246784512429519014013254580736277387087599956862163226669530087515094282327896617665735736838287894898186772994803726158745804341613911571374382274217 - - 1024 - - 6 - 0 - - 35578547039971283982645110066508624345573610232317627247471510693463768653398865835272238114026351004271431932575111890233938763056151590366620841232654704061531541940982892684581803302511323727831984614028154198292407031303845418948998407737432474830158607617228291146032822031461125981880732591780383080312 - - - 2839520020939910414585072396053942201285418477164512070052267230831770336300588444747762843759096401075210098436532138784880804799932247566970642529121364066612216811270441923475539213363391876709967520432970001189613754468394504726917294243804597283185825885394444717803465042728107614758510510324174671273 - - - 4257103436738693167679988473229289136213965822055009836429122086227208976617015158554335685934033709081255434321021922411600352023894639658729306158101602153035636660388068573921523812704376829383643150036396507460136150352573845700348414072481768647411162438985157824104787655967389449019995413270282384725 - - - 31273849552494023387697146195164619556065892108955510829954275657213643062645495427357887929042406068050763274296028240982751299109488666543364710271423257790548527234106226429899957206169892445232737790590754462461209360892073592865787825317580388584134032992457155327142814088810984081589994609099547807103 - - - 35347178693259636224425976955506604359014275201911436639125947893572572942967879891723093129361271536461729305849344256272804438952413715869305278809953911268349508791262359453574584301723678348219958163537617880479600787349102851371503927614310858588626874124144067272631324900475250505683917036436021292017 - - - 52102732689033856356640226142441703447547338607766799410243675288006455786150047981514503689756076319154821254787434210207714021249333494274124947142471750583698934512751038996632656769981162124907250526920201757770741572757079121833484338311748881797371896129073537143638484841938341861907569264174122123347 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 -
- - - 1024 - - 99954730175178004845131539653721707390533824134606712982410587911600868971245047100506766033962983317090892319656867952029116781250661480710843185739353918573345334339835797435830424130435498802133973879689630984537203490181103875802086600280921230328725473474449200859216711406629174468133378669755826399289 - - 1024 - - 6 - 0 - - 58613911232307388786240529740987000882039067599860437772060847031357515586839511997150614558368535541427251986791314469299365847701391023351538654534248928653505326544257910522636722321510290544008094306357049503882695532643010370246985543037398842826556465466041122607877993972401850373499349505467940128480 - - - 23759200450495340002812814650036411105104184704810382581836582136381499246372180158982092762319176354865585492876056145343997330165572678887761521089111659694764726321928033912931120570410344269003877152629946202983994387902650140832036058989562136543699053859110798004475607769263425530430095499690012867361 - - - 27782425796445607511552503734068694227876277361913927009841359267890284063272744867098761749380021187439414183495224952502774379338236771979358642185898028829503362239763322899537168530813926957477896747390629838050847130063594861856714553628317263751461531880058526762279151869539133638780577291661705004927 - - - 8784981056185286950712849504706542909851983675476684831378521579437874438781947443207971368861700013318831210277930183684008548888491900029215961830883091576228665510223450239592867424261582734977160146810093587216625525411002439629017874997945384679431426050351258078369390184459312181275581036833509779471 - - - 67438312305077819888962412973544875116933726924127002079831365096482645787717754904826762149733256426407804919023613760756645934824283717354322616471896981039882491744840529505847451034873496543558273551287489104242041014171297514449081571270617393454781665775168456916896840386566994664178411923865986659586 - - - 3464604326727829206934168876456004920457656854740648111041341919379642725442948759261114328466645767790382904740245997674525442848992126187113268087612395494538879214628114838356903347298883717235497237827971476139254978851080082281176240683715669897361209280214505681097167531557140873892635301719665778459 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 -
- - - 1024 - - 148196264683866983246056824641461916553727188878286846814207149952700786295989140546602219816499052248745376771762136245911508160658056925812311366238900528068507706459965567045224239023241599326102923853309769022811634949971343037071212919062146382997355248278317770400104265846506381194883209546789678257953 - - 1024 - - 6 - 0 - - 18228509827232960358109377366125905423396651073282009255000634400639380520576157033263066403255727758538148196007410118445711222636928632798833981031757422495552319975431175939254099574893434799433886121282995060105902206634281977941044087776314177795281177970367372303622719093916858010157621949175537375437 - - - 90741052971361642071954400353930918473049330103806494303478914341240604429740160266927238572355901048839288876493430663768138981859097012674365597674038606403261541063513022898915424660284139220319595247352870395164358600167094743461905071137254013807294601497510689150945162000419459659619999603827775332678 - - - 52734335451280775701279135902793102618804746933648573572440269533476207593955736723943187629344792274001509257176599036967710480587413456988273865241932371090713054609684326983191462176991220730297153396836508515256005211749658852141138853888828449929462905950872738295586503848336537871567551750808215082154 - - - 121858449637190773866676289376800522277568993915277707214462950174058584758252432920947572621722050668109626466687582272873980762806089036347506636343533340986613090442509515739606515227484919838200607799752117413416448281331606056270182334689643276303764467680282413521568568120011182673925501023231082406153 - - - 37196825733132964338623996101449346202869180967029642202058352423341650421724872464278502908541095717874629388572535601572954340968281300632852357761510380827733721910298105144168674114000458492760192448497375493358162287626785807975379359987001469882105036987321265846856757528606901421058839136798700287397 - - - 75089855211101765747300894547085312949871336795292159964546821502857006262710931284436535591390767143045054287236700353745766551337135697641239389214003872913304473085672132743841053938472186773425817048000547738177259207808092058727324924409903592113635766451695610110034720923274183936484960662875433336362 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 -
- - - 1024 - - 105921949191653130859423411775455174812642918848669759359209486362932598819678144087209481182550147678529129567658791265359717569767628215894734409001006779022322289698515237895707269420956251973406350695311822182673083730764296195817297540780868975477123852203726080688004629860517990328589192081987644050229 - - 1024 - - 6 - 0 - - 86809400749152861743901567276848272927167445497006079265900998087562865265602440835156566344510296704141655423477235937471795088316625845837856447310120665238699640116252577611027501208177910037535632605368178096550493728239151536133777140960209848761693689914935806579004427834951787425614424456419297157510 - - - 84986197247511436399667031576140728639886927069411759928791244212693888161425776856726174455028312620459053949666751815466973657597394187896486659471058818599622253530061625009497213318036240988480751591194064567662021711447798444988895990719137206080680744526229981752063726938789038885269097160956167285566 - - - 12431205654625222881707000710728606382090929111990041388059059946907607046548243604353853640940005905715357216784232240313960881905454724897804957781475751038209721410086085767242939434308439807150162545625051293193433624790643565812552903666506190662522259255795554682338285362255530961345229551611440343519 - - - 62883235755082005523686546548606789143770348860378546277745391562811162140335817900845352214174699090463099544541601029119065647315851429798873533063329837639373217180256975002663524244050145680516763942257347656552764882712032814090180931672955198158069467918914707575354901887685922556718370751575138342589 - - - 39849433607740902504402507874016885026871507213461501810264903771866537152481854388265980706007990086277706589042473112769024003147970075181100851394556059066286357588607531753104924164102535180160270351409239344423986742160630582682803306956751475609550461013854012988551751425448894542674892017443824734012 - - - 85402225442112559560680078698274218019993940361574204599118634528616463142138719233262976451961276991618853156780942664995492868531530624507421313975512606915096058618792443156198101790705909662504630168187270536791683734761412420713398341369713188166278602069035350011783353145233527044956434445304512600650 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 -
- - - 1024 - - 108440748919252450268428286731731896396610163026933503975849925663492334776921174398497109505538747057893434317250808469760213233529336913398085925870706542294714657431121759666156575676722682156151413720356321723309169997769639095210994084916522091702333943625021802404556103531364881274617202822828310848153 - - 1024 - - 6 - 0 - - 66366383659085004160581858686068110323987677633068554408731820055937312391603116323527462447105256578555787138213126535928787848971976541459974948337601213550884956798828607581314470984305212507805730810283981952589260529852613686591965244366260752647049304254010848262444064395193144695135425020863379006256 - - - 76945724108134514476845806024636683902509514081378625453698025707233689344313131316105525545539579926429167457073332412872790363136331080030707890397365463990420679800561805613345351927011441895347629470989024367971421806479256556337062265729708476344598157347724009574637722602080586962935931878380448404266 - - - 91945329973224060248558889328744255046597767263343203901720894520436658305695307815971264787080717251578623712083670325402817260476998336830698287676420656098045289735223431738396971319193824104754894276305608143683285127818367138056317944418094268645782094697587442950453451099229969927726915095865444522094 - - - 71371194814401374673127041666269343887336750774645785365973831168673801465656031844499219442062352660855087164791888562838903522706610239539435340535864232794707954647487039513635041583341855480149907762844377270478905725702421973086424891767443863000735666109119321036123589669276816773800922411249576027546 - - - 53718436417526636858730643071130396923526708450985497713286303484760405006322845800085165613155450183026982545846694095243620426398424635300019928951028659679765785677107062221527213905354703614993367947430698278405310236478443546679988798318205559042482374923767602250464637773429717300281505631064612985081 - - - 85230469722743515304402648589847925000201154330027354125047810198070022725031542612895149579396712621532910796627591852488733918035116059401887268218978788971949898670298569884150675654662295808772549913103127258327197135266119807509485752123513682985319604190596813804839912737937728219384325250171411540887 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 -
- - - 1024 - - 103432042254953094027999928574250715964500891045142387105955201932618522113984190182166706020884933161447941491385637733523319614167734344468728413306447688694643223282152714640407364090919183137006284201884535802398403524505317171875956878874168571207572265824173861602627771714795571730952163007208142820237 - - 1024 - - 6 - 0 - - 72735857654996330036308578750037768707512446485674661426090344826756269113965804188268267650912305793719752190143646093227347682752079327651194810856984810512909164395531967789876907601998849500709695834360721633503971686727031033634428158149145749257438769804777610989050845392734398678464304671042690689175 - - - 40354197327776309644557445446598247511877805740566355719587647166808789073448238334020156687581688473278073371655120817040636086978579601886371654352774729778337067600125687099708508209515703504788115675665658396923040920295778105284271940275617551147714430295447383909281391532478964687175643491947382829869 - - - 26968813628185832884730391035851987751870560318430849916723371498400782087349207710865186129239304189549444082550532948832976767259584865952574643740037079740215589837871761474656629795571319987839311742585360362081712716843606865678855283492160943131234448889819908044401388366435372206735181092989882690610 - - - 44457756325918210432882749039045279802693637901659165506229652641196771463619711136701874027949976037693870830860638977238468910265640234729073206675396560391192913720942212407458029980943194950742066637775931509413627536969881602485810181257639579907992687706506901124298572869645460421266928082601925747112 - - - 17923816029308169688209802751254596783750808205473920711963121223110109870977619253002898105372250772280013117032657917924973651135856341002576602124287460305553253303790018252719017423511552791332813099369856129658602326535776342375244816034773978221082034151281828464402757244302554451737031177234874936733 - - - 58173516169174283964719668683473056584525739571524859721047404025100657870657926179915235481899922046403049387657375246255178245370444590309046031552510281811181831088860285782828294445034384018959362706962339714212986805788263200055409728428500955125311148857260741294606734880811179920282935017488093954695 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 -
- - - 1024 - - 126228903767442190738148096183580491175038013895363063255063879407638776222007762640020963679700983981505819346117331332097744171511439132259106773717665842976406975673619367222219945376954037887793874062977933096988373359681541459886631958588231575466518127177060945684448323334830138905052399414218163921421 - - 1024 - - 6 - 0 - - 97539931636318677461475619122054540059104052317022399756575154292552051870858044057227021169523273160051067173161809677608371202374236595169900819410518245929982550711392322042314682950608013639486222401760902052975068868934717538248202265198283607804041217016155626510986296204640357633562628725262540901308 - - - 17056048088041119848885497185187738234341957332739548911174241850674169289366712176470014650655283087514808671532359181973245193579686505807246886039638542093762471617521947338468427670697788979094939538614633506767486848270358174624110579657908121127644226601122674835651841028567546912507950233461561314311 - - - 31717709189699030137875842801316834424645064031847570293530325225334129025771209881989868755679274813087722642958802113724122792623999410285511001585168859463078978573404425652982888882289493612951079566418713192311092484146177732644672658032091895076062007702891319957382778438919270892273974397851698486802 - - - 52701408784517534567979255300945480765809161198465471154967839240963141730818870689354317216286196381556788622550165176263143040912951902845119716643679329549799829193894570784536684136260779179477022420722664058284142073288038418969152156881985103589172969912151842893647108788505003435443026642491812317969 - - - 15916170466240831405710269071326971495003989098632832660085003103077847286202099441873708133501162524440579674719437136363718867648113746692100804664108054776712148615544501485090998986423172752761257930805965506564375676115179462856206417265463968081226820646414689722755150455107075664424251782354607115997 - - - 119874392493908971774593399912229045812669019257958357082614870704163802485902701553073252681759628404556483986983935409150939979774709275900622818557001714033801638980212024983490579855036873618987603097875751122714671577192226926342520061281357579934217951516213006849868891095137524137512935354897389930481 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 -
- - - 1024 - - 130984031670979893855543842480345875518508410205548385455401787667182043276909712853992897091674870836021665068146327054461603450458407290201372558787290109357683738428013567907514516775559018701817491758213188304978093675528268199327422042148541505303706207770150984130237176790872039958140095900892697292761 - - 1024 - - 6 - 0 - - 77111031511076776748383055590862571648674736492772474529961718646938316725304876527853934806892564363406371656844786106299018421240298065574103119127179436601308127134820838280671592776233104655784461864696507484750746141074714338613753312756700370784915468572345403051130346709078319417883115672974802169835 - - - 3128131951563621685781519514589290396078543084150675317713253716044387307905521327893562744421717071028534528094967705348771755396568977554185830341410613830519127494248441161017549347924906597526952413022501285246828769224407661000067457541358719277808165554742389274830650941000817519093291137439421649691 - - - 24954141405440090689976175252555167972525713681839903660616337028203242900712021559077665304276350472093427384187451836674689185805100258168917640061516156543626305008035523276260649599372451478761753446079713760095403758829516730955461756588789162979921765890451415813246841487242760610785376086909463933797 - - - 10083134356469565434820655937850585425146227225076587201691007206376287612169498960565670490848694021370067252342213688465673488420651484169267195969254736060823678091580860232493159013856793525376166944993634152015542702135847543328581535175016508032979250811181479986919377039311967364297745111283924007008 - - - 113848733397666003768323762636821213490695764177128020789115723590466213187341258833452173134117916819367401260647045106530664613037790726812093687986435876985971021971510207916178699329669683834822651456959414265166368467473058891635488094103090980035908623302936245578454636917795970043625492656294734023452 - - - 86136816068775947939443892035798452754540048307990163601582410345529875583874238629932272530008216513299726778108060514260087906788536911056614574118478556477474027724459155894339604045879892134387001046080544595464847107133404856959533587474371075416239607580582640652535022808207241217726978029145005615879 - - - 1 - 0 - -

- 0 -

- - 0 - - 80 -
-
- - 11 - 0 - - - 1 - - - - 2 - - - - 4 - - - - 8 - - - - 16 - - - - 32 - - - - 64 - - - - 128 - - - - 256 - - - - 512 - - - - 1024 - - - - 11 - 0 - - 1 - - - - 2 - - - - 4 - - - - 8 - - - - 16 - - - - 32 - - - - 64 - - - - 128 - - - - 256 - - - - 512 - - - - 1024 - - - - - 11 - 0 - 1 - 2 - 4 - 8 - 16 - 32 - 64 - 128 - 256 - 512 - 1024 - + + + 0 + + + + 1024 + + 102680714876620505251519589456529850089969700556564489253162684638539597335736793998411151385396668678457395604056076455447346438315008567850445832409559094642617108516105196798178870587832997740211486024550117558968151215813802257578385470372409470175519459389641067956632237921585676408120047405305262039181 + + 160 + + 5 + 0 + + 22923320959192453636423682385738922848216151492993760467429386172337582699603626592667966029063069617300543105850468927060751138940226489398256413607978816318065423599404211058602051331171774528282150565237472007558045410089374975467684411005456109694572501365211023547108753818220756570663968723659519304097 + + + 53945843214081887230506825685162514221944851452590973433147320105768347799035010333040104182762421540976644457898523154200390719416111152133906850059276116624692455403920555815325946146027238316284576081046322930997100925534589898400045746221732607763907326046366956881978962788748138738898197865947329746712 + + + 84070450444178810764801942593139363675201942216375234211388549548441399502573647392486982654665114331690463175765687779989817013063882187163233753732167024252613425512245014453169195391341163601305650730846456990348521068770085139213305228501503975315987245346014618040731218552889355850011776660968387243547 + + + 44698200531549202972232618323671999010830294896874839743157702137836602383560583870323823976773804259743506237545914357368122833664632525931647018821826400373691255566854594204199447306752422310463080619172699838408810456076477752430884838822369737010719356000558487625372180909172327760255616921931423991248 + + + 51872694200042776418703861731161005597647063174327775542825481250710848362720927717796283168056945768526737370976647132055902410582742570384884317599347064382929720903764261035793509472519152983496873672379499058845114238849894388800999929829175350045958631291831128454260459997110600204624172747502759593173 + + + 1 + 1 + + + 1381926471275670696491547928550620506717346803979 + + 80 + + 74302589183225406744708406598986697445626235129332961159539629660099003864681279676025057169598059221346100246653275027988998552977043535171844663879396255745429680604118860556814772359887881646573360468171271074105943974872534642719266485854337939537007792420 + + + + + 11 + 1 + + + + 1024 + + 128057967809655946190316507735155452831314572900315216081434860144597217324346737671800302572587640910078110732912465466684478941477363845874613925338791275068167816621932721309235605381772586248486970010063355049965746801462578755831359666996420724229475198439645105729191854361248312605304734475323680662913 + + 1024 + + 6 + 0 + + 60811636929475187479807521649087606074793642064167945690350627603203118950323257675713133373687111123714663109087066267073458476631246485001894677569393649603260477149691339449729864039552273625864812610179069562367245786370215607199308088083101677805342992837524421920973047652387594443568045299878715104011 + + + 71560986262474260038579847733152867125395323692136727882523150181177145526050032346646815633503819181049097447083396963116870388315714388861158191811280162852633670260478236187402519672391362381543748430716574725648848677812893437556332455280083345503039177361800148373565541695573258846852919928924249154877 + + + 5358493014159018151110306019414188401443366482533390828878588153924237270657211162207396455592545292115596564966717448066974022571552087820343845293928484045368156700279200787884399405557838594314421227423879077160333472477688129275324340290022874614042967407069455935447388415804019834527557283355835583238 + + + 9440403911953510704955609199118462522546969159294361115679964001969095067128208202978671380235142495494192920664243060842431049236464627103331285996753378993464968648353139689202039972946351834805543874912252883016750152554402795151625609573033493183190907610839726606922080056808873159110535921110839225918 + + + 34601241858178235153992489154363566911322825930412755051942961530163789553279237024169967243263931210587905323687670939702730687998131084839805896091785126613296047470576600055262500331821637746680489652121076447750079042944735474064557177506619768477733608759334395601504750316910835074596407622363931297695 + + + 103450953660312905541961327136746359534991486059040490771968614429013794227835017626759804639288113432551732347712210332460709755012800755979360542019454727242090797411218789006851073710562599252458946620552051918314153874747184637728072116094587384838416002546398982033848043597058533784377942968102172250659 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
+
+ + + + 1024 + + 91338861134529173742636614734321283317712406433818139285229062454925111527732609262828687047423080667973258817589805005737017416371360314088086808443898371429020158735259589920882443779130428607594850787634565846387075036083051955856286100630464641033224957452092909212599715224401427904042049536509604893693 + + 1024 + + 6 + 0 + + 88481512963655310506095083872998303955363103665395614689748950761935149130592150567352051526842435768907883513122638406071951993833483039104880894260670448994086429616644971856997369229550170174238792300740232364024915015016653492885640971890845653859579668498528250516917066920672069528744730214455335881003 + + + 71420609539497237732868765033013438071208066944625734387424793864620282249588182875061993503837717471514509627177747945260865425509223920765478106067601828682271744524355493795121669193837190303641492443480194307599715826281960573836394123684702869297115710345424755375986644023739445330856168082010838417938 + + + 36213374277915021187960501154206429350509009943784937342853640962344665273661370341432812162660134104129081769292257555453657933322026058920570002011215114885632603237420344104120014493999772566832623489577942137696416594059207873047026684531831127098662368796483679106715230357303209903005563129291440998125 + + + 88784875219103004490867409187796580439336028275646934064032325734642172796350750877782655631487263690600595545185986973949637793376040039529334242727841787186152368722684829777472113434707623526142748869410906573019822447060135044716736888756586491608663760971724703067383426197232527066117239191970436021914 + + + 57669682815414213701829150785790139820922208365396385382451270040015047105011059602270677532141334599848749895445377163377797098101769663138915670832338561398070313576223809679656089041902001668549387570675942187547921753080749715443394968434937329744189522351133848627606864859717699163427995004551470140014 + + + 19430387956073665040008742545168228237366626380409449215616316415682054432029605888008345798193251163116713132110293851289775570086405711097037612492724618955613522669964620645767675728759532995017555557036656920568589220029848250912688353596366989096421783410644212433994547565209779383923475304673100010441 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
+
+ + + + 1024 + + 171795367802537336198216850040760302817719433285673072064016704297509263294972920968862879995019333546807716681922194952612358665832924006994420672781322683935998563828829629166676961578310364216820723333284118541610355614763234524893877254301205676826968663616237843247997193664755408992255295724018758287453 + + 1024 + + 6 + 0 + + 138781939743420141798085654234587085378791442750844156618218315519623156030775014083940843628427157991650536995512183146050090364430217798889903276779395691314769341501283521555441395248293145295446229257598584303226472282606025256289516823083353133125249557574662930559464988881796972570415006594877835195261 + + + 168420371175596160385314346470541456127930556988792934601264980767954150761074401191883764002057676025574635595559453082438403114835695017344400960903147888338845250647685131378444914574667053754042483424927960459645361430078126904416924147233083786086593890435155965855696708192722757613306648217414021209339 + + + 164599507864917269230220181044130466242640054454386799153052272100119238662434506377210871322725801768535465849520862187042461522458751851837119010844326508994699806461980159073458635731317238484887665362257435016594387971946664996341942792674855452076757886270233668811767159399329679444242304826944461878356 + + + 112022954554594868430694861746706902810007259966892035372848716164773714721760248918761857377457366770462246217862095078291990529093104794681337350992919876990886726535142991553290065736768419334005963502455897767959870639353796998608846837617297713305741565185682566104560690180553705181428610482999491959762 + + + 20795710379390313360149837901235593902809611922782438280826554162582584185176550436631972790505407403299851110962435492486911884529635673218790787915570636384717044595376003628898518022547995524968409598599237503027024128328270655662334146591298270627006489949537312823974893037600566816074625503584300399503 + + + 4461068203835146920397273122878996496925951644023334909782795888195924230363311467297500231054245083629066539839024032350563196843805187870921285704555947110972472049763739700924273806542377974583744547273338787688284998293736197541473212310650426901783545952048410414287416361433915264087521382790658628498 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
+
+ + + + 1024 + + 107678493864345648666726963381598843005045134906745773568855127179729298765945796229988935480734186762723475076589458553114861073591179889992284613957887798550444135071834300620151269193028269405467525155137973905598460168964059816679287733081423902287277428322195154969572934367847409309681954541961841211929 + + 1024 + + 6 + 0 + + 34780567649645587652662047318280460216197594322629290659397343806640717111602043777551795972363990570490561518129361133754971748815062877457811980871870613895746761204692874944262181605786891503668206019069701677551111685254064897625906904673396799614054762342291638726110702862138766341205373553864835127477 + + + 76770578985664099191449798911850613016440202975139749844785468106943538467941487623782662375335620379715667015148235397661770125559100524256505138827952950374296533996410404476470347577736554558794350087928716157046782489969073300743386412321573188949782078100848155826141059164451205262811577282438487833155 + + + 19375132007991059652876546182462672768720429677050803522934111565324016495763732172744623907045335493048740541182304274405106110493850369225158004210873483104238595711350247509966292622988932139561490663242014148110393502548086758118819001913181597386000596861820476450726333113377798106479230138706277155435 + + + 60332745111136671951489671083751897003291069716229419557442175701860610038139875996851654495020782497922916125497030526867835842055895873784260108184155213565134969114645958871640895775675472360543614497922018081777590790520072701770098022598964534954182431602697737796983390272144688966305745888541862833949 + + + 33206030625501357397902828493305862279894195856045523813806319914644617357371406587381751252409214237464923457683937662308696252667537129026830911327626477920950026367523422037741403916073653057335758700270326029776865721695045422550695292453931419295319756838382198216938790815705554550670037002167896435708 + + + 33699591887245320183352886957374795158953603724548326397696125237452265579267587282433792785552885615789973016310923276732538075279246287329477093697179355796742915804057038950601496710139911151519055346593812515824483642829165138763105492040862107512334441962031341198253373030460133402288720613467576919651 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
+
+ + + + 1024 + + 123460587970465722399480599701446111042791049424678164510782348298178989524706869827218072757318065802572872977206189692439610889543998303448261820274781115343738147716328254096174904353808537339736300386924394267507766388682907861666597761952802807474810395363126049870826035575374238638068965983199376357813 + + 1024 + + 6 + 0 + + 117318302352368229229163809607702479318456428030157262995598611780776136494163450278418011369672196225024705223924157260734348678181103931116903595932563324645629923260513068155684589997607606713365161836567403767936006638718885167253192939940642824452024816730744123545240701916149057716603434108694989710429 + + + 79166656374368484214654356495255053395213742590584206280310930719755653489957925930346542517512620192097650425359579247070837443830862748231859562053718573394014868991678211219437490529223024342458612272327848652593110612340785752785585712120010687405752536405399684337596148008796260805479427829450136814686 + + + 40871868938993875410426205996751811587721008167871813439166564189762055623031521920195950886062485740929198925966775524584648439881883879228755988003547754790287586711275993853306093079373185290320968524077798129432974504079981251722944994855192019937284992580655570885903256271403090577186422692725459831875 + + + 89892620900640290140283566392805476442834511036692916092709883776370123872836264775868321860590685970283545083118729182759253902758383167687729739268452078465233562037688700620432639773342196188561501129246210605848453748122752153274263445164184465697547705606339433632142128437959746969173608800415728397931 + + + 121709777035471737364513670422914240357059445755508125094002474776054087244214559702633254647901247822895427221568520569724729995389163298559564480170015494003587855303221851200035414262844476231232261394773812801023837394666069091883472673028207084029985001140015089782123008327089253959339518752984564005371 + + + 118368291349285147157585550327202423335817645258822478079337019930721123815468331635525068128544253736950377216631099734999157547924851998471340790034858629390897530180532960195293567558086925678406847565038276833217752653830262850771875793504960255927890257698780412927440166594709334246027496966288743344300 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
+
+ + + + 1024 + + 115193322549187017758632085674974727024742715278872315780926012027804032179761766503288065034565716892785818153660349164554433828067796365626741896969380114418490544104123599167386238983295022270967054328089602503480562145153230657099035975059011144762714926206594556617956114445259820923651026107726741377073 + + 1024 + + 6 + 0 + + 24958892788118393840566891402925212894261112686881756396217607457946596306978104211815943994414797105011718075194617345672726305027536665064724927900756862036945765691966423524893153682261745384165128816990435797199717205467355245097126693946214610135412865735012562961328364927779026079460708512689938357459 + + + 24288255554756812624762197103340158750190223778765519768405807403357684268583138358422886605098116268755079717463816662298139317595939687753107981126116196500860143071528623840509966635777831057754249172610936632021767758934196939105040316041127363794901161035243044698624148907282589708017305528332080549401 + + + 98573529002331715221466911082616318301300017750678680593832916072820765087229700809543111818625003499979817183312145679122909425246500434114287363675204505267732119319754784623466080567913652584576116756111506044251229410873182774035682045895464671545948436513530383740487677985431898275771829011975467387636 + + + 15353985435509734717647205939924424374297140311254436480413662376519872061599819892959995176175891437756042491481998969903341756892089428475760114248462830393435227191729623914880110584220456903870872511626091038462298582250901312945423814102221099309496784542055234964849111850334835617876760601457927418206 + + + 17455735070449738054682884370746228687686045089020396998083887583650988955042976829464912841928464950070337180970573621151968757420751546020224392735386909098113189353739054276774294071884697288831510878855213838041505870499205405393921909645992766577060606810395305981595413168173038810933707942671713337798 + + + 99078282433460334122518009685435268135390495565166370788375980674406524442600154170383521782130678737146346515697587435130336220692226983416874121180076768315197607852814628471856417469605509753709709939138595158453850817740160745949448738764045233343710173080910805476352529406131342795794391893459845853249 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
+
+ + + + 1024 + + 153256019031673973848391853908671616024035351852333113222956212092935054851555144537037154882131071118335109565772920677334385665987953763710322752551766091084637014937633351768184250877579165516584609222393690507834529036303945036774013832353124798268158248184389671641362425541416312746250270416649359548041 + + 1024 + + 6 + 0 + + 15220542722079887934163021578416557040815588753014948049895358680874401987354756483638187693890778200226187944576153001580318905767308325025251868319513838639170229388887094978609944368236261084829465326382756814026047924860100572370509240911903760108844191920274365232194821110327754051188671927504786123847 + + + 143004036495287445500008244565089775614807488065311228319771443644042556939728810959906482515000410036341359319395672341423672298834030730662358936098971678898328809479500096931876973317120818472883465991015596717523641856810286626439287667681040066261020458108584755098587931772918575340120380122391279580630 + + + 25677830626343122473800267766987258667661454338633409925057452295050792502934635228012969731952432090824067546127184820674269109763072029928071755085679552707171555102523382002859000834013865264250888579699016146722510456747010192496630995123022435395781861793364259724814673958020662700602026307416209911222 + + + 62246636121089263731371807945897520167051837454698735241698439734694730001470335211863614247823007078485077900778766898167190790567301408855375740484748340320700390073275392868823940948653806683445411202776990790067823595294042946536030310357110325099679964532575421698733314704640641895828452919877756100011 + + + 109179195904717079139512297958344482754488860947001124419866306632211947700557001412569449694611680557227002345132253379015047209028361122554436255825724641792181226048045416132300441370043533054296640636019094847912470011225895961907747561407131402046285049780521232862899425601689434905370686341564422790289 + + + 72256199900300051197332501127222934244256559778006179914521739477500706464599171904600643790797361089413358501039731833363101680832368594873645195342133343135647784788351460716476460798313313942000048638227363109185805859595520325671335898545619147866290785844770980165710956429961244551737499380764677597447 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
+
+ + + + 1024 + + 135358305767271858027595880716111530935123928737890043873187024055476620530906467130993033452699358704424795550755169128359841746123492797756886097936671355386621176058979935393331413499392989299082084359031846630046001377108741347076252627789379769344457517235001038532356319713316214499718115421425871569433 + + 1024 + + 6 + 0 + + 54594747011594798877885888974944176740233826058214590608446121481719016646101845365461669609593284564003581366359995275781810124519910313811380876256508679688339828939491429288889804388749815124253867496416627880709040603044538402764027705232404679640769755327219879688706197760711345784098387646185164981152 + + + 132783808999394318707408962088834983207010415125168788915872658758155889296838532193150695880199623917302322850691457856799843846471181568246727469377964494204689790089312937443605415487457400789095132034217110410411016988079403293808537223974569707930874192773033393470383855778863425429691879481694667628909 + + + 9473430635930700050486617160141204494342095550189134899476751191276019107931129114087093973056080555668662930307913633328246702572209665502366737090850431132340577394193612418080423291630390780237790223606432359088325373896719506291987815760514899446327539193574576164858114835145863147018536204496364575294 + + + 90024838355001075777783195974135066596911088933953254044502969121509346778938214241043930641227033089129624800092043075809246544470625613932569785625492513957934084324845138958744207292453298491639912468882105563813341034734148686353752495183156303339463108993280522860556963638419864094636988429994370751743 + + + 45914980508142788475969536593414423447529386876252836641757988714678457126161180788769040893130014877283087923780361131128613703067760746100124401445607902733176021029401905908890233576832489405771907746137014120822037941005000384307118527309121044551993381248785336586579186345829608419256901639247803554604 + + + 32911404065014905616571735182748738235851543040766582724263411775153690607184929086994340376410140178669625764641435927432683863591301353627927154715686151567872995056710033783341401210111884942070839872351093132272880604910175334910646752963148483903851675232134333338877843861382949858872798355076941765109 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
+
+ + + + 1024 + + 154218268867696507002031865996832738977246724680896068886617497685938467688459935868916544652628785991317792030286811386804084216509428288684761196875989322260388889257097276677216400072227578520525641529006704269719639306215286673007408730828431211470630255070235631883821820735534893283207489831811866541573 + + 1024 + + 6 + 0 + + 27428799928169371477008314260818876148937722875877046040065001415256050285544612261240610068898749426541489168818274025311879557094462504325465143718226701031270459513481171715674711056192203762896591318737473272520615104809732143483277690473125331986133481516425478801944037361281857855867037438256343773679 + + + 105450822515849266246824784593332752863996144824625198279966526580096181889146860866466836912483527896334247490301097916546476481609859267630501968068493335890437763132841945935390933265030348476193713724966585347250648751479602155322327667705579310128424156557476020295924929348119910434857695122123769715348 + + + 17917586169419969792153843627847724624582303970451816452874219660498616008632452910042480347537075057133325092544315346979734775101435525533629606020738633039620963234297245636824119587829479049303232294479234284130684993231299911772911374146097317218619653947965414360245657311825149559284315208240541584049 + + + 83614794643827277304010494713733702635853026857962232621115526420680432673836574945397242148810823271595098760695291447287587902753143969200514260996554707598388279117974226336910323931721647138761776637137666044994683003226962992826724806567215542394880283109239037221417111570642218445097975627548527092539 + + + 98025334882817542595051261918088236466491396073054003041122381828466061599594157519317917789905097080123705591326984935802933433391754654298972150414662017901502818342450898330664054579806253102093229112778500389727696035428993861323041972409204375141288230032727654233984733937127115582284964721572192907628 + + + 103461867044654386108007921528414895482662948754475387341985070060736686576950492180848716520576397704988373242928703953709705994705234961029080392502757613196202086877221834313994327801773914413507546181585432001324248533541087174089562102726527826866350806480335498036140946354815641124317115290718066663234 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
+
+ + + + 1024 + + 120098847776259535343644334068493409247155794818213113642226621008837548248809756144435391881962615325304472487122528549774300242072619974184058684501061116769021957277559333567971936578385761656133295119311274656165996325688816719676095627842254071860445539705183362636859341285726107647847880667038640384469 + + 1024 + + 6 + 0 + + 78341596191867165364462798149613513767187976045933270925524314074332359105916239984156112944388741605555584315673330918240662669972383036695380216369645786077675668119525313091263106903931060310783249892173696572488213764160500898695655888234795022024571259931035380458667979043363731060752523060256425326493 + + + 92197697267850835637041615816893083978440979223485010849369520091954329556817022954840969220750091574955501530801737742911131398158522167774789346516688492204741057116830688290864687904235809951324327245011263476463848478977798273152839939981363192465690825435376744018481972214855855772912890637337396617871 + + + 4748293030592378955093724566571489011651125070696427417853949295886768378111152102495476227775576523833542397763054262265966439448479602453489588304595952626064095178127493676309959239982750742094802606536171334162655130645407695836907472484934442915849957480725551564249920896993846998541219569493436633204 + + + 104584900904542556799078527703080866806316560026256596079705108220072609345471701770134318641946110143937813605502326970885364040335672893811516334052832715982398959853556119074396097391674101956889279124105778371957287930683941038772719876857983940733827806167120908159325650830304989434548687189098427086091 + + + 91477000374004348014105246188180409651649243135776551322813142142044628230484208001614477763449794744746082101984365227478095962810916246503069968738835364911647338508489896420278550004430041982623071421860079472688566117689119362544066175205618057687399701666608286724650867268340276001512993623664623275609 + + + 27335022029071511973872915368479831202151720242800820669365572158467591925687227633305136848793235934543162969534704442560517668695149887836214069200974132339079102773406068766037767764420212459478276529948373667413279044542607587605142289772231063326758841771162863193523221664294299814482921047353670436699 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
+
+ + + + 1024 + + 167849747908102684615783031952151303487318618058226134276355868669627336908402995742916429082816062902544246840315676375600682020395918653886440543549039685487527686497944229453172069154889512786032054308546997135806844060341575216655718028005098196791080486235476250761566643135320439910817103719665970114189 + + 1024 + + 6 + 0 + + 124697971864257013069199803276420735672381775609467161633368671004811398338592994292357677388507254846498502768389738866111523924342131234320910182832156897093603904400854292861082845611922732284956492433793209240106822872232125951145778177387397679039918621121927819973078906987741480262525622005602565399227 + + + 108887781890361525299548949264309573612532412215054221866945026350960909252554790687820537292488822159239096136095460817189450475839784419203908369203805504902414189148576907397548005367318289848718165066768409808513010231990171238509327686404013042691377114557387525251911427307934702480124889546002434153883 + + + 99965937256071531833352267584518740705187568678398481975025487900445929854870225696845831801035897840798993192645749908958835960887390699965754669201895122689762609842067032782947025374191336414827383420980245403487860703320619493841364508653990560873053561052051848165272882782658715485304580849894447481984 + + + 135464487014068006350241183417277199933512080629319393539084556152088647569462879342427336794694607292779308330281931121306851709112290516904611886868248721653328973827011082831762202172003407136709090048796766379233700381954200275601566017619852103033202510881086909114257203408422383001855075728038739087666 + + + 116087460929649477650719239236850579624411409915463138669472799334909075618371332653913172377800254417621211492605964716808216033497729198457377469580439281611985552152638264761588841398460105860435413320874653840732276755863584448068058447432518834882323032920701627821579231087160538498920135097072056339130 + + + 87022481899114200452477329439521478334907267121400160768484310083510672665816499561166856734334611173826744984646636728146751086237799447687536072677043559995690196109619136304467129246411278102278767648846219215263506982413472377610126752110280476180152080765605425555155921191279654185124388043571147181327 + + + 1 + 0 + +

+ 0 +

+ + 0 + + 80 +
+
+
+ + 11 + 0 + + + + + 1024 + + 128057967809655946190316507735155452831314572900315216081434860144597217324346737671800302572587640910078110732912465466684478941477363845874613925338791275068167816621932721309235605381772586248486970010063355049965746801462578755831359666996420724229475198439645105729191854361248312605304734475323680662913 + + 1024 + + 6 + 0 + + 60811636929475187479807521649087606074793642064167945690350627603203118950323257675713133373687111123714663109087066267073458476631246485001894677569393649603260477149691339449729864039552273625864812610179069562367245786370215607199308088083101677805342992837524421920973047652387594443568045299878715104011 + + + 71560986262474260038579847733152867125395323692136727882523150181177145526050032346646815633503819181049097447083396963116870388315714388861158191811280162852633670260478236187402519672391362381543748430716574725648848677812893437556332455280083345503039177361800148373565541695573258846852919928924249154877 + + + 5358493014159018151110306019414188401443366482533390828878588153924237270657211162207396455592545292115596564966717448066974022571552087820343845293928484045368156700279200787884399405557838594314421227423879077160333472477688129275324340290022874614042967407069455935447388415804019834527557283355835583238 + + + 9440403911953510704955609199118462522546969159294361115679964001969095067128208202978671380235142495494192920664243060842431049236464627103331285996753378993464968648353139689202039972946351834805543874912252883016750152554402795151625609573033493183190907610839726606922080056808873159110535921110839225918 + + + 34601241858178235153992489154363566911322825930412755051942961530163789553279237024169967243263931210587905323687670939702730687998131084839805896091785126613296047470576600055262500331821637746680489652121076447750079042944735474064557177506619768477733608759334395601504750316910835074596407622363931297695 + + + 103450953660312905541961327136746359534991486059040490771968614429013794227835017626759804639288113432551732347712210332460709755012800755979360542019454727242090797411218789006851073710562599252458946620552051918314153874747184637728072116094587384838416002546398982033848043597058533784377942968102172250659 + + + 1 + 0 + +

+ 12932030508236240029500379006897241129956579101695632927019316457384709196393771888005191041903025893215144948249883093198348475278546477203390317270105679 +

+ + 9902386769664478589840240464665057831133423813801796716114600855905375529754843999999225688343006241702587573209999717516477696656645009688715730598624047 + + 80 +
+
+ 1 +
+ + + + + 1024 + + 91338861134529173742636614734321283317712406433818139285229062454925111527732609262828687047423080667973258817589805005737017416371360314088086808443898371429020158735259589920882443779130428607594850787634565846387075036083051955856286100630464641033224957452092909212599715224401427904042049536509604893693 + + 1024 + + 6 + 0 + + 88481512963655310506095083872998303955363103665395614689748950761935149130592150567352051526842435768907883513122638406071951993833483039104880894260670448994086429616644971856997369229550170174238792300740232364024915015016653492885640971890845653859579668498528250516917066920672069528744730214455335881003 + + + 71420609539497237732868765033013438071208066944625734387424793864620282249588182875061993503837717471514509627177747945260865425509223920765478106067601828682271744524355493795121669193837190303641492443480194307599715826281960573836394123684702869297115710345424755375986644023739445330856168082010838417938 + + + 36213374277915021187960501154206429350509009943784937342853640962344665273661370341432812162660134104129081769292257555453657933322026058920570002011215114885632603237420344104120014493999772566832623489577942137696416594059207873047026684531831127098662368796483679106715230357303209903005563129291440998125 + + + 88784875219103004490867409187796580439336028275646934064032325734642172796350750877782655631487263690600595545185986973949637793376040039529334242727841787186152368722684829777472113434707623526142748869410906573019822447060135044716736888756586491608663760971724703067383426197232527066117239191970436021914 + + + 57669682815414213701829150785790139820922208365396385382451270040015047105011059602270677532141334599848749895445377163377797098101769663138915670832338561398070313576223809679656089041902001668549387570675942187547921753080749715443394968434937329744189522351133848627606864859717699163427995004551470140014 + + + 19430387956073665040008742545168228237366626380409449215616316415682054432029605888008345798193251163116713132110293851289775570086405711097037612492724618955613522669964620645767675728759532995017555557036656920568589220029848250912688353596366989096421783410644212433994547565209779383923475304673100010441 + + + 1 + 0 + +

+ 7590313132316003273918078590302512319095378293744922263631882454117055270026174894373664622063534944373597887745176839805114252442895212090845009070876059 +

+ + 12033609093892453905143611421316260116392442619100420560800021219786194165358425170485864622027203788410560571310992155037737755554341786034296519732793927 + + 80 +
+
+ 2 +
+ + + + + 1024 + + 171795367802537336198216850040760302817719433285673072064016704297509263294972920968862879995019333546807716681922194952612358665832924006994420672781322683935998563828829629166676961578310364216820723333284118541610355614763234524893877254301205676826968663616237843247997193664755408992255295724018758287453 + + 1024 + + 6 + 0 + + 138781939743420141798085654234587085378791442750844156618218315519623156030775014083940843628427157991650536995512183146050090364430217798889903276779395691314769341501283521555441395248293145295446229257598584303226472282606025256289516823083353133125249557574662930559464988881796972570415006594877835195261 + + + 168420371175596160385314346470541456127930556988792934601264980767954150761074401191883764002057676025574635595559453082438403114835695017344400960903147888338845250647685131378444914574667053754042483424927960459645361430078126904416924147233083786086593890435155965855696708192722757613306648217414021209339 + + + 164599507864917269230220181044130466242640054454386799153052272100119238662434506377210871322725801768535465849520862187042461522458751851837119010844326508994699806461980159073458635731317238484887665362257435016594387971946664996341942792674855452076757886270233668811767159399329679444242304826944461878356 + + + 112022954554594868430694861746706902810007259966892035372848716164773714721760248918761857377457366770462246217862095078291990529093104794681337350992919876990886726535142991553290065736768419334005963502455897767959870639353796998608846837617297713305741565185682566104560690180553705181428610482999491959762 + + + 20795710379390313360149837901235593902809611922782438280826554162582584185176550436631972790505407403299851110962435492486911884529635673218790787915570636384717044595376003628898518022547995524968409598599237503027024128328270655662334146591298270627006489949537312823974893037600566816074625503584300399503 + + + 4461068203835146920397273122878996496925951644023334909782795888195924230363311467297500231054245083629066539839024032350563196843805187870921285704555947110972472049763739700924273806542377974583744547273338787688284998293736197541473212310650426901783545952048410414287416361433915264087521382790658628498 + + + 1 + 0 + +

+ 12984815465718139976464939024875001723229509524339667690378713583638428557083258852077827822717623083472588218407867051847898495798522333139201280857415519 +

+ + 13230482039279100231549510012632674263858285311407266814423211632024536906105987751850169694421467822291911960770965201757888760198835329800602452213646787 + + 80 +
+
+ 4 +
+ + + + + 1024 + + 107678493864345648666726963381598843005045134906745773568855127179729298765945796229988935480734186762723475076589458553114861073591179889992284613957887798550444135071834300620151269193028269405467525155137973905598460168964059816679287733081423902287277428322195154969572934367847409309681954541961841211929 + + 1024 + + 6 + 0 + + 34780567649645587652662047318280460216197594322629290659397343806640717111602043777551795972363990570490561518129361133754971748815062877457811980871870613895746761204692874944262181605786891503668206019069701677551111685254064897625906904673396799614054762342291638726110702862138766341205373553864835127477 + + + 76770578985664099191449798911850613016440202975139749844785468106943538467941487623782662375335620379715667015148235397661770125559100524256505138827952950374296533996410404476470347577736554558794350087928716157046782489969073300743386412321573188949782078100848155826141059164451205262811577282438487833155 + + + 19375132007991059652876546182462672768720429677050803522934111565324016495763732172744623907045335493048740541182304274405106110493850369225158004210873483104238595711350247509966292622988932139561490663242014148110393502548086758118819001913181597386000596861820476450726333113377798106479230138706277155435 + + + 60332745111136671951489671083751897003291069716229419557442175701860610038139875996851654495020782497922916125497030526867835842055895873784260108184155213565134969114645958871640895775675472360543614497922018081777590790520072701770098022598964534954182431602697737796983390272144688966305745888541862833949 + + + 33206030625501357397902828493305862279894195856045523813806319914644617357371406587381751252409214237464923457683937662308696252667537129026830911327626477920950026367523422037741403916073653057335758700270326029776865721695045422550695292453931419295319756838382198216938790815705554550670037002167896435708 + + + 33699591887245320183352886957374795158953603724548326397696125237452265579267587282433792785552885615789973016310923276732538075279246287329477093697179355796742915804057038950601496710139911151519055346593812515824483642829165138763105492040862107512334441962031341198253373030460133402288720613467576919651 + + + 1 + 0 + +

+ 8086445429826466766976840778602128556427763126861092718555085428344325918560612728005964357058814370039705887555080490065308264985839108620298163559066147 +

+ + 13315924134871259995943889972263783197676570583006459035153156240747027875844241230942104155569988885879710233246386342305956396267067502039128111156418707 + + 80 +
+
+ 8 +
+ + + + + 1024 + + 123460587970465722399480599701446111042791049424678164510782348298178989524706869827218072757318065802572872977206189692439610889543998303448261820274781115343738147716328254096174904353808537339736300386924394267507766388682907861666597761952802807474810395363126049870826035575374238638068965983199376357813 + + 1024 + + 6 + 0 + + 117318302352368229229163809607702479318456428030157262995598611780776136494163450278418011369672196225024705223924157260734348678181103931116903595932563324645629923260513068155684589997607606713365161836567403767936006638718885167253192939940642824452024816730744123545240701916149057716603434108694989710429 + + + 79166656374368484214654356495255053395213742590584206280310930719755653489957925930346542517512620192097650425359579247070837443830862748231859562053718573394014868991678211219437490529223024342458612272327848652593110612340785752785585712120010687405752536405399684337596148008796260805479427829450136814686 + + + 40871868938993875410426205996751811587721008167871813439166564189762055623031521920195950886062485740929198925966775524584648439881883879228755988003547754790287586711275993853306093079373185290320968524077798129432974504079981251722944994855192019937284992580655570885903256271403090577186422692725459831875 + + + 89892620900640290140283566392805476442834511036692916092709883776370123872836264775868321860590685970283545083118729182759253902758383167687729739268452078465233562037688700620432639773342196188561501129246210605848453748122752153274263445164184465697547705606339433632142128437959746969173608800415728397931 + + + 121709777035471737364513670422914240357059445755508125094002474776054087244214559702633254647901247822895427221568520569724729995389163298559564480170015494003587855303221851200035414262844476231232261394773812801023837394666069091883472673028207084029985001140015089782123008327089253959339518752984564005371 + + + 118368291349285147157585550327202423335817645258822478079337019930721123815468331635525068128544253736950377216631099734999157547924851998471340790034858629390897530180532960195293567558086925678406847565038276833217752653830262850771875793504960255927890257698780412927440166594709334246027496966288743344300 + + + 1 + 0 + +

+ 9555708939079495611355915185979699054940167384681225047725748670929850843599516084564504017739835259712298489561139897471949689101632199222485821907536339 +

+ + 12920086699748173672215351475621638389273860195435770401619903340348767410733675655724985891607786607181490238978036873680082748103544680734516847406362967 + + 80 +
+
+ 16 +
+ + + + + 1024 + + 115193322549187017758632085674974727024742715278872315780926012027804032179761766503288065034565716892785818153660349164554433828067796365626741896969380114418490544104123599167386238983295022270967054328089602503480562145153230657099035975059011144762714926206594556617956114445259820923651026107726741377073 + + 1024 + + 6 + 0 + + 24958892788118393840566891402925212894261112686881756396217607457946596306978104211815943994414797105011718075194617345672726305027536665064724927900756862036945765691966423524893153682261745384165128816990435797199717205467355245097126693946214610135412865735012562961328364927779026079460708512689938357459 + + + 24288255554756812624762197103340158750190223778765519768405807403357684268583138358422886605098116268755079717463816662298139317595939687753107981126116196500860143071528623840509966635777831057754249172610936632021767758934196939105040316041127363794901161035243044698624148907282589708017305528332080549401 + + + 98573529002331715221466911082616318301300017750678680593832916072820765087229700809543111818625003499979817183312145679122909425246500434114287363675204505267732119319754784623466080567913652584576116756111506044251229410873182774035682045895464671545948436513530383740487677985431898275771829011975467387636 + + + 15353985435509734717647205939924424374297140311254436480413662376519872061599819892959995176175891437756042491481998969903341756892089428475760114248462830393435227191729623914880110584220456903870872511626091038462298582250901312945423814102221099309496784542055234964849111850334835617876760601457927418206 + + + 17455735070449738054682884370746228687686045089020396998083887583650988955042976829464912841928464950070337180970573621151968757420751546020224392735386909098113189353739054276774294071884697288831510878855213838041505870499205405393921909645992766577060606810395305981595413168173038810933707942671713337798 + + + 99078282433460334122518009685435268135390495565166370788375980674406524442600154170383521782130678737146346515697587435130336220692226983416874121180076768315197607852814628471856417469605509753709709939138595158453850817740160745949448738764045233343710173080910805476352529406131342795794391893459845853249 + + + 1 + 0 + +

+ 12673289315868749623674662876792526399689105251553138253832866963657700201414882030685426404271074917375018034885700283434611314390001132581350346803957507 +

+ + 9089457336458712030766629429550151802473559635837189343206196901440327945060996267506637537707282012347200095016039598579224618836771879940545740195754939 + + 80 +
+
+ 32 +
+ + + + + 1024 + + 153256019031673973848391853908671616024035351852333113222956212092935054851555144537037154882131071118335109565772920677334385665987953763710322752551766091084637014937633351768184250877579165516584609222393690507834529036303945036774013832353124798268158248184389671641362425541416312746250270416649359548041 + + 1024 + + 6 + 0 + + 15220542722079887934163021578416557040815588753014948049895358680874401987354756483638187693890778200226187944576153001580318905767308325025251868319513838639170229388887094978609944368236261084829465326382756814026047924860100572370509240911903760108844191920274365232194821110327754051188671927504786123847 + + + 143004036495287445500008244565089775614807488065311228319771443644042556939728810959906482515000410036341359319395672341423672298834030730662358936098971678898328809479500096931876973317120818472883465991015596717523641856810286626439287667681040066261020458108584755098587931772918575340120380122391279580630 + + + 25677830626343122473800267766987258667661454338633409925057452295050792502934635228012969731952432090824067546127184820674269109763072029928071755085679552707171555102523382002859000834013865264250888579699016146722510456747010192496630995123022435395781861793364259724814673958020662700602026307416209911222 + + + 62246636121089263731371807945897520167051837454698735241698439734694730001470335211863614247823007078485077900778766898167190790567301408855375740484748340320700390073275392868823940948653806683445411202776990790067823595294042946536030310357110325099679964532575421698733314704640641895828452919877756100011 + + + 109179195904717079139512297958344482754488860947001124419866306632211947700557001412569449694611680557227002345132253379015047209028361122554436255825724641792181226048045416132300441370043533054296640636019094847912470011225895961907747561407131402046285049780521232862899425601689434905370686341564422790289 + + + 72256199900300051197332501127222934244256559778006179914521739477500706464599171904600643790797361089413358501039731833363101680832368594873645195342133343135647784788351460716476460798313313942000048638227363109185805859595520325671335898545619147866290785844770980165710956429961244551737499380764677597447 + + + 1 + 0 + +

+ 12342925706968186973716394535438921214235596704954293960842039701459560221839812692276085541622342123471691734600034990812679842472477393419982807837038439 +

+ + 12416506642760835382914337605608007021637845840379701356494020719607002466778798575874134408246939316921404868882276829304115457690088629985078174708274319 + + 80 +
+
+ 64 +
+ + + + + 1024 + + 135358305767271858027595880716111530935123928737890043873187024055476620530906467130993033452699358704424795550755169128359841746123492797756886097936671355386621176058979935393331413499392989299082084359031846630046001377108741347076252627789379769344457517235001038532356319713316214499718115421425871569433 + + 1024 + + 6 + 0 + + 54594747011594798877885888974944176740233826058214590608446121481719016646101845365461669609593284564003581366359995275781810124519910313811380876256508679688339828939491429288889804388749815124253867496416627880709040603044538402764027705232404679640769755327219879688706197760711345784098387646185164981152 + + + 132783808999394318707408962088834983207010415125168788915872658758155889296838532193150695880199623917302322850691457856799843846471181568246727469377964494204689790089312937443605415487457400789095132034217110410411016988079403293808537223974569707930874192773033393470383855778863425429691879481694667628909 + + + 9473430635930700050486617160141204494342095550189134899476751191276019107931129114087093973056080555668662930307913633328246702572209665502366737090850431132340577394193612418080423291630390780237790223606432359088325373896719506291987815760514899446327539193574576164858114835145863147018536204496364575294 + + + 90024838355001075777783195974135066596911088933953254044502969121509346778938214241043930641227033089129624800092043075809246544470625613932569785625492513957934084324845138958744207292453298491639912468882105563813341034734148686353752495183156303339463108993280522860556963638419864094636988429994370751743 + + + 45914980508142788475969536593414423447529386876252836641757988714678457126161180788769040893130014877283087923780361131128613703067760746100124401445607902733176021029401905908890233576832489405771907746137014120822037941005000384307118527309121044551993381248785336586579186345829608419256901639247803554604 + + + 32911404065014905616571735182748738235851543040766582724263411775153690607184929086994340376410140178669625764641435927432683863591301353627927154715686151567872995056710033783341401210111884942070839872351093132272880604910175334910646752963148483903851675232134333338877843861382949858872798355076941765109 + + + 1 + 0 + +

+ 13318107756312790859351398116542175724849222734068960781305693360971589188723148557676433655469259538839570794714793364814074380377642061943802625475030007 +

+ + 10163478794734330182377840913723115665713256953124119469242480062221283140639606280259659552725660927524440315179857892001570482716740571281058839906999919 + + 80 +
+
+ 128 +
+ + + + + 1024 + + 154218268867696507002031865996832738977246724680896068886617497685938467688459935868916544652628785991317792030286811386804084216509428288684761196875989322260388889257097276677216400072227578520525641529006704269719639306215286673007408730828431211470630255070235631883821820735534893283207489831811866541573 + + 1024 + + 6 + 0 + + 27428799928169371477008314260818876148937722875877046040065001415256050285544612261240610068898749426541489168818274025311879557094462504325465143718226701031270459513481171715674711056192203762896591318737473272520615104809732143483277690473125331986133481516425478801944037361281857855867037438256343773679 + + + 105450822515849266246824784593332752863996144824625198279966526580096181889146860866466836912483527896334247490301097916546476481609859267630501968068493335890437763132841945935390933265030348476193713724966585347250648751479602155322327667705579310128424156557476020295924929348119910434857695122123769715348 + + + 17917586169419969792153843627847724624582303970451816452874219660498616008632452910042480347537075057133325092544315346979734775101435525533629606020738633039620963234297245636824119587829479049303232294479234284130684993231299911772911374146097317218619653947965414360245657311825149559284315208240541584049 + + + 83614794643827277304010494713733702635853026857962232621115526420680432673836574945397242148810823271595098760695291447287587902753143969200514260996554707598388279117974226336910323931721647138761776637137666044994683003226962992826724806567215542394880283109239037221417111570642218445097975627548527092539 + + + 98025334882817542595051261918088236466491396073054003041122381828466061599594157519317917789905097080123705591326984935802933433391754654298972150414662017901502818342450898330664054579806253102093229112778500389727696035428993861323041972409204375141288230032727654233984733937127115582284964721572192907628 + + + 103461867044654386108007921528414895482662948754475387341985070060736686576950492180848716520576397704988373242928703953709705994705234961029080392502757613196202086877221834313994327801773914413507546181585432001324248533541087174089562102726527826866350806480335498036140946354815641124317115290718066663234 + + + 1 + 0 + +

+ 12536655577251435153297128528495279017070952231480978492276109251795186322333973692359731778853961591868183555794714823581445343414531738768400801564320547 +

+ + 12301388350138248799753824840982869068812246029803271748337924627397472168580398090458209842652194733464336605766181794711010942109258987663347521456971959 + + 80 +
+
+ 256 +
+ + + + + 1024 + + 120098847776259535343644334068493409247155794818213113642226621008837548248809756144435391881962615325304472487122528549774300242072619974184058684501061116769021957277559333567971936578385761656133295119311274656165996325688816719676095627842254071860445539705183362636859341285726107647847880667038640384469 + + 1024 + + 6 + 0 + + 78341596191867165364462798149613513767187976045933270925524314074332359105916239984156112944388741605555584315673330918240662669972383036695380216369645786077675668119525313091263106903931060310783249892173696572488213764160500898695655888234795022024571259931035380458667979043363731060752523060256425326493 + + + 92197697267850835637041615816893083978440979223485010849369520091954329556817022954840969220750091574955501530801737742911131398158522167774789346516688492204741057116830688290864687904235809951324327245011263476463848478977798273152839939981363192465690825435376744018481972214855855772912890637337396617871 + + + 4748293030592378955093724566571489011651125070696427417853949295886768378111152102495476227775576523833542397763054262265966439448479602453489588304595952626064095178127493676309959239982750742094802606536171334162655130645407695836907472484934442915849957480725551564249920896993846998541219569493436633204 + + + 104584900904542556799078527703080866806316560026256596079705108220072609345471701770134318641946110143937813605502326970885364040335672893811516334052832715982398959853556119074396097391674101956889279124105778371957287930683941038772719876857983940733827806167120908159325650830304989434548687189098427086091 + + + 91477000374004348014105246188180409651649243135776551322813142142044628230484208001614477763449794744746082101984365227478095962810916246503069968738835364911647338508489896420278550004430041982623071421860079472688566117689119362544066175205618057687399701666608286724650867268340276001512993623664623275609 + + + 27335022029071511973872915368479831202151720242800820669365572158467591925687227633305136848793235934543162969534704442560517668695149887836214069200974132339079102773406068766037767764420212459478276529948373667413279044542607587605142289772231063326758841771162863193523221664294299814482921047353670436699 + + + 1 + 0 + +

+ 12065972956960263054303683531293153220877545209080865782763360344896177242905958506299126614232867538807178063979363544150515696532612909118238113675335407 +

+ + 9953515411036989749571851292635891899300129938693414036200774667401727577909694530750019470986492657545284851625143349646524000492135746632402749851724667 + + 80 +
+
+ 512 +
+ + + + + 1024 + + 167849747908102684615783031952151303487318618058226134276355868669627336908402995742916429082816062902544246840315676375600682020395918653886440543549039685487527686497944229453172069154889512786032054308546997135806844060341575216655718028005098196791080486235476250761566643135320439910817103719665970114189 + + 1024 + + 6 + 0 + + 124697971864257013069199803276420735672381775609467161633368671004811398338592994292357677388507254846498502768389738866111523924342131234320910182832156897093603904400854292861082845611922732284956492433793209240106822872232125951145778177387397679039918621121927819973078906987741480262525622005602565399227 + + + 108887781890361525299548949264309573612532412215054221866945026350960909252554790687820537292488822159239096136095460817189450475839784419203908369203805504902414189148576907397548005367318289848718165066768409808513010231990171238509327686404013042691377114557387525251911427307934702480124889546002434153883 + + + 99965937256071531833352267584518740705187568678398481975025487900445929854870225696845831801035897840798993192645749908958835960887390699965754669201895122689762609842067032782947025374191336414827383420980245403487860703320619493841364508653990560873053561052051848165272882782658715485304580849894447481984 + + + 135464487014068006350241183417277199933512080629319393539084556152088647569462879342427336794694607292779308330281931121306851709112290516904611886868248721653328973827011082831762202172003407136709090048796766379233700381954200275601566017619852103033202510881086909114257203408422383001855075728038739087666 + + + 116087460929649477650719239236850579624411409915463138669472799334909075618371332653913172377800254417621211492605964716808216033497729198457377469580439281611985552152638264761588841398460105860435413320874653840732276755863584448068058447432518834882323032920701627821579231087160538498920135097072056339130 + + + 87022481899114200452477329439521478334907267121400160768484310083510672665816499561166856734334611173826744984646636728146751086237799447687536072677043559995690196109619136304467129246411278102278767648846219215263506982413472377610126752110280476180152080765605425555155921191279654185124388043571147181327 + + + 1 + 0 + +

+ 12636642715417859827101007353201088998153392966769625361518956454328272594691632711789366661263629504337888950179922382595129311605158283150634452408979463 +

+ + 13282780220042989825847520435951613240963422612857516952397101500145285194109725467697923880234771831873607951414903374146816937585493435872195952405446603 + + 80 +
+
+ 1024 +
+
+ + 11 + 0 + + 1 + + + + + + 2 + + + + + + 4 + + + + + + 8 + + + + + + 16 + + + + + + 32 + + + + + + 64 + + + + + + 128 + + + + + + 256 + + + + + + 512 + + + + + + 1024 + + + + + + + 11 + 0 + 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512 + 1024 + +
diff --git a/src/wallet.80 b/src/wallet.80 index ecc1233..5cbde42 100644 --- a/src/wallet.80 +++ b/src/wallet.80 @@ -1,15 +1,15 @@ - + - 855354828045887400174627068790510362312905882052 + 1221497820309034144252477697639221506041274072737 - 968414756995630807764470101633578832667834810497 + 1253932919667407502567582782575083966882554940671 - 451485169377034697528434443924107613208404210914 + 640673782412955503747947116702446413720379155657 100 512 @@ -21,118 +21,118 @@ 3 0 - 125595435089325385807462484654804578242447461129746899118248205708411853650834687645943042121373219989715556155744966358571613261760168207418561322682013256955500867958514253046517005634195929337281167606975350762985326132559562762228391362348065684809049314420211837594300035880484608939211324500666703825280 + 93382980843653883025762890886083409827607527193228789447271856528752096544087553429050463606190265498596154000815557432733908395732443745252956186362456673161553823344975032912682070157166069852069336154009036924783332731004173119463490793794707861374357535971351736236154736002902486868695733220033838804649 - 4314868942517643237843322368841190515795186823359 + 4608750384956787750586686299568109016423255065583 - 300072251920152654551720758804038498506750748643135964595300983421419365883525516826814229036995127246412651373096528763911506342624997431896084526357966773436818796020615656392030103693520065734825381843952475314883032435198456380751113066903308199513615353384664715923724321053736723225137411215816976761671455725165482291323299579826283114175312753087803597923318238658770239797 + 300499248208397369986794189434567819278810363998418257225892040135078181463591359705233791759248242503724785750168829666458234554520003855006156457096482396496601742633165704234336134578845247386631417524024589960104791843311261137171973588036911160310836018925761778895678813593759531219022906493835276571347823275301202705007136515965706812095662355573308279870074966198819040965 100 0 - 13 + 12 + 39 + 55 74 - 82 - 59 - 3 - 48 - 16 - 57 - 99 - 93 - 28 - 83 - 84 - 15 - 19 - 6 - 63 - 89 - 70 - 21 - 52 - 42 43 - 62 - 64 - 20 - 90 - 54 - 58 - 49 - 88 - 29 - 36 - 26 - 1 - 77 - 14 - 33 - 11 - 86 - 56 - 5 + 2 + 46 + 24 + 79 + 0 + 37 22 - 45 - 10 - 7 - 8 - 53 - 66 + 34 35 - 55 + 87 + 6 + 41 73 - 31 - 94 - 23 - 39 + 76 + 10 + 25 + 4 + 78 + 28 + 51 + 21 + 81 + 68 + 64 69 - 65 - 79 - 18 - 27 + 3 + 45 + 94 + 63 + 83 + 31 + 54 + 15 + 38 + 20 30 - 97 + 9 + 33 + 36 + 29 + 56 + 84 98 - 92 - 68 - 0 - 96 - 80 - 17 - 78 - 12 - 50 - 32 + 1 + 58 + 59 + 8 71 - 38 - 47 + 82 + 72 + 16 + 62 + 50 + 80 + 92 61 - 51 - 41 - 87 - 76 - 2 + 75 + 32 + 95 + 97 + 5 + 77 + 52 + 66 + 53 + 96 + 26 67 - 91 - 37 - 4 - 24 + 19 + 65 40 - 60 - 75 + 14 + 99 85 - 81 - 72 - 9 - 25 + 11 + 57 44 - 34 - 46 - 95 + 23 + 13 + 49 + 47 + 91 + 18 + 42 + 86 + 60 + 48 + 90 + 93 + 89 + 70 + 27 + 17 + 7 + 88