Add Rust CLSAG verification

Marked experimental, not guaranteed to match Monero yet
This commit is contained in:
Luke Parker
2022-05-13 20:26:29 -04:00
parent bb840da44d
commit 3533e66c7f
6 changed files with 181 additions and 95 deletions

View File

@@ -53,7 +53,7 @@ extern "C" {
try { return rct::bulletproof_VERIFY(bp); } catch(...) { return false; }
}
bool c_verify_clsag(uint s_len, uint8_t* s, uint8_t* I, uint8_t k_len, uint8_t* k, uint8_t* p, uint8_t* m) {
bool c_verify_clsag(uint s_len, uint8_t* s, uint8_t k_len, uint8_t* k, uint8_t* I, uint8_t* p, uint8_t* m) {
rct::clsag clsag;
std::stringstream ss;
std::string str;
@@ -64,7 +64,6 @@ extern "C" {
if (!ss.good()) {
return false;
}
memcpy(clsag.I.bytes, I, 32);
rct::ctkeyV keys;
keys.resize(k_len);
@@ -73,6 +72,8 @@ extern "C" {
memcpy(keys[i].mask.bytes, &k[((i * 2) + 1) * 32], 32);
}
memcpy(clsag.I.bytes, I, 32);
rct::key pseudo_out;
memcpy(pseudo_out.bytes, p, 32);