ZotPrivateKey constructor
ZotPrivateKey(
- int bitLen,
- ZotKeyPair zotKeyPair,
- Encrypto encrypto
Implementation
ZotPrivateKey(int bitLen, ZotKeyPair zotKeyPair, Encrypto encrypto) {
BigInt p = randomPrimeBigInt(bitLen), q = randomPrimeBigInt(bitLen);
BigInt n = p * q, pm1 = p - BigInt.one, qm1 = q - BigInt.one;
_on = pm1 * qm1;
BigInt e = randomPrimeBigInt(bitLen);
_d = e.modInverse(_on);
_assetEq(((e * _d) % _on));
zotKeyPair.publicKey = ZotPublicKey(e, n);
encrypto.keyPair = zotKeyPair;
}