Auto merge of #3169 - ebfull:sapling-global-params, r=str4d

Import sapling global parameters

This will also test the API a bit by invoking the Pedersen hashes.

Part of #3053.
This commit is contained in:
Homu 2018-04-14 18:35:11 -07:00
commit 312f70091b
6 changed files with 35 additions and 3 deletions

View File

@ -728,7 +728,7 @@ AC_CHECK_LIB([gmp],[[__gmpn_sub_n]],GMP_LIBS=-lgmp, [AC_MSG_ERROR(libgmp missing
AC_CHECK_HEADER([gmpxx.h],,AC_MSG_ERROR(libgmpxx headers missing))
AC_CHECK_LIB([gmpxx],[main],GMPXX_LIBS=-lgmpxx, [AC_MSG_ERROR(libgmpxx missing)])
RUST_LIBS="-lrustzcash"
RUST_LIBS="-lrustzcash -ldl"
dnl Check for OpenMP support
AX_OPENMP(

View File

@ -0,0 +1,15 @@
package=crate_lazy_static
$(package)_crate_name=lazy_static
$(package)_version=1.0.0
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
$(package)_sha256_hash=c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d
$(package)_crate_versioned_name=$($(package)_crate_name)
define $(package)_preprocess_cmds
$(call generate_crate_checksum,$(package))
endef
define $(package)_stage_cmds
$(call vendor_crate_source,$(package))
endef

View File

@ -3,8 +3,8 @@ $(package)_version=0.1
$(package)_download_path=https://github.com/zcash/$(package)/archive/
$(package)_file_name=$(package)-$($(package)_git_commit).tar.gz
$(package)_download_file=$($(package)_git_commit).tar.gz
$(package)_sha256_hash=c59d37870bf293b64c97de8991ebd2efe4e63282c5dc6d05df5a3a88e7b7b169
$(package)_git_commit=7dc69c6893032142e353ece69420c72b4055b378
$(package)_sha256_hash=a6554609ac0cbcc99ad33513a8203bec4ec1c64fa25b4be515377ccf2e0afcd7
$(package)_git_commit=2a86c912f6ec32ae62c4403c214b2a93a5fcb61e
$(package)_dependencies=rust $(rust_crates)
$(package)_patches=cargo.config

View File

@ -13,6 +13,7 @@ rust_crates := \
crate_futures_cpupool \
crate_futures \
crate_generic_array \
crate_lazy_static \
crate_libc \
crate_nodrop \
crate_num_cpus \

View File

@ -40,6 +40,7 @@ zcash_gtest_SOURCES += \
gtest/test_libzcash_utils.cpp \
gtest/test_proofs.cpp \
gtest/test_paymentdisclosure.cpp \
gtest/test_pedersen_hash.cpp \
gtest/test_checkblock.cpp
if ENABLE_WALLET
zcash_gtest_SOURCES += \

View File

@ -0,0 +1,15 @@
#include <gtest/gtest.h>
#include "librustzcash.h"
#include "uint256.h"
TEST(PedersenHash, TestAPI) {
const uint256 a = uint256S("0acaa62d40fcdd9192ed35ea9df31660ccf7f6c60566530faaa444fb5d0d410e");
const uint256 b = uint256S("6041357de59ba64959d1b60f93de24dfe5ea1e26ed9e8a73d35b225a1845ba70");
uint256 result;
librustzcash_merkle_hash(25, a.begin(), b.begin(), result.begin());
uint256 expected_result = uint256S("4253b36834b3f64cc6182f1816911e1c9460cb88afeafb155244dd0038ad4717");
ASSERT_TRUE(result == expected_result);
}