Introduced consensus round nonce and reintroduced stage 0. (#160)

* Reintroduced stage 0.
* Introduced round nonce for reduced lcl predictability.
This commit is contained in:
Ravin Perera
2020-11-23 23:00:13 +05:30
committed by GitHub
parent 9c1f62dbde
commit 86e2e1211c
10 changed files with 120 additions and 52 deletions

View File

@@ -131,6 +131,15 @@ namespace crypto
decoded_pubkey + 1); // +1 to skip prefix byte.
}
/**
* Generate random bytes of specified length.
*/
void random_bytes(std::string &result, const size_t len)
{
result.resize(len);
randombytes_buf(result.data(), len);
}
/**
* Generate blake3 hash for a given message.
* @param data String to hash.