[ripple/rippled] Allow ed25519 node and validator keys (#2647)

scottschurr commented on this pull request.

> bool
RCLCxPeerPos::checkSign() const
— return verifyDigest(
— publicKey(), signingHash(), signature(), false);
+ return verify(

It looks like, as a result of this change, the `verifyDigest()` free function no longer needs to be public. It can be an implementation detail of the `PublicKey.cpp` file. So I suggest removing the declaration of `verifyDigest()` from `PublicKey.h` and make the implementation of `verifyDigest()` in `PublicKey.cpp` `static`.

You’ll need to fix up `SecretKey_test.cpp` if you choose to make this change.

> @@ -189,14 +189,8 @@ RCLConsensus::Adaptor::propose(RCLCxPeerPos::Proposal const& proposal)

prop.set_nodepubkey(valPublic_.data(), valPublic_.size());

— auto signingHash = sha512Half(
— HashPrefix::proposal,
— std::uint32_t(proposal.proposeSeq()),
— proposal.closeTime().time_since_epoch().count(),
— proposal.prevLedger(),
— proposal.position());

— auto sig = signDigest(valPublic_, valSecret_, signingHash);

As a consequence of this change the two `SignDigest()` free functions in the code base are no longer used. Their declarations can be removed from `SecretKey.h` and the implementation can be removed from `SecretKey.cpp`.

If you choose to make this change you’ll need to fix up `SecretKey_test.cpp`.

Добавить комментарий