A bunch more libsnark deletions/updates

This commit is contained in:
Duke Leto
2020-01-24 06:32:13 -05:00
parent 7e078e58c1
commit 4d965f53eb
28 changed files with 847 additions and 2560 deletions

View File

@@ -57,14 +57,9 @@ public:
template<size_t Depth, typename Hash>
class EmptyMerkleRoots {
public:
EmptyMerkleRoots() {
empty_roots.at(0) = Hash::uncommitted();
for (size_t d = 1; d <= Depth; d++) {
empty_roots.at(d) = Hash::combine(empty_roots.at(d-1), empty_roots.at(d-1), d-1);
}
}
Hash empty_root(size_t depth) {
return empty_roots.at(depth);
EmptyMerkleRoots() { }
Hash empty_root(size_t depth) const {
return Hash::EmptyRoot(depth);
}
template <size_t D, typename H>
friend bool operator==(const EmptyMerkleRoots<D, H>& a,
@@ -227,6 +222,7 @@ public:
static SHA256Compress uncommitted() {
return SHA256Compress();
}
static SHA256Compress EmptyRoot(size_t);
};
class PedersenHash : public uint256 {
@@ -241,6 +237,7 @@ public:
);
static PedersenHash uncommitted();
static PedersenHash EmptyRoot(size_t);
};
template<size_t Depth, typename Hash>