Reorganizing the zerocash tree.

This commit is contained in:
Sean Bowe 2016-02-15 02:26:09 -07:00
parent 1e62bba762
commit a897db652f
43 changed files with 23 additions and 124 deletions

View File

@ -16,7 +16,7 @@
#include <boost/foreach.hpp>
#include <boost/unordered_map.hpp>
#include "libzerocash/IncrementalMerkleTree.h"
#include "zerocash/IncrementalMerkleTree.h"
static const unsigned int INCREMENTAL_MERKLE_TREE_DEPTH = 20;

View File

@ -8,7 +8,7 @@
#include <string>
#include "libzerocash/ZerocashParams.h"
#include "zerocash/ZerocashParams.h"
class CScheduler;
class CWallet;

View File

@ -9,8 +9,8 @@
#include "tinyformat.h"
#include "utilstrencodings.h"
#include "libzerocash/PourProver.h"
#include "libzerocash/PourTransaction.h"
#include "zerocash/PourProver.h"
#include "zerocash/PourTransaction.h"
template<std::size_t N>
boost::array<std::vector<unsigned char>, N> uint256_to_array(const boost::array<uint256, N>& in) {

View File

@ -13,9 +13,9 @@
#include <boost/array.hpp>
#include "libzerocash/ZerocashParams.h"
#include "libzerocash/PourInput.h"
#include "libzerocash/PourOutput.h"
#include "zerocash/ZerocashParams.h"
#include "zerocash/PourInput.h"
#include "zerocash/PourOutput.h"
using namespace libzerocash;

View File

@ -11,7 +11,7 @@
#include <map>
#include <boost/test/unit_test.hpp>
#include "libzerocash/IncrementalMerkleTree.h"
#include "zerocash/IncrementalMerkleTree.h"
namespace
{

View File

@ -25,12 +25,12 @@
#include <boost/assign/list_of.hpp>
#include "json/json_spirit_writer_template.h"
#include "libzerocash/ZerocashParams.h"
#include "libzerocash/IncrementalMerkleTree.h"
#include "libzerocash/PourInput.h"
#include "libzerocash/PourOutput.h"
#include "libzerocash/Address.h"
#include "libzerocash/Coin.h"
#include "zerocash/ZerocashParams.h"
#include "zerocash/IncrementalMerkleTree.h"
#include "zerocash/PourInput.h"
#include "zerocash/PourOutput.h"
#include "zerocash/Address.h"
#include "zerocash/Coin.h"
using namespace std;
using namespace json_spirit;

View File

@ -14,7 +14,7 @@
#include <utility>
#include <vector>
#include "libzerocash/IncrementalMerkleTree.h"
#include "zerocash/IncrementalMerkleTree.h"
class CBlockFileInfo;
class CBlockIndex;

View File

@ -1,35 +0,0 @@
os: linux
env:
global:
- ZCTRAVIS_BOOST_OPTS="threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 address-model=64"
- ZCTRAVIS_BOOST_LIBRARIES="chrono,filesystem,program_options,system,thread,test"
- ZCTRAVIS_SNARK_FLAGS="-j2 CURVE=ALT_BN128 NO_PROCPS=1 NO_GTEST=1 NO_DOCS=1 STATIC=1"
- ZCTRAVIS_LIBZEROCASH_CXXFLAGS="-w -DCURVE_ALT_BN128 -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -std=c++11 -pipe -O2 -O0 -g -Wstack-protector -fstack-protector-all -fPIE -fvisibility=hidden -fPIC"
- ZCTRAVIS_LIBZEROCASH_FLAGS="-j2 NO_PROCPS=1 MINDEPS=1 LINK_RT=1"
before_install:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y # For g++-4.9
- sudo apt-get update -qq
- sudo apt-get install -qq g++-4.9
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 90
# Install dependencies
- sudo apt-get install cmake libgmp-dev libssl-dev
# We still need boost, let's get it.
- wget http://downloads.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.bz2
- echo "910c8c022a33ccec7f088bd65d4f14b466588dda94ba2124e78b8c57db264967 boost_1_57_0.tar.bz2" | sha256sum -c
- tar -xjf boost_*.tar.bz2
- cd boost_1_57_0
- ./bootstrap.sh --without-icu --with-libraries="$ZCTRAVIS_BOOST_LIBRARIES"
- ./b2 -d2 -j2 -d1 $ZCTRAVIS_BOOST_OPTS
- sudo ./b2 -d0 -j2 $ZCTRAVIS_BOOST_OPTS install
- cd ..
# We still need crypto++, let's get it.
- ./get-cryptopp
script:
- LIBSNARK_FLAGS="$ZCTRAVIS_SNARK_FLAGS" ./get-libsnark
- CXXFLAGS="$ZCTRAVIS_LIBZEROCASH_CXXFLAGS" make $ZCTRAVIS_LIBZEROCASH_FLAGS
# - ./zerocash_pour_ppzksnark/tests/test_zerocash_pour_ppzksnark
# - ./tests/merkleTest
# - ./tests/zerocashTest

View File

@ -36,8 +36,8 @@ using CryptoPP::PK_EncryptorFilter;
#include "PourOutput.h"
#include "libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/r1cs_ppzksnark.hpp"
#include "zerocash_pour_ppzksnark/zerocash_pour_gadget.hpp"
#include "zerocash_pour_ppzksnark/zerocash_pour_ppzksnark.hpp"
#include "zerocash_pour_gadget.hpp"
#include "zerocash_pour_ppzksnark.hpp"
namespace libzerocash {

View File

@ -59,6 +59,6 @@ namespace libzerocash {
using namespace libsnark;
};
#include "libzerocash/utils/util.h"
#include "zerocash/utils/util.h"
#endif /* ZEROCASH_H_ */

View File

@ -15,7 +15,7 @@
#include "Zerocash.h"
#include "libsnark/common/default_types/r1cs_ppzksnark_pp.hpp"
#include "libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/r1cs_ppzksnark.hpp"
#include "zerocash_pour_ppzksnark/zerocash_pour_ppzksnark.hpp"
#include "zerocash_pour_ppzksnark.hpp"
namespace libzerocash {

View File

@ -1,27 +0,0 @@
#!/bin/bash
# To pass parameters to the cryptopp makefile, use `CRYPTOPP_FLAGS=... ./get-cryptopp`
set -e
DEPSRC=./depsrc
DEPINST=./depinst
DUMMIES="cryptopp-dummy.exe"
set -x
mkdir -p $DEPINST
DEPINST=`pwd -P`/$DEPINST # remember absolute path
mkdir -p $DEPSRC
cd $DEPSRC
mkdir -p cryptopp562 && cd cryptopp562
if [ ! -f hmac.cpp ]; then
wget http://www.cryptopp.com/cryptopp562.zip
echo "5cbfd2fcb4a6b3aab35902e2e0f3b59d9171fee12b3fc2b363e1801dfec53574 cryptopp562.zip" | sha256sum -c
unzip cryptopp562.zip
fi
make static dynamic CXXFLAGS='-DNDEBUG -g -O2 -fPIC' $CRYPTOPP_FLAGS
touch $DUMMIES # kludge: cryptopp's "make install" breaks if there are no such files to install
make install PREFIX=$DEPINST/ $CRYPTOPP_FLAGS
rm -f $DUMMIES

View File

@ -1,39 +0,0 @@
#!/bin/bash
# To pass options options to libsnark Makefile, put them in env var LIBSNARK_FLAGS.
# To clone libsnark from an alternate location, set env var LIBSNARK_SRC. For example:
# LIBSNARK_SRC="$HOME/libsnark.git --branch master" ./get-libsnark
# To use curve ALT_BN128 instead of BN128 (which is x64-only), use:
# CURVE=ALT_BN128 ./get-libsnark
set -e
LIBSNARK_SRC=${LIBSNARK_SRC:-https://github.com/scipr-lab/libsnark}
CURVE=${CURVE:-BN128}
LIBSNARK_FLAGS="$LIBSNARK_FLAGS NO_SUPERCOP=1 NO_GTEST=1 NO_DOCS=1 CURVE=$CURVE"
if [[ `uname -s` == "Darwin" ]]; then
LIBSNARK_FLAGS="$LIBSNARK_FLAGS NO_PROCPS=1"
fi
set -x
DEPSRC=./depsrc
DEPINST=./depinst
mkdir -p $DEPINST
DEPINST=`pwd -P`/$DEPINST # remember absolute path
mkdir -p $DEPSRC
cd $DEPSRC
[ ! -d libsnark ] && git clone $LIBSNARK_SRC libsnark
cd libsnark
git pull
if [ "$CURVE" == "BN128" ]; then
# TODO: submit -fPIC patch to ate-pairing
INC_DIR=-fPIC ./prepare-depends.sh
fi
make clean
CXXFLAGS="-DNO_PT_COMPRESSION=1" make lib $LIBSNARK_FLAGS
make install PREFIX=$DEPINST $LIBSNARK_FLAGS

View File

@ -23,7 +23,7 @@
#ifndef ZEROCASH_POUR_GADGET_HPP_
#define ZEROCASH_POUR_GADGET_HPP_
#include "zerocash_pour_ppzksnark/zerocash_pour_params.hpp"
#include "zerocash_pour_params.hpp"
#include "libsnark/gadgetlib1/gadgets/hashes/sha256/sha256_gadget.hpp"
#include "libsnark/gadgetlib1/gadgets/merkle_tree/merkle_tree_check_read_gadget.hpp"
@ -183,6 +183,6 @@ r1cs_primary_input<FieldT> zerocash_pour_input_map(const size_t num_old_coins,
} // libzerocash
#include "zerocash_pour_ppzksnark/zerocash_pour_gadget.tcc"
#include "zerocash_pour_gadget.tcc"
#endif // ZEROCASH_POUR_GADGET_HPP_

View File

@ -227,6 +227,6 @@ bool zerocash_pour_ppzksnark_verifier(const zerocash_pour_verification_key<ppzks
} // libzerocash
#include "zerocash_pour_ppzksnark/zerocash_pour_ppzksnark.tcc"
#include "zerocash_pour_ppzksnark.tcc"
#endif // ZEROCASH_POUR_PPZKSNARK_HPP_

View File

@ -14,7 +14,7 @@
#ifndef ZEROCASH_POUR_PPZKSNARK_TCC_
#define ZEROCASH_POUR_PPZKSNARK_TCC_
#include "zerocash_pour_ppzksnark/zerocash_pour_gadget.hpp"
#include "zerocash_pour_gadget.hpp"
#include "common/profiling.hpp"
namespace libzerocash {