MSVC
[novacoin.git] / src / key.cpp
index 4a7d7fd..ed04e0e 100644 (file)
@@ -161,7 +161,7 @@ const unsigned char vchMaxModHalfOrder[32] = {
     0xDF,0xE9,0x2F,0x46,0x68,0x1B,0x20,0xA0
 };
 
-const unsigned char vchZero[0] = {};
+const unsigned char *vchZero = NULL;
 
 
 
@@ -344,7 +344,7 @@ bool CKey::Sign(uint256 hash, std::vector<unsigned char>& vchSig)
     EC_GROUP_get_order(group, &order, NULL);
     BN_rshift1(&halforder, &order);
     // enforce low S values, by negating the value (modulo the order) if above order/2.
-    if (BN_cmp(sig->s, &halforder)) {
+    if (BN_cmp(sig->s, &halforder) > 0) {
         BN_sub(sig->s, &order, sig->s);
     }
     unsigned int nSize = ECDSA_size(pkey);
@@ -376,7 +376,7 @@ bool CKey::SignCompact(uint256 hash, std::vector<unsigned char>& vchSig)
     EC_GROUP_get_order(group, &order, NULL);
     BN_rshift1(&halforder, &order);
     // enforce low S values, by negating the value (modulo the order) if above order/2.
-    if (BN_cmp(sig->s, &halforder)) {
+    if (BN_cmp(sig->s, &halforder) > 0) {
         BN_sub(sig->s, &order, sig->s);
     }
     vchSig.clear();