Skip to content

lovesh/libsnark-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libsnark playground

Playing with Zk-SNARKs. Some of the code taken from libsnark tutorial repositories from Christian Lundkvist and Howard Wu. The latter contains the build instructions.

  1. Example to prove knowledge of factors of a number, i.e given a public output c, prove the knowledge of 2 numbers a and b such that a * b = c.
  2. Prove the knowledge of pre-image of a sha256 hash. Uses libsnark's sha256 gadget. Byte representation of inputs and output can be generated using python helper script. Use the function short_string_hash to generate bytes.
  3. MiMC-Fiestel hash pre-image. 2 implementations, one from josojo that does exponentiation (x^3) during round and other does inverse (x^-1) during the round as suggested by Dmitry Khovratovich
  4. Shark MiMC as suggested by Dmitry Khovratovich. Contains 2 gadgets, SharkMimc_cube_gadget which treats x^3 as S-box function and SharkMimc_inverse_gadget which treats x^-1 as S-box function.

Releases

No releases published

Packages

No packages published