summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-25 17:31:09 -0800
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-25 17:31:09 -0800
commitd0b856cfbb99b1f1833a18ff556d517a7e3f04d8 (patch)
treec508f82310c51e97a5d489ebfe235f7c07dd8995 /src
parentfb2e7158f66796b98d5f22245d251e460456aed3 (diff)
Making the necessary changes to get libtommath, libtomcrypt and BigInt to compile under MSVC.
Diffstat (limited to 'src')
-rw-r--r--src/BSHA1.cc (renamed from src/SHA1.cc)2
-rw-r--r--src/BWebSocket.cc2
-rw-r--r--src/BigInt.cc6
3 files changed, 6 insertions, 4 deletions
diff --git a/src/SHA1.cc b/src/BSHA1.cc
index 21bf018..68c7853 100644
--- a/src/SHA1.cc
+++ b/src/BSHA1.cc
@@ -10,7 +10,7 @@ A million repetitions of "a"
34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
*/
-#include "SHA1.h"
+#include "BSHA1.h"
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
diff --git a/src/BWebSocket.cc b/src/BWebSocket.cc
index 9a3b420..2faf9d9 100644
--- a/src/BWebSocket.cc
+++ b/src/BWebSocket.cc
@@ -1,5 +1,5 @@
#include "BWebSocket.h"
-#include "SHA1.h"
+#include "BSHA1.h"
#include "Base64.h"
#include "TaskMan.h"
diff --git a/src/BigInt.cc b/src/BigInt.cc
index 73bfe29..8ec1b12 100644
--- a/src/BigInt.cc
+++ b/src/BigInt.cc
@@ -61,6 +61,8 @@ Balau::BigInt & Balau::BigInt::operator=(const BigInt & v) throw (GeneralExcepti
if (mp_copy(v.m_bi, m_bi) != CRYPT_OK)
throw GeneralException("Error while calling mp_init_copy");
+
+ return *this;
}
void Balau::BigInt::set(uint64_t v) throw (GeneralException) {
@@ -149,7 +151,7 @@ uint64_t Balau::BigInt::to_uint64() const throw (GeneralException) {
int64_t Balau::BigInt::to_int64() const throw (GeneralException) {
if (mp_count_bits(m_bi) > 63)
throw GeneralException("BigInt too big to fit in a int64");
- uint64_t v = 0;
+ int64_t v = 0;
int shift = 0;
int digit = 0;
while (shift <= 63) {
@@ -175,7 +177,7 @@ uint32_t Balau::BigInt::to_uint32() const throw (GeneralException) {
int32_t Balau::BigInt::to_int32() const throw (GeneralException) {
if (mp_count_bits(m_bi) > 31)
throw GeneralException("BigInt too big to fit in a uint32");
- uint64_t v = 0;
+ int64_t v = 0;
int shift = 0;
int digit = 0;
while (shift <= 31) {