Integrate Groth16 verification and proving.

This commit is contained in:
Sean Bowe
2018-05-08 19:56:34 -06:00
parent dd72b5346e
commit b7a6c32178
14 changed files with 154 additions and 53 deletions

View File

@@ -15,6 +15,14 @@
namespace libzcash {
static constexpr size_t GROTH_PROOF_SIZE = (
48 + // π_A
96 + // π_B
48); // π_C
typedef boost::array<unsigned char, GROTH_PROOF_SIZE> GrothProof;
typedef boost::variant<ZCProof, GrothProof> SproutProof;
class JSInput {
public:
ZCIncrementalWitness witness;
@@ -59,7 +67,8 @@ public:
const uint256& pubKeyHash
);
virtual ZCProof prove(
virtual SproutProof prove(
bool makeGrothProof,
const boost::array<JSInput, NumInputs>& inputs,
const boost::array<JSOutput, NumOutputs>& outputs,
boost::array<SproutNote, NumOutputs>& out_notes,