Loading src/CMakeLists.txt +2 −0 Original line number Diff line number Diff line Loading @@ -17,12 +17,14 @@ if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows") windows/socket.cpp windows/udp.cpp windows/tcp.cpp windows/random.cpp ) else() list(APPEND netplussrc posix/socket.cpp posix/udp.cpp posix/tcp.cpp posix/random.cpp ) endif() Loading src/crypto/aes.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ namespace netplus { // --- Helper Functions --- static void aes_self_check() { void aes_self_check() { // 1) S-Box / InvS-Box must be inverse permutations for (int x = 0; x < 256; ++x) { uint8_t y = S_BOX[x]; Loading src/crypto/aes.h +0 −4 Original line number Diff line number Diff line Loading @@ -43,10 +43,6 @@ extern const uint8_t S_BOX[256]; extern const uint8_t INV_S_BOX[256]; extern const uint8_t RCON[10]; // Rcon values for key expansion (only 10 needed for AES-128) extern "C" { static void aes_self_check(); } class aes { private: // Stores the expanded round keys (11 keys * 16 bytes = 176 bytes for AES-128) Loading src/crypto/rsa.cpp +0 −11 Original line number Diff line number Diff line Loading @@ -350,17 +350,6 @@ namespace netplus { // n_prime = -N^{-1} mod 2^32 (uses least significant limb) uint32_t n_prime = netplus::rsa::calculateNPrime(mod.data[0]); // Helper: compute (2^(32*mod.used)) mod mod == R mod N auto calculateRMod = [&](const bigInt& N) -> bigInt { bigInt r(N.used * 2 + 2); r.fromUint64(1); r.shiftLeft(N.used * 32); bigInt q(r.used + 1), rem(N.used + 2); netplus::rsa::divide(r, N, q, rem); return rem; }; // Helper: compute (2^(64*mod.used)) mod mod == R^2 mod N auto calculateR2Mod = [&](const bigInt& N) -> bigInt { bigInt r(N.used * 4 + 2); Loading src/crypto/x509.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -276,7 +276,7 @@ size_t netplus::x509cert::parseInternal(const uint8_t* data, size_t size, ASN1No int octets = length & 0x7F; // Defensive Check: If octets is unreasonably high or exceeds remaining buffer if (octets > sizeof(size_t) || cursor + octets > size) return 0; if (static_cast<size_t>(octets) > sizeof(size_t) || cursor + static_cast<size_t>(octets) > size) return 0; length = 0; for (int i = 0; i < octets; ++i) { Loading Loading
src/CMakeLists.txt +2 −0 Original line number Diff line number Diff line Loading @@ -17,12 +17,14 @@ if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows") windows/socket.cpp windows/udp.cpp windows/tcp.cpp windows/random.cpp ) else() list(APPEND netplussrc posix/socket.cpp posix/udp.cpp posix/tcp.cpp posix/random.cpp ) endif() Loading
src/crypto/aes.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ namespace netplus { // --- Helper Functions --- static void aes_self_check() { void aes_self_check() { // 1) S-Box / InvS-Box must be inverse permutations for (int x = 0; x < 256; ++x) { uint8_t y = S_BOX[x]; Loading
src/crypto/aes.h +0 −4 Original line number Diff line number Diff line Loading @@ -43,10 +43,6 @@ extern const uint8_t S_BOX[256]; extern const uint8_t INV_S_BOX[256]; extern const uint8_t RCON[10]; // Rcon values for key expansion (only 10 needed for AES-128) extern "C" { static void aes_self_check(); } class aes { private: // Stores the expanded round keys (11 keys * 16 bytes = 176 bytes for AES-128) Loading
src/crypto/rsa.cpp +0 −11 Original line number Diff line number Diff line Loading @@ -350,17 +350,6 @@ namespace netplus { // n_prime = -N^{-1} mod 2^32 (uses least significant limb) uint32_t n_prime = netplus::rsa::calculateNPrime(mod.data[0]); // Helper: compute (2^(32*mod.used)) mod mod == R mod N auto calculateRMod = [&](const bigInt& N) -> bigInt { bigInt r(N.used * 2 + 2); r.fromUint64(1); r.shiftLeft(N.used * 32); bigInt q(r.used + 1), rem(N.used + 2); netplus::rsa::divide(r, N, q, rem); return rem; }; // Helper: compute (2^(64*mod.used)) mod mod == R^2 mod N auto calculateR2Mod = [&](const bigInt& N) -> bigInt { bigInt r(N.used * 4 + 2); Loading
src/crypto/x509.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -276,7 +276,7 @@ size_t netplus::x509cert::parseInternal(const uint8_t* data, size_t size, ASN1No int octets = length & 0x7F; // Defensive Check: If octets is unreasonably high or exceeds remaining buffer if (octets > sizeof(size_t) || cursor + octets > size) return 0; if (static_cast<size_t>(octets) > sizeof(size_t) || cursor + static_cast<size_t>(octets) > size) return 0; length = 0; for (int i = 0; i < octets; ++i) { Loading