1
0
Fork 0
forked from lthn/blockchain

crypto: linear composition proof stub

This commit is contained in:
sowle 2023-02-21 01:37:42 +01:00
parent b733e5561a
commit 4ae6616a2b
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 40 additions and 1 deletions

View file

@ -1,4 +1,4 @@
// Copyright (c) 2014-2022 Zano Project
// Copyright (c) 2014-2023 Zano Project
// Copyright (c) 2014-2018 The Louisdor Project
// Copyright (c) 2012-2013 The Cryptonote developers
// Distributed under the MIT/X11 software license, see the accompanying
@ -152,6 +152,21 @@ namespace crypto
END_BOOST_SERIALIZATION()
};
struct linear_composition_proof_s : public linear_composition_proof
{
BEGIN_SERIALIZE_OBJECT()
FIELD(c)
FIELD(y0)
FIELD(y1)
END_SERIALIZE()
BEGIN_BOOST_SERIALIZATION()
BOOST_SERIALIZE(c)
BOOST_SERIALIZE(y0)
BOOST_SERIALIZE(y1)
END_BOOST_SERIALIZATION()
};
} // namespace crypto

View file

@ -56,6 +56,30 @@ namespace crypto
const zarcanum_proof& sig, uint8_t* p_err = nullptr);
// TODO @#@#: make sure it is used, implement, then move it to an appropriate place
struct linear_composition_proof
{
scalar_t c;
scalar_t y0;
scalar_t y1;
};
enum generator_tag { generator_tag_void = 0, generator_tag_G = 1, generator_tag_H = 2, generator_tag_H2 = 3, generator_tag_X = 4, generator_tag_U = 5 };
template<generator_tag gen0 = generator_tag_H, generator_tag gen1 = generator_tag_G>
bool generate_linear_composition_proof(const hash& m, const public_key& A, const scalar_t& secret_a, const scalar_t& secret_b, linear_composition_proof& result, uint8_t* p_err = nullptr)
{
// consider embedding generators' tags into random entropy to distinguish proofs made with different generators during verification
return false;
}
template<generator_tag gen0 = generator_tag_H, generator_tag gen1 = generator_tag_G>
bool verify_linear_composition_proof(const hash& m, const public_key& A, const linear_composition_proof& sig, uint8_t* p_err = nullptr)
{
return false;
}
// TODO: improve this proof using random weightning factor
struct vector_UG_aggregation_proof