Bugfix: Replace "URL" with "URI" where we aren't actually working with URLs
[novacoin.git] / src / bignum.h
index 4143f60..c7c2ff1 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "util.h"
 
+/** Errors thrown by the bignum class */
 class bignum_error : public std::runtime_error
 {
 public:
@@ -18,7 +19,7 @@ public:
 };
 
 
-
+/** RAII encapsulated BN_CTX (OpenSSL bignum context) */
 class CAutoBN_CTX
 {
 protected:
@@ -46,7 +47,7 @@ public:
 };
 
 
-
+/** C++ wrapper for BIGNUM (OpenSSl bignum) */
 class CBigNum : public BIGNUM
 {
 public:
@@ -243,7 +244,7 @@ public:
     std::vector<unsigned char> getvch() const
     {
         unsigned int nSize = BN_bn2mpi(this, NULL);
-        if (nSize < 4)
+        if (nSize <= 4)
             return std::vector<unsigned char>();
         std::vector<unsigned char> vch(nSize);
         BN_bn2mpi(this, &vch[0]);