aboutsummaryrefslogtreecommitdiff
path: root/src/ecwrapper.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2014-11-12 11:36:44 -0800
committerPieter Wuille <[email protected]>2014-11-12 11:44:25 -0800
commit60672a61ff7bd9679e1c7683c28ecdf0f02daaeb (patch)
tree2ac49818c5f048efd7826371a8e125570692e5f3 /src/ecwrapper.cpp
parentMerge pull request #5161 (diff)
parentDo signature-s negation inside the tests (diff)
downloaddiscoin-60672a61ff7bd9679e1c7683c28ecdf0f02daaeb.tar.xz
discoin-60672a61ff7bd9679e1c7683c28ecdf0f02daaeb.zip
Merge pull request #5256
f4e0aef Do signature-s negation inside the tests (Pieter Wuille)
Diffstat (limited to 'src/ecwrapper.cpp')
-rw-r--r--src/ecwrapper.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ecwrapper.cpp b/src/ecwrapper.cpp
index ebaa35026..3377dce0c 100644
--- a/src/ecwrapper.cpp
+++ b/src/ecwrapper.cpp
@@ -193,7 +193,7 @@ bool CECKey::SetPubKey(const unsigned char* pubkey, size_t size) {
return o2i_ECPublicKey(&pkey, &pubkey, size) != NULL;
}
-bool CECKey::Sign(const uint256 &hash, std::vector<unsigned char>& vchSig, bool lowS) {
+bool CECKey::Sign(const uint256 &hash, std::vector<unsigned char>& vchSig) {
vchSig.clear();
ECDSA_SIG *sig = ECDSA_do_sign((unsigned char*)&hash, sizeof(hash), pkey);
if (sig == NULL)
@@ -205,7 +205,7 @@ bool CECKey::Sign(const uint256 &hash, std::vector<unsigned char>& vchSig, bool
BIGNUM *halforder = BN_CTX_get(ctx);
EC_GROUP_get_order(group, order, ctx);
BN_rshift1(halforder, order);
- if (lowS && BN_cmp(sig->s, halforder) > 0) {
+ if (BN_cmp(sig->s, halforder) > 0) {
// enforce low S values, by negating the value (modulo the order) if above order/2.
BN_sub(sig->s, order, sig->s);
}