she-elgamal 0.0.12

lifted elgamal encryption implementation
Documentation

ElGamal Encryption

CI crates.io badge Documentation GitHub license codecov dependency status

This crate provides additive homomorphic ElGamal encryption over jubjub curve and also supports fully no_std and parity-scale-codec.

Specification

Alice has balance $a$ and public key $b$.
She generates the randomness $r$ and computes encrypted balance $(gr, ga * br)$.
When Bob transfers $c$ to Alice, he generates the randomness $r'$ and computes encrypted transfer amount $(g
{r'}, gc * b{r'})$.
The sum of encrypted balance and transfer amount is folloing.

$$ (g{r + r'}, g{a + c} * b^{r + r'}) $$

Test

$ cargo test