mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
17 lines
637 B
C++
17 lines
637 B
C++
#include <concretelang/ClientLib/ClientLambda.h>
|
|
|
|
// Include the header that has been generated by the compiler
|
|
#include "myinclude/fhe_service/additions.h"
|
|
|
|
void query_server(MyConnection conn) {
|
|
auto libPath = "/opt/fhe_service/libs/additions.so";
|
|
std::ostream to_server = conn.ostream();
|
|
std::ostream from_server = conn.istream();
|
|
// In a real code only load once.
|
|
auto add2int = additions::add2int::load(libPath, seed_msb, seed_lsb);
|
|
auto err = add2int->callSerialize(1, 2, to_server);
|
|
if( err ) { throw MyException() };
|
|
auto result = add2int->decryptReturned(from_server);
|
|
assert(result == 3);
|
|
}
|