Skip to content

additive homomorphic Elgamal encryption based on Jubjub curve

Notifications You must be signed in to change notification settings

KogarashiNetwork/elgamal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 $(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'}) $$

Test

$ cargo test

About

additive homomorphic Elgamal encryption based on Jubjub curve

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published