|
|
@ -1,6 +1,6 @@ |
|
|
|
# she ; Two-level homomorphic encryption library for browser/Node.js by WebAssembly |
|
|
|
# she ; Two-level homomorphic encryption library for browser/Node.js by WebAssembly |
|
|
|
|
|
|
|
|
|
|
|
# Abstruct |
|
|
|
# Abstract |
|
|
|
she is a somewhat(two-level) homomorphic encryption library, |
|
|
|
she is a somewhat(two-level) homomorphic encryption library, |
|
|
|
which is based on pairings. |
|
|
|
which is based on pairings. |
|
|
|
This library supports polynomially many homomorphic additions and |
|
|
|
This library supports polynomially many homomorphic additions and |
|
|
@ -31,7 +31,7 @@ Sum_i Enc(x_i) Enc(y_i) = Enc(Sum_i x_i y_i). |
|
|
|
* decrypt a ciphertext with a secret key |
|
|
|
* decrypt a ciphertext with a secret key |
|
|
|
|
|
|
|
|
|
|
|
## Homomorphic operations |
|
|
|
## Homomorphic operations |
|
|
|
* homomorphic addtion/substraction over ciphertexts of the same ciphertext class |
|
|
|
* homomorphic addition/subtraction over ciphertexts of the same ciphertext class |
|
|
|
* homomprphic multiplication over ciphertext of CipherTextG1 and CipherTextG2 |
|
|
|
* homomprphic multiplication over ciphertext of CipherTextG1 and CipherTextG2 |
|
|
|
* The class of the result is CipherTextGT. |
|
|
|
* The class of the result is CipherTextGT. |
|
|
|
|
|
|
|
|
|
|
@ -39,7 +39,7 @@ Sum_i Enc(x_i) Enc(y_i) = Enc(Sum_i x_i y_i). |
|
|
|
* This library requires to solve a small DLP to decrypt a ciphertext. |
|
|
|
* This library requires to solve a small DLP to decrypt a ciphertext. |
|
|
|
* The decryption timing is O(m/s), where s is the size of table to solve DLP, and m is the size fo a plaintext. |
|
|
|
* The decryption timing is O(m/s), where s is the size of table to solve DLP, and m is the size fo a plaintext. |
|
|
|
* call `setRangeForDLP(s)` to set the table size. |
|
|
|
* call `setRangeForDLP(s)` to set the table size. |
|
|
|
* The maximun `m/s` is set by `setTryNum(tryNum)`. |
|
|
|
* The maximum `m/s` is set by `setTryNum(tryNum)`. |
|
|
|
|
|
|
|
|
|
|
|
## Zero-knowledge proof class |
|
|
|
## Zero-knowledge proof class |
|
|
|
* A zero-knowledge proof is simultaneously created when encrypting a plaintext `m`. |
|
|
|
* A zero-knowledge proof is simultaneously created when encrypting a plaintext `m`. |
|
|
@ -66,7 +66,7 @@ and read `she.js`. |
|
|
|
|
|
|
|
|
|
|
|
## A sample for JS |
|
|
|
## A sample for JS |
|
|
|
|
|
|
|
|
|
|
|
``` |
|
|
|
```js |
|
|
|
// initialize a library |
|
|
|
// initialize a library |
|
|
|
she.init().then(() => { |
|
|
|
she.init().then(() => { |
|
|
|
const sec = new she.SecretKey() |
|
|
|
const sec = new she.SecretKey() |
|
|
@ -103,7 +103,7 @@ she.init().then(() => { |
|
|
|
|
|
|
|
|
|
|
|
# A sample for C++ |
|
|
|
# A sample for C++ |
|
|
|
How to build the library, see [mcl](https://github.com/herumi/mcl/#installation-requirements). |
|
|
|
How to build the library, see [mcl](https://github.com/herumi/mcl/#installation-requirements). |
|
|
|
``` |
|
|
|
```c++ |
|
|
|
#include <mcl/she.hpp> |
|
|
|
#include <mcl/she.hpp> |
|
|
|
int main() |
|
|
|
int main() |
|
|
|
try |
|
|
|
try |
|
|
|