UNPKG

snarkyjs-elgamal

Version:

This repository implements Elgmal, a partial homomorphic encryption scheme originally described by [Taher Elgamal in 1985](https://caislab.kaist.ac.kr/lecture/2010/spring/cs548/basic/B02.pdf). This implementation includes the original version of Elgamal,

10 lines (9 loc) 513 B
import { Field } from 'snarkyjs'; export { modExp, discreteLog, generateLookup, lookUp }; /** * Modular exponentiation `base^exponent`, based on a variant of the [square-and-multiply](https://en.wikipedia.org/wiki/Exponentiation_by_squaring) algorithm. */ declare function modExp(base: Field, exponent: Field): Field; declare function discreteLog(a: Field, g: Field): Field; declare function generateLookup(n?: number, path?: string): void; declare function lookUp(path: string | undefined, g: string): string;