This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bitcoin/bitcoin.hpp> | |
using namespace bc; | |
class ec_scalar | |
{ | |
public: | |
ec_scalar(); | |
ec_scalar(uint64_t value); | |
void reset(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Pure Python Borromean Ring Signatures | |
DEPENDS ON: pip install ecdsa | |
WARNING: THIS IS A PEDAGOGICAL IMPLEMENTATION. | |
PERFORMANCE IS HORRIBLE AND NON-CONSTANT. | |
CORNER CASES ARE NOT PROPERLY CHECKED. | |
FOR THE LOVE OF GOD USE THE CODE FROM THE ELEMENTS PROJECT. | |
https://gist.github.com/badmofo/2d6e66630e4a6748edb7 | |
''' | |
from hashlib import sha256 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() | |
{ | |
// Generate new random secret keys | |
bc::secret_list secrets; | |
for (size_t i = 0; i < 8; ++i) | |
secrets.push_back(new_key()); | |
// Create two rings from the first 4 and last 4 keys | |
auto ring0 = extract_public_keys( | |
secrets.begin(), secrets.begin() + 4); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef std::vector<point_list> key_rings; | |
typedef std::vector<ec_secret> secret_list; | |
typedef std::vector<secret_list> s_values_type; | |
struct ring_signature | |
{ | |
ec_secret e; | |
s_value_type s; | |
}; |
NewerOlder