Change librustzcash dependency hash to work for new Sapling classes

This commit is contained in:
Jay Graber 2018-05-17 06:13:52 -07:00
parent 11acfe6e9f
commit 84e3a2212f
3 changed files with 13 additions and 9 deletions

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=1fb331a92b63da41e95ef9db671982d243a13bcd6d25570760c9ca83b8996887
$(package)_git_commit=36d7acf3f37570f499fc8fe79fda372e5eb873ca
$(package)_sha256_hash=ed8de6f820f4441a80457a25db022168df09ca945302d27004975b0d71c32718
$(package)_git_commit=0ef61e6d460e49e70202f8599bbdb2d39e41d061
$(package)_dependencies=rust $(rust_crates)
$(package)_patches=cargo.config

View File

@ -8,7 +8,7 @@
const unsigned char ZCASH_EXPANDSEED_PERSONALIZATION[crypto_generichash_blake2b_PERSONALBYTES] = {'Z','c','a','s','h','_','E','x','p','a','n','d','S','e','e','d'};
// Sapling
std::array<unsigned char, 64> PRF_expand(const uint256& x, unsigned char t)
std::array<unsigned char, 64> PRF_expand(const uint256& sk, unsigned char t)
{
std::array<unsigned char, 64> res;
unsigned char blob[33];
@ -65,6 +65,8 @@ std::array<unsigned char, 11> default_diversifier(const uint256& sk)
if (librustzcash_check_diversifier(res.data())) {
break;
} else if (blob[33] > 255) {
throw std::runtime_error("librustzcash_check_diversifier did not return valid diversifier");
}
blob[33] += 1;
}

View File

@ -11,16 +11,18 @@ within the zkSNARK circuit.
#include <array>
uint256 PRF_ask(const uint256& sk);
uint256 PRF_nsk(const uint256& sk);
uint256 PRF_ovk(const uint256& sk);
std::array<unsigned char, 11> default_diversifier(const uint256& sk);
//! Sprout functions
uint256 PRF_addr_a_pk(const uint252& a_sk);
uint256 PRF_addr_sk_enc(const uint252& a_sk);
uint256 PRF_nf(const uint252& a_sk, const uint256& rho);
uint256 PRF_pk(const uint252& a_sk, size_t i0, const uint256& h_sig);
uint256 PRF_rho(const uint252& phi, size_t i0, const uint256& h_sig);
//! Sapling functions
uint256 PRF_ask(const uint256& sk);
uint256 PRF_nsk(const uint256& sk);
uint256 PRF_ovk(const uint256& sk);
std::array<unsigned char, 11> default_diversifier(const uint256& sk);
#endif // ZC_PRF_H_