#include <sortition.hpp>
|
| | VdfSortition ()=default |
| |
| | VdfSortition (SortitionParams const &config, vrf_sk_t const &sk, bytes const &vrf_input, uint64_t vote_count, uint64_t total_vote_count) |
| |
| | VdfSortition (bytes const &b) |
| |
| | VdfSortition (Json::Value const &json) |
| |
| void | computeVdfSolution (const SortitionParams &config, const bytes &msg, const std::atomic_bool &cancelled) |
| |
| void | verifyVdf (SortitionParams const &config, bytes const &vrf_input, const vrf_pk_t &pk, bytes const &vdf_input, uint64_t vote_count, uint64_t total_vote_count) const |
| |
| bytes | rlp () const |
| |
| bool | operator== (VdfSortition const &other) const |
| |
| bool | operator!= (VdfSortition const &other) const |
| |
| virtual std::ostream & | print (std::ostream &strm) const override |
| |
| auto | getComputationTime () const |
| |
| uint16_t | getDifficulty () const |
| |
| uint16_t | calculateDifficulty (SortitionParams const &config) const |
| |
| bool | isStale (SortitionParams const &config) const |
| |
| Json::Value | getJson () const |
| |
| | VrfSortitionBase ()=default |
| |
| | VrfSortitionBase (vrf_sk_t const &sk, bytes const &msg, uint16_t vote_count=1) |
| |
| bool | verify (const vrf_pk_t &pk, const bytes &msg, uint16_t vote_count=1, bool strict=true) const |
| |
| bool | operator== (VrfSortitionBase const &other) const |
| |
◆ VdfSortition() [1/4]
| taraxa::vdf_sortition::VdfSortition::VdfSortition |
( |
| ) |
|
|
default |
◆ VdfSortition() [2/4]
| taraxa::vdf_sortition::VdfSortition::VdfSortition |
( |
SortitionParams const & |
config, |
|
|
vrf_sk_t const & |
sk, |
|
|
bytes const & |
vrf_input, |
|
|
uint64_t |
vote_count, |
|
|
uint64_t |
total_vote_count |
|
) |
| |
|
explicit |
◆ VdfSortition() [3/4]
| taraxa::vdf_sortition::VdfSortition::VdfSortition |
( |
bytes const & |
b | ) |
|
|
explicit |
◆ VdfSortition() [4/4]
| taraxa::vdf_sortition::VdfSortition::VdfSortition |
( |
Json::Value const & |
json | ) |
|
|
explicit |
◆ calculateDifficulty()
| uint16_t taraxa::vdf_sortition::VdfSortition::calculateDifficulty |
( |
SortitionParams const & |
config | ) |
const |
◆ computeVdfSolution()
| void taraxa::vdf_sortition::VdfSortition::computeVdfSolution |
( |
const SortitionParams & |
config, |
|
|
const bytes & |
msg, |
|
|
const std::atomic_bool & |
cancelled |
|
) |
| |
◆ getComputationTime()
| auto taraxa::vdf_sortition::VdfSortition::getComputationTime |
( |
| ) |
const |
|
inline |
◆ getDifficulty()
| uint16_t taraxa::vdf_sortition::VdfSortition::getDifficulty |
( |
| ) |
const |
◆ getJson()
| Json::Value taraxa::vdf_sortition::VdfSortition::getJson |
( |
| ) |
const |
◆ isStale()
| bool taraxa::vdf_sortition::VdfSortition::isStale |
( |
SortitionParams const & |
config | ) |
const |
◆ operator!=()
| bool taraxa::vdf_sortition::VdfSortition::operator!= |
( |
VdfSortition const & |
other | ) |
const |
|
inline |
◆ operator==()
| bool taraxa::vdf_sortition::VdfSortition::operator== |
( |
VdfSortition const & |
other | ) |
const |
|
inline |
◆ print()
| virtual std::ostream & taraxa::vdf_sortition::VdfSortition::print |
( |
std::ostream & |
strm | ) |
const |
|
inlineoverridevirtual |
◆ rlp()
| bytes taraxa::vdf_sortition::VdfSortition::rlp |
( |
| ) |
const |
◆ verifyVdf()
| void taraxa::vdf_sortition::VdfSortition::verifyVdf |
( |
SortitionParams const & |
config, |
|
|
bytes const & |
vrf_input, |
|
|
const vrf_pk_t & |
pk, |
|
|
bytes const & |
vdf_input, |
|
|
uint64_t |
vote_count, |
|
|
uint64_t |
total_vote_count |
|
) |
| const |
◆ verifyVrf()
| bool taraxa::vdf_sortition::VdfSortition::verifyVrf |
( |
const vrf_pk_t & |
pk, |
|
|
const bytes & |
vrf_input, |
|
|
uint16_t |
vote_count |
|
) |
| const |
|
private |
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & |
strm, |
|
|
VdfSortition const & |
vdf |
|
) |
| |
|
friend |
◆ difficulty_
| uint16_t taraxa::vdf_sortition::VdfSortition::difficulty_ = 0 |
|
private |
◆ kThresholdCorrection
| const uint32_t taraxa::vdf_sortition::VdfSortition::kThresholdCorrection = 10 |
|
staticprivate |
◆ kVotesProportion
| const uint32_t taraxa::vdf_sortition::VdfSortition::kVotesProportion = 1000 |
|
staticprivate |
Initial value:
"3d1055a514e17cce1290ccb5befb256b00b8aac664e39e754466fcd631004c9e23d16f23"
"9aee2a207e5173a7ee8f90ee9ab9b6a745d27c6e850e7ca7332388dfef7e5bbe6267d1f7"
"9f9330e44715b3f2066f903081836c1c83ca29126f8fdc5f5922bf3f9ddb4540171691ac"
"cc1ef6a34b2a804a18159c89c39b16edee2ede35")
bytes asBytes(std::string const &_b)
Converts a string to a byte array containing the string's (byte) data.
Definition CommonData.h:87
◆ vdf_computation_time_
| unsigned long taraxa::vdf_sortition::VdfSortition::vdf_computation_time_ = 0 |
|
private |
◆ vdf_sol_
| std::pair<bytes, bytes> taraxa::vdf_sortition::VdfSortition::vdf_sol_ |
|
private |
The documentation for this class was generated from the following files: