Browse Source

replace go counter logic. remove dead test code.

cl-refactor
subtly 10 years ago
parent
commit
7d1de2b402
  1. 8
      libdevcrypto/CryptoPP.cpp
  2. 1
      test/rlpx.cpp

8
libdevcrypto/CryptoPP.cpp

@ -55,14 +55,8 @@ bytes Secp256k1::eciesKDF(Secret _z, bytes _s1, unsigned kdByteLen)
k.reserve(k.size() + h256::size);
move(digest.begin(), digest.end(), back_inserter(k));
if (ctr[3]++ && ctr[3] != 0)
if (++ctr[3] || ++ctr[2] || ++ctr[1] || ++ctr[0])
continue;
else if (ctr[2]++ && ctr[2] != 0)
continue;
else if (ctr[1]++ && ctr[1] != 0)
continue;
else
ctr[0]++;
}
k.resize(kdByteLen);

1
test/rlpx.cpp

@ -363,7 +363,6 @@ BOOST_AUTO_TEST_CASE(test_secrets_from_go)
// test decrypt of frame headers for recvHello
bytes plaintext(16);
m_frameDec.ProcessData(plaintext.data(), recvHello.data(), h128::size);
cout << "decrypt recv got: " << *(h128*)plaintext.data();
}

Loading…
Cancel
Save