Fixing an asan issue.
This commit is contained in:
parent
961600d5c7
commit
22890960bb
6 changed files with 3 additions and 49 deletions
1
asan_blacklist
Normal file
1
asan_blacklist
Normal file
|
|
@ -0,0 +1 @@
|
|||
src:*ed25519*
|
||||
|
|
@ -13,7 +13,7 @@ namespace
|
|||
{
|
||||
bool constexpr ledger_logging ()
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
bool constexpr ledger_duplicate_logging ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -650,43 +650,6 @@ bool rai::uint512_union::decode_hex (std::string const & text)
|
|||
return result;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
uint32_t R (uint32_t value_a, unsigned amount_a)
|
||||
{
|
||||
return (value_a << amount_a) | (value_a >> (32 - amount_a));
|
||||
}
|
||||
}
|
||||
|
||||
rai::uint512_union rai::uint512_union::salsa20_8 ()
|
||||
{
|
||||
rai::uint512_union result;
|
||||
auto & x (result.dwords);
|
||||
auto & in (dwords);
|
||||
int i;
|
||||
for (i = 0;i < 16;++i) x[i] = in[i];
|
||||
for (i = 8;i > 0;i -= 2) {
|
||||
x[ 4] ^= R(x[ 0]+x[12], 7); x[ 8] ^= R(x[ 4]+x[ 0], 9);
|
||||
x[12] ^= R(x[ 8]+x[ 4],13); x[ 0] ^= R(x[12]+x[ 8],18);
|
||||
x[ 9] ^= R(x[ 5]+x[ 1], 7); x[13] ^= R(x[ 9]+x[ 5], 9);
|
||||
x[ 1] ^= R(x[13]+x[ 9],13); x[ 5] ^= R(x[ 1]+x[13],18);
|
||||
x[14] ^= R(x[10]+x[ 6], 7); x[ 2] ^= R(x[14]+x[10], 9);
|
||||
x[ 6] ^= R(x[ 2]+x[14],13); x[10] ^= R(x[ 6]+x[ 2],18);
|
||||
x[ 3] ^= R(x[15]+x[11], 7); x[ 7] ^= R(x[ 3]+x[15], 9);
|
||||
x[11] ^= R(x[ 7]+x[ 3],13); x[15] ^= R(x[11]+x[ 7],18);
|
||||
x[ 1] ^= R(x[ 0]+x[ 3], 7); x[ 2] ^= R(x[ 1]+x[ 0], 9);
|
||||
x[ 3] ^= R(x[ 2]+x[ 1],13); x[ 0] ^= R(x[ 3]+x[ 2],18);
|
||||
x[ 6] ^= R(x[ 5]+x[ 4], 7); x[ 7] ^= R(x[ 6]+x[ 5], 9);
|
||||
x[ 4] ^= R(x[ 7]+x[ 6],13); x[ 5] ^= R(x[ 4]+x[ 7],18);
|
||||
x[11] ^= R(x[10]+x[ 9], 7); x[ 8] ^= R(x[11]+x[10], 9);
|
||||
x[ 9] ^= R(x[ 8]+x[11],13); x[10] ^= R(x[ 9]+x[ 8],18);
|
||||
x[12] ^= R(x[15]+x[14], 7); x[13] ^= R(x[12]+x[15], 9);
|
||||
x[14] ^= R(x[13]+x[12],13); x[15] ^= R(x[14]+x[13],18);
|
||||
}
|
||||
for (i = 0;i < 16;++i) x[i] += in[i];
|
||||
return result;
|
||||
}
|
||||
|
||||
bool rai::uint512_union::operator != (rai::uint512_union const & other_a) const
|
||||
{
|
||||
return ! (*this == other_a);
|
||||
|
|
|
|||
|
|
@ -100,7 +100,6 @@ namespace rai
|
|||
rai::uint512_union & operator ^= (rai::uint512_union const &);
|
||||
void encode_hex (std::string &);
|
||||
bool decode_hex (std::string const &);
|
||||
rai::uint512_union salsa20_8 ();
|
||||
std::array <uint8_t, 64> bytes;
|
||||
std::array <uint32_t, 16> dwords;
|
||||
std::array <uint64_t, 8> qwords;
|
||||
|
|
|
|||
|
|
@ -420,15 +420,6 @@ TEST (frontier_req, serialization)
|
|||
ASSERT_EQ (request1, request2);
|
||||
}
|
||||
|
||||
TEST (salsa20_8, one)
|
||||
{
|
||||
rai::uint512_union value;
|
||||
value.clear ();
|
||||
value.bytes [0] = 1;
|
||||
auto result (value.salsa20_8 ());
|
||||
ASSERT_NE (value, result);
|
||||
}
|
||||
|
||||
TEST (work, one)
|
||||
{
|
||||
rai::work work;
|
||||
|
|
|
|||
|
|
@ -1073,7 +1073,7 @@ TEST (bulk, offline_send)
|
|||
client1->wallet.insert (key2.prv);
|
||||
ASSERT_FALSE (system.clients [0]->transactions.send (key2.pub, 100));
|
||||
ASSERT_NE (std::numeric_limits <rai::uint256_t>::max (), system.clients [0]->ledger.account_balance (rai::test_genesis_key.pub));
|
||||
bool finished;
|
||||
bool finished (false);
|
||||
client1->processor.bootstrap (system.clients [0]->bootstrap.endpoint (), [&finished] () {finished = true;});
|
||||
do
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue