summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--includes/BSHA1.h (renamed from includes/SHA1.h)0
-rw-r--r--src/BSHA1.cc (renamed from src/SHA1.cc)2
-rw-r--r--src/BWebSocket.cc2
-rw-r--r--src/BigInt.cc6
-rw-r--r--win32/tomcrypt_aes_enc.c2
6 files changed, 9 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 5a59dc1..f5481e3 100644
--- a/Makefile
+++ b/Makefile
@@ -71,7 +71,7 @@ json_reader.cpp \
json_writer.cpp \
json_value.cpp \
\
-SHA1.cc \
+BSHA1.cc \
Base64.cc \
\
BLua.cc \
diff --git a/includes/SHA1.h b/includes/BSHA1.h
index f70f6b7..f70f6b7 100644
--- a/includes/SHA1.h
+++ b/includes/BSHA1.h
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) {
diff --git a/win32/tomcrypt_aes_enc.c b/win32/tomcrypt_aes_enc.c
new file mode 100644
index 0000000..c954a27
--- /dev/null
+++ b/win32/tomcrypt_aes_enc.c
@@ -0,0 +1,2 @@
+#define ENCRYPT_ONLY
+#include "../libtomcrypt/src/ciphers/aes/aes.c"