Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash x #1097

Closed
wants to merge 12 commits into from
Closed

Hash x #1097

wants to merge 12 commits into from

Conversation

vogel
Copy link
Contributor

@vogel vogel commented Nov 23, 2016

Fixes #846

Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
@@ -0,0 +1,92 @@
// Copyright 2016 Stellar Development Foundation and contributors. Licensed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's talk about this.

auto &hashXKeyWeights = signers[SIGNER_KEY_TYPE_HASH_X];
for (size_t i = 0; i < mSignatures.size(); i++)
{
auto x = std::string{mSignatures[i].signature.begin(), mSignatures[i].signature.end()};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the preimage a string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using just mSignatures[i].signature now

@@ -327,16 +328,13 @@ PubKeyUtils::verifySig(PublicKey const& key, Signature const& signature,
SignatureHint
PubKeyUtils::getHint(PublicKey const& pk)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just have people call SignatureUtils::getHint directly if you want to move this function there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

SignatureHint res;
memcpy(res.data(), &pk.ed25519().back() - res.size() + 1, res.size());
return res;
return SignatureUtils::getHint(pk.ed25519());
}

bool
PubKeyUtils::hasHint(PublicKey const& pk, SignatureHint const& hint)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems misnamed. Seems like it should be called doesHintMatch or something

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed

Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
Signed-off-by: Rafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants