LGro / PyAPSI

Python wrapper for labeled and unlabeled asymmetric private set intersection (APSI).
MIT License
14 stars 6 forks source link

Fixed bug with StreamChannel buffer handling; other minor clean-up #4

Closed kimlaine closed 2 years ago

kimlaine commented 2 years ago

I fixed the problem that we discussed before. It was due to incorrect handling of the StreamChannel buffers and was related to the comments you had in the code about having to create separate StreamChannels for the output (e.g., Sender::RunQuery), otherwise various exceptions occurred. The solution you used worked, but you didn't do it in the OPRF response, because it didn't cause an exception. However, these solutions are not really the right way to do it. Instead, you'll want to keep only one StreamChannel per sender or receiver, because it keeps track of sent and received data. What you need to instead do is handle those buffers (the stringstream objects) as you need, and keep them tied to one single StreamChannel throughout. I simplified this by deriving a new very simple class from StreamChannel called StringStreamChannel, that exposes the necessary buffer handling operations.

I also did some very minor clean-up throughout.

kimlaine commented 2 years ago

P.S. I realize now that the way to use StreamChannel is not clear at all.