crypto: remove slight bias in key generation due to modulo

This commit is contained in:
moneromooo-monero 2018-07-04 22:17:20 +01:00
parent eed4dba880
commit 61caab8a8c
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
5 changed files with 77 additions and 10 deletions

View file

@ -99,6 +99,7 @@ namespace crypto {
#pragma pack(pop)
void hash_to_scalar(const void *data, size_t length, ec_scalar &res);
void random32_unbiased(unsigned char *bytes);
static_assert(sizeof(ec_point) == 32 && sizeof(ec_scalar) == 32 &&
sizeof(public_key) == 32 && sizeof(secret_key) == 32 &&