Skip to content

Commit

Permalink
Merge 43cfd7a into 7443d36
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Dec 9, 2018
2 parents 7443d36 + 43cfd7a commit 6a108f0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
2 changes: 0 additions & 2 deletions include/bitcoin/bitcoin/math/ec_scalar.hpp
Expand Up @@ -32,7 +32,6 @@ class BC_API ec_scalar
/// Constructors.
ec_scalar();
ec_scalar(const ec_secret& secret);
ec_scalar(uint64_t value);

/// Operators.
// TODO: add equality and inequality operators.
Expand All @@ -50,7 +49,6 @@ class BC_API ec_scalar

/// Accessors.
const ec_secret& secret() const;
ec_secret& secret();

protected:
// These should be const, apart from the need to implement assignment.
Expand Down
12 changes: 0 additions & 12 deletions src/math/ec_scalar.cpp
Expand Up @@ -38,14 +38,6 @@ ec_scalar::ec_scalar(const ec_secret& secret)
{
}

ec_scalar::ec_scalar(uint64_t value)
: valid_(true)
{
secret_ = null_hash;
auto serial = make_unsafe_serializer(secret_.end() - 8);
serial.write_8_bytes_big_endian(value);
}

// Operators.
// ----------------------------------------------------------------------------

Expand Down Expand Up @@ -136,9 +128,5 @@ const ec_secret& ec_scalar::secret() const
{
return secret_;
}
ec_secret& ec_scalar::secret()
{
return secret_;
}

} // namespace libbitcoin
17 changes: 0 additions & 17 deletions test/math/ec_scalar.cpp
Expand Up @@ -88,21 +88,4 @@ BOOST_AUTO_TEST_CASE(ec_arithmetic__point__multiply_g__expected)
BOOST_REQUIRE_EQUAL(encode_base16(product.point()), COMPRESSED2);
}

BOOST_AUTO_TEST_CASE(ec_scalar__init__expected)
{
const ec_scalar one{ base16_literal(POSITIVE_ONE) };
const ec_scalar two{ base16_literal(POSITIVE_TWO) };
BOOST_REQUIRE(one);
BOOST_REQUIRE(two);

const ec_scalar one_uint64(1);
const ec_scalar two_uint64(2);
BOOST_REQUIRE(one_uint64);
BOOST_REQUIRE(two_uint64);
BOOST_REQUIRE_EQUAL(encode_base16(
one.secret()), encode_base16(one_uint64.secret()));
BOOST_REQUIRE_EQUAL(encode_base16(
two.secret()), encode_base16(two_uint64.secret()));
}

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit 6a108f0

Please sign in to comment.