-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
…hat zcash can interact with nicer. This is obviously only a step in the right direction.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** @file | ||
***************************************************************************** | ||
Implementation of interfaces for the class PourProver. | ||
***************************************************************************** | ||
* @author This file is part of libzerocash, developed by the Zerocash | ||
* project and contributors (see AUTHORS). | ||
* @copyright MIT license (see LICENSE file) | ||
*****************************************************************************/ | ||
|
||
#include "PourProver.h" | ||
This comment has been minimized.
Sorry, something went wrong. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** @file | ||
***************************************************************************** | ||
Declaration of interfaces for the class PourProver. | ||
***************************************************************************** | ||
* @author This file is part of libzerocash, developed by the Zerocash | ||
* project and contributors (see AUTHORS). | ||
* @copyright MIT license (see LICENSE file) | ||
*****************************************************************************/ | ||
|
||
#ifndef POURPROVER_H_ | ||
#define POURPROVER_H_ | ||
|
||
#include "ZerocashParams.h" | ||
#include "boost/array.hpp" | ||
#include "PourTransaction.h" | ||
#include "CoinCommitment.h" | ||
|
||
namespace libzerocash { | ||
|
||
class PourProver { | ||
public: | ||
static bool VerifyProof( | ||
ZerocashParams& params, | ||
const std::vector<unsigned char>& pubkeyHash, | ||
const std::vector<unsigned char>& rt, | ||
const uint64_t vpub_old, | ||
const uint64_t vpub_new, | ||
This comment has been minimized.
Sorry, something went wrong.
nathan-at-least
|
||
const boost::array<std::vector<unsigned char>, 2> serials, | ||
const boost::array<std::vector<unsigned char>, 2> commitments, | ||
const boost::array<std::vector<unsigned char>, 2> macs, | ||
This comment has been minimized.
Sorry, something went wrong. |
||
const std::string &zkSNARK | ||
) { | ||
PourTransaction pourtx; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ebfull
Author
|
||
|
||
pourtx.version = 1; | ||
pourtx.publicOldValue.resize(8); | ||
pourtx.publicNewValue.resize(8); | ||
convertIntToBytesVector(vpub_old, pourtx.publicOldValue); | ||
convertIntToBytesVector(vpub_new, pourtx.publicNewValue); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
pourtx.serialNumber_1 = serials[0]; | ||
pourtx.serialNumber_2 = serials[1]; | ||
{ | ||
CoinCommitment cm; | ||
cm.commitmentValue = commitments[0]; | ||
pourtx.cm_1 = cm; | ||
} | ||
{ | ||
CoinCommitment cm; | ||
cm.commitmentValue = commitments[1]; | ||
pourtx.cm_2 = cm; | ||
} | ||
pourtx.MAC_1 = macs[0]; | ||
pourtx.MAC_2 = macs[1]; | ||
pourtx.zkSNARK = zkSNARK; | ||
|
||
return pourtx.verify(params, pubkeyHash, rt); | ||
} | ||
}; | ||
|
||
|
||
} | ||
|
||
#endif /* POURPROVER_H_ */ |
1 comment
on commit e79cd2d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except for whitespace and renaming 2's to named constants.
"New newline at end of file."