diff --git a/src/dh.ts b/src/dh.ts index 82d0064..ac2f600 100644 --- a/src/dh.ts +++ b/src/dh.ts @@ -82,7 +82,7 @@ function checkPrime (prime, generator) { return error } -function DH (prime, generator, malleable) { +export function DH (prime, generator, malleable) { this.setGenerator(generator) this.__prime = new BN(prime) this._prime = BN.mont(this.__prime) diff --git a/src/index.ts b/src/index.ts index 693750a..0fe1ed1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,7 @@ +import { DH } from './dh.js' const generatePrime = require('./lib/generatePrime') const primes = require('./lib/primes.json') -const DH = require('./lib/dh') - export function DiffieHellmanGroup (mod) { const prime = new Buffer(primes[mod].prime, 'hex') const gen = new Buffer(primes[mod].gen, 'hex')