microsoft / SEAL

Microsoft SEAL is an easy-to-use and powerful homomorphic encryption library.
https://www.microsoft.com/en-us/research/group/cryptography-research/
MIT License
3.55k stars 706 forks source link

connecting Microsoft SEAL with socket programming #158

Open RachaElmo opened 4 years ago

RachaElmo commented 4 years ago

Hello I am writing a code for my client-server model. I created a server and I used the header WS2tcpip.h in my code and it runs normally. Then I connected SEAL to a project that runs normally. Also I added the file server.cpp to the project that is connected to SEAL. However once I write this =>using namespace seal;
my code stops running and keeps giving 100 errors. Any suggestions please? does SEAl even work with winsock libraries like ws2_32 with header WS2tcpip2.h or winsock2 with header winsock2.h?

kimlaine commented 4 years ago

It should work fine, so I suspect something else is wrong. Maybe the header files are not correctly included? Did you add native/src to your project in the include directories?

RachaElmo commented 4 years ago

nativesrc

I included SEAL paths in C/C++ -> Additonal include directories , and in Linker ->General->Additional library directories, also added seal.lib and ws2_32.lib in Linker -> Input - >Additional dependencies. I get errors like this errs

kimlaine commented 4 years ago

It sounds like you did everything correctly. Would it be possible to share the project?

RachaElmo commented 4 years ago

It sounds like you did everything correctly. Would it be possible to share the project? sorry I recently saw this reply. I shared the .cpp and .h files for my project.

Server(1).zip

please can you check it out.

kimlaine commented 4 years ago

Is there a reason why you commented out the SEAL header file from your includes? Maybe that's the only reason it doesn't work?

RachaElmo commented 4 years ago

Actually my problem is when I uncomment them I get errors. For example this sample code below gives errors when I run it on a project connected to SEAL:

include

include

include "seal/seal.h"

pragma comment (lib, "ws2_32.lib")

using namespace std; using namespace seal;

void server() {

string s;

} int main() { server();

}

RachaElmo commented 4 years ago

the first line is adding "iostream" library of c++ but when i post my comment it goes away.