microsoft / APSI

APSI is a C++ library for Asymmetric (unlabeled or labeled) Private Set Intersection.
MIT License
186 stars 42 forks source link

Some problem when i want to use document to replace the communication. #77

Open TY-cc opened 2 months ago

TY-cc commented 2 months ago

I try to write the content that needs to be communicated into the document, and then complete the communication process by moving the document. For example, in the receiver, I want to use the save method of SenderOperationParms to write ParamsRequest into the document, and the sender uses the load method to read ParamsRequest from the document. But it failed, and the ParamsRequest after reading can't be used normally. Code as follow: image error as : image

kimlaine commented 1 month ago

The problem is probably that you are not writing in binary mode, so your fstream is corrupting the saved data with some newline translations. To fix, specify std::ios::binary as the mode when opening your streams. To be clear, writing the request doesn't produce a "text file" in the sense that your file naming misleadingly suggests.