Browse Source

Touch up some API function names

Ian Goldberg 1 year ago
parent
commit
6211a89d03
7 changed files with 22 additions and 22 deletions
  1. 4 4
      cxx/spir.cpp
  2. 4 4
      cxx/spir.hpp
  3. 2 2
      cxx/spir_ffi.h
  4. 2 2
      cxx/spir_test.cpp
  5. 4 4
      src/client.rs
  6. 2 2
      src/main.rs
  7. 4 4
      src/server.rs

+ 4 - 4
cxx/spir.cpp

@@ -20,9 +20,9 @@ SPIR_Client::~SPIR_Client()
     spir_client_free(this->client);
 }
 
-string SPIR_Client::preproc_PIRs(uint32_t num_preproc)
+string SPIR_Client::preproc(uint32_t num_preproc)
 {
-    VecData msg = spir_client_preproc_PIRs(this->client, num_preproc);
+    VecData msg = spir_client_preproc(this->client, num_preproc);
     string ret(msg.data, msg.len);
     spir_vecdata_free(msg);
     return ret;
@@ -45,9 +45,9 @@ SPIR_Server::~SPIR_Server()
     spir_server_free(this->server);
 }
 
-string SPIR_Server::preproc_PIRs(const string &msg)
+string SPIR_Server::preproc_process(const string &msg)
 {
-    VecData retmsg = spir_server_preproc_PIRs(this->server, msg.data(),
+    VecData retmsg = spir_server_preproc_process(this->server, msg.data(),
         msg.length());
     string ret(retmsg.data, retmsg.len);
     spir_vecdata_free(retmsg);

+ 4 - 4
cxx/spir.hpp

@@ -20,7 +20,7 @@ public:
     ~SPIR_Client();
 
     // preprocessing
-    string preproc_PIRs(uint32_t num_pirs); // returns the string to send to the server
+    string preproc(uint32_t num_pirs); // returns the string to send to the server
 
     void preproc_finish(const string &server_preproc);
 
@@ -30,7 +30,7 @@ public:
     // process the server's response to yield the server's db[(idx + rot)%N] + blind
     // where N=2^r, idx is provided by the client above, and
     // db, rot, and blind are provided by the server below
-    SPIR::DBEntry process_reply(const string &server_reply);
+    SPIR::DBEntry query_finish(const string &server_reply);
 
 private:
     void *client;
@@ -46,12 +46,12 @@ public:
     ~SPIR_Server();
 
     // preprocessing
-    string preproc_PIRs(const string &client_preproc); // returns the string to reply to the client
+    string preproc_process(const string &client_preproc); // returns the string to reply to the client
   
     // SPIR query on the given database of N=2^r records, each of type DBEntry
     // rotate the database by rot, and blind each entry in the database additively with blind
     // returns the string to reply to the client
-    string process_query(const string &client_query, const SPIR::DBEntry *db,
+    string query_process(const string &client_query, const SPIR::DBEntry *db,
         size_t rot, SPIR::DBEntry blind);
 
 private:

+ 2 - 2
cxx/spir_ffi.h

@@ -24,7 +24,7 @@ extern ClientNewRet spir_client_new(uint8_t r);
 
 extern void spir_client_free(void *client);
 
-extern VecData spir_client_preproc_PIRs(void *client, uint32_t num_preproc);
+extern VecData spir_client_preproc(void *client, uint32_t num_preproc);
 
 extern void spir_client_preproc_finish(void *client,
     const char *msgdata, size_t msglen);
@@ -34,7 +34,7 @@ extern void* spir_server_new(uint8_t r, const char *pub_params,
 
 extern void spir_server_free(void *server);
 
-extern VecData spir_server_preproc_PIRs(void *server,
+extern VecData spir_server_preproc_process(void *server,
     const char *msgdata, size_t msglen);
 
 extern void spir_vecdata_free(VecData vecdata);

+ 2 - 2
cxx/spir_test.cpp

@@ -56,7 +56,7 @@ int main(int argc, char **argv)
     struct timeval preproc_client_start;
     gettimeofday(&preproc_client_start, NULL);
 
-    string preproc_msg = client.preproc_PIRs(num_preproc);
+    string preproc_msg = client.preproc(num_preproc);
     size_t preproc_client_us = elapsed_us(&preproc_client_start);
     cout << "Preprocessing client: " << preproc_client_us << " µs\n";
     cout << "preproc_msg len = " << preproc_msg.length() << "\n";
@@ -64,7 +64,7 @@ int main(int argc, char **argv)
     struct timeval preproc_server_start;
     gettimeofday(&preproc_server_start, NULL);
 
-    string preproc_resp = server.preproc_PIRs(preproc_msg);
+    string preproc_resp = server.preproc_process(preproc_msg);
     size_t preproc_server_us = elapsed_us(&preproc_server_start);
     cout << "Preprocessing server: " << preproc_server_us << " µs\n";
     cout << "preproc_response len = " << preproc_resp.length() << "\n";

+ 4 - 4
src/client.rs

@@ -140,13 +140,13 @@ impl Client {
         )
     }
 
-    pub fn preproc_PIRs(&self, num_preproc: usize) -> Vec<u8> {
+    pub fn preproc(&self, num_preproc: usize) -> Vec<u8> {
         self.incoming_cmd
             .send(Command::PreProc(num_preproc))
             .unwrap();
         let ret = match self.outgoing_resp.recv() {
             Ok(Response::PreProcMsg(x)) => x,
-            _ => panic!("Received something unexpected in preproc_PIRs"),
+            _ => panic!("Received something unexpected in preproc"),
         };
         ret
     }
@@ -188,12 +188,12 @@ pub extern "C" fn spir_client_free(client: *mut Client) {
 }
 
 #[no_mangle]
-pub extern "C" fn spir_client_preproc_PIRs(clientptr: *mut Client, num_preproc: u32) -> VecData {
+pub extern "C" fn spir_client_preproc(clientptr: *mut Client, num_preproc: u32) -> VecData {
     let client = unsafe {
         assert!(!clientptr.is_null());
         &mut *clientptr
     };
-    let retvec = client.preproc_PIRs(num_preproc as usize);
+    let retvec = client.preproc(num_preproc as usize);
     to_vecdata(retvec)
 }
 

+ 2 - 2
src/main.rs

@@ -53,14 +53,14 @@ fn main() {
     println!("num_preproc = {}", num_preproc);
 
     let preproc_client_start = Instant::now();
-    let preproc_msg = client.preproc_PIRs(num_preproc);
+    let preproc_msg = client.preproc(num_preproc);
     let preproc_client_us = preproc_client_start.elapsed().as_micros();
 
     println!("Preprocessing client: {} µs", preproc_client_us);
     println!("preproc_msg len = {}", preproc_msg.len());
 
     let preproc_server_start = Instant::now();
-    let preproc_resp = server.preproc_PIRs(&preproc_msg);
+    let preproc_resp = server.preproc_process(&preproc_msg);
     let preproc_server_us = preproc_server_start.elapsed().as_micros();
 
     println!("Preprocessing server: {} µs", preproc_server_us);

+ 4 - 4
src/server.rs

@@ -87,13 +87,13 @@ impl Server {
         }
     }
 
-    pub fn preproc_PIRs(&self, msg: &[u8]) -> Vec<u8> {
+    pub fn preproc_process(&self, msg: &[u8]) -> Vec<u8> {
         self.incoming_cmd
             .send(Command::PreProcMsg(bincode::deserialize(msg).unwrap()))
             .unwrap();
         let ret = match self.outgoing_resp.recv() {
             Ok(Response::PreProcResp(x)) => x,
-            _ => panic!("Received something unexpected in preproc_PIRs"),
+            _ => panic!("Received something unexpected in preproc_process"),
         };
         ret
     }
@@ -126,7 +126,7 @@ pub extern "C" fn spir_server_free(server: *mut Server) {
 }
 
 #[no_mangle]
-pub extern "C" fn spir_server_preproc_PIRs(
+pub extern "C" fn spir_server_preproc_process(
     serverptr: *mut Server,
     msgdata: *const c_uchar,
     msglen: usize,
@@ -139,6 +139,6 @@ pub extern "C" fn spir_server_preproc_PIRs(
         assert!(!msgdata.is_null());
         std::slice::from_raw_parts(msgdata, msglen)
     };
-    let retvec = server.preproc_PIRs(&msg_slice);
+    let retvec = server.preproc_process(&msg_slice);
     to_vecdata(retvec)
 }