// Copyright (c) 2016 Jack Grigg // Copyright (c) 2016 The Zcash developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include #include // Checks if the intersection of a.indices and b.indices is empty template bool DistinctIndices(const FullStepRow& a, const FullStepRow& b, size_t len, size_t lenIndices) { std::vector aSrt = a.GetIndices(len, lenIndices); std::vector bSrt = b.GetIndices(len, lenIndices); for(auto const& value1: aSrt) { for(auto const& value2: bSrt) { if (value1==value2) { return false; } } } return true; } template bool IsValidBranch(const FullStepRow& a, const size_t len, const unsigned int ilen, const eh_trunc t) { return TruncateIndex(ArrayToEhIndex(a.hash+len), ilen) == t; }