pirclient.h 721 B

123456789101112131415161718192021222324252627
  1. #ifndef __PIRCLIENT_H__
  2. #define __PIRCLIENT_H__
  3. #include <string>
  4. using std::string;
  5. // Derive a class from this, implementing the virtual functions, and
  6. // call mainloop().
  7. class PIRClient {
  8. public:
  9. // Create a PIR query. The plainquery must be exactly 32 bytes
  10. // long.
  11. virtual void create(const string &plainquery, const string &params,
  12. void *&queryid, string &pirquery) = 0;
  13. // Extract the plaintext response from a PIR response. Returns
  14. // true if successful, false if unsuccessful.
  15. virtual bool extract(void *&queryid, const string &pirresponse,
  16. string &plainresponse) = 0;
  17. // Call this to run the client, and exit when it returns
  18. void mainloop();
  19. };
  20. #endif