zkSNARK: Enforce disclosure of commitments to output notes.

This commit is contained in:
Sean Bowe
2016-05-04 18:26:02 -06:00
parent 6b010d9bfd
commit 5e61a78fec
5 changed files with 148 additions and 3 deletions

View File

@@ -1,3 +1,14 @@
template<typename FieldT>
pb_variable_array<FieldT> from_bits(std::vector<bool> bits, pb_variable<FieldT>& ZERO) {
pb_variable_array<FieldT> acc;
BOOST_FOREACH(bool bit, bits) {
acc.emplace_back(bit ? ONE : ZERO);
}
return acc;
}
std::vector<bool> trailing252(std::vector<bool> input) {
if (input.size() != 256) {
throw std::length_error("trailing252 input invalid length");