An open API service indexing awesome lists of open source software.

https://github.com/muqsitnawaz/libfss

Pure Modern C++ library for Function Secret Sharing
https://github.com/muqsitnawaz/libfss

cpp cryptogrpahy

Last synced: 2 months ago
JSON representation

Pure Modern C++ library for Function Secret Sharing

Awesome Lists containing this project

README

        

# FSS

FSS implements a two-party Function Secret Sharing protocol that allows non-colluding parties to execute a function
without knowing the original inputs of the user.

The inputs and the function are secret shared between the parties making it information therotic secure against an
adversary (given the non-colluding assumption).

## Theory

- [Function Secret Sharing](https://cs.idc.ac.il/~elette/FunctionSecretSharing.pdf)
- [Function Secret Sharing: Improvements and Extensions](https://eprint.iacr.org/2018/707.pdf)

## Applications

- [Pika: Secure Computation
using Function Secret Sharing over Rings](https://petsymposium.org/popets/2022/popets-2022-0113.pdf)

## Dependencies

```bash
brew install openssl
```

## Installation

```bash
cmake -S .. -B build
cd build
make
sudo make install
```

This will install the library at `/usr/local/include/fss`.

## Usage

```cpp
#include
#include
#include

const auto fss_context = FSSContext::Create(plain_modulus, 10); // Creates a ring of size 2^10

FSSGenerator generator(fss_context); // Used for generating keys

ReLUKey key_p0, key_p1;
generator.relu(key_p0, key_p1);

FSSEvaluator evaluator_p0(fss_context, 0); // Used for evaluating the function
FSSEvaluator evaluator_p1(fss_context, 1); // Used for evaluating the function

const auto output_p0 = evaluator_p0.relu(key_p0, );
const auto output_p1 = evaluator_p1.relu(key_p1, );

const auto output = (output_p0 + output_p1) % plain_modulus; // Output of the function
```

## License

[MIT License](LICENSE)