basic_simple_elgamal
Version:
This is a cypher engine which uses ElGamal cryptosystem internally. besides cryptography, it provide some group functionality such as add 2 members or select a random group member and so on.
21 lines (11 loc) • 366 B
JavaScript
const bigInteger = require('big-integer');
const ElGamal = require('../elgamal');
const debug = require('debug');
const log = debug('app::test');
async function test(){
let v = bigInteger('1');
let elgamal = new ElGamal();
await elgamal.initializeRemotely(2048);
log(elgamal.generator === elgamal.power(v).toString());
}
test();