Browse Source

use boost_throw_exception

cl-refactor
subtly 10 years ago
parent
commit
5eacc23cb1
  1. 2
      libdevcrypto/Common.cpp
  2. 4
      libdevcrypto/EC.cpp

2
libdevcrypto/Common.cpp

@ -130,7 +130,7 @@ h256 Nonce::get(bool _commit)
s_seed[i] = (byte)d(s_eng);
}
if (!s_seed)
throw InvalidState();
BOOST_THROW_EXCEPTION(InvalidState());
// prevent seed reuse if process terminates abnormally
writeFile(s_seedFile, bytes());

4
libdevcrypto/EC.cpp

@ -51,7 +51,7 @@ h256 crypto::kdf(Secret const& _priv, h256 const& _hash)
sha3(s.ref(), s.ref());
if (!s || !_hash || !_priv)
throw InvalidState();
BOOST_THROW_EXCEPTION(InvalidState());
return std::move(s);
}
@ -102,7 +102,7 @@ Signature crypto::sign(Secret const& _key, h256 const& _hash)
Integer k(kdf(_key, _hash).data(), 32);
if (k == 0)
throw InvalidState();
BOOST_THROW_EXCEPTION(InvalidState());
k = 1 + (k % (qs - 1));
ECP::Point rp = secp256k1Params.ExponentiateBase(k);

Loading…
Cancel
Save