@eyhn/crypto
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "@eyhn/crypto", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "types": "lib/index.d.ts", |
@@ -5,2 +5,3 @@ import prng from "../rng/prng"; | ||
import { arrayBufferToBigInt } from "../bigint"; | ||
import Alea from "../rng/alea"; | ||
@@ -28,4 +29,4 @@ export function generateRandomBiting(bitlength: number, prng: (ba: TypedArray) => void): BigInt.BigInteger { | ||
export default function pkcs1generate(bitlength: number, expt: number) { | ||
const rng = prng(); | ||
export default function pkcs1generate(bitlength: number, expt: number, seed?: string) { | ||
const rng = seed ? Alea(seed) : prng(); | ||
const qs = bitlength / 2; | ||
@@ -32,0 +33,0 @@ const ee = BigInt(expt); |
@@ -55,2 +55,7 @@ import crypto = require('../src/'); | ||
it('seed', () => { | ||
const rsa = crypto.rsa.generate(1024, 65537, 'seed'); | ||
expect(rsa).toMatchSnapshot(); | ||
}); | ||
it('feature', () => { | ||
@@ -57,0 +62,0 @@ const rsa = crypto.rsa.generate(1024, 65537); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
193197
64
882