diff --git a/CMakeLists.txt b/CMakeLists.txt index d85b52e..cbf79ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) cmake_minimum_required(VERSION 3.0) project(NODLib) +endif() if(NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") diff --git a/LogVisor b/LogVisor index 317e75c..7be764c 160000 --- a/LogVisor +++ b/LogVisor @@ -1 +1 @@ -Subproject commit 317e75c22e31746947bd1b3700cd72d53c97c837 +Subproject commit 7be764c387951cabfc86d52f48bd3dab54127aeb diff --git a/include/NOD/aes.hpp b/include/NOD/aes.hpp index 20e7cb6..a22556a 100644 --- a/include/NOD/aes.hpp +++ b/include/NOD/aes.hpp @@ -12,8 +12,8 @@ class IAES { public: virtual ~IAES() {} - virtual void encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len)=0; - virtual void decrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len)=0; + virtual void encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, size_t len)=0; + virtual void decrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, size_t len)=0; virtual void setKey(const uint8_t* key)=0; }; diff --git a/lib/DiscBase.cpp b/lib/DiscBase.cpp index 81d95ba..e82ad62 100644 --- a/lib/DiscBase.cpp +++ b/lib/DiscBase.cpp @@ -1,6 +1,7 @@ #include "NOD/DiscBase.hpp" #include "NOD/IFileIO.hpp" +#include #ifndef _WIN32 #include #endif diff --git a/lib/aes.cpp b/lib/aes.cpp index 85b6fab..2d7a56f 100644 --- a/lib/aes.cpp +++ b/lib/aes.cpp @@ -185,8 +185,8 @@ protected: void _decrypt(uint8_t* buff); public: - void encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len); - void decrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len); + void encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, size_t len); + void decrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, size_t len); void setKey(const uint8_t* key); }; @@ -430,7 +430,7 @@ void SoftwareAES::decrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outb } // CBC mode encryption -void SoftwareAES::encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len) +void SoftwareAES::encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, size_t len) { uint8_t block[16]; uint8_t feedback[16]; @@ -477,7 +477,7 @@ class NiAES : public IAES __m128i m_ekey[11]; __m128i m_dkey[11]; public: - void encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len) + void encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, size_t len) { __m128i feedback,data; uint64_t i,j; @@ -497,7 +497,7 @@ public: _mm_storeu_si128(&((__m128i*)outbuf)[i], feedback); } } - void decrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len) + void decrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, size_t len) { __m128i data,feedback,last_in; uint64_t i,j;