Crates.io | zero-elgamal |
lib.rs | zero-elgamal |
version | 0.1.11 |
source | src |
created_at | 2022-04-06 00:31:49.87796 |
updated_at | 2023-04-28 07:21:02.101715 |
description | lifted elgamal encryption implementation |
homepage | https://github.com/KogarashiNetwork/Kogarashi |
repository | https://github.com/KogarashiNetwork/elgamal |
max_upload_size | |
id | 562850 |
size | 11,716 |
This crate provides additive homomorphic ElGamal encryption over jubjub curve and also supports fully no_std
and parity-scale-codec
.
Alice has balance $a$ and public key $b$.
She generates the randomness $r$ and computes encrypted balance $(g^r, g^a * b^r)$.
When Bob transfers $c$ to Alice, he generates the randomness $r'$ and computes encrypted transfer amount $(g^{r'}, g^c * b^{r'})$.
The sum of encrypted balance and transfer amount is folloing.
$$ (g^{r + r'}, g^{a + c} * b^{r + r'}) $$