async initialize(lengthOfOrder = 4096){
        this.q = undefined;
        do{
            this.q = await bigIntManager.getPrime(lengthOfOrder-1);
            log(this.q, typeof this.q);
            this.p = this.q.shiftLeft(1).add(1);
            log('one prime number produced:', this.p.bitLength());
        }while(!this.p.isPrime());

        //produce generator:
        do{
            let exponent = await bigIntManager.getInRange(this.p,3);
            this.g = bigInteger[2].modPow(exponent, this.p);
        }while(
            this.g.modPow(this.q,this.p).notEquals(1) ||
            this.g.modPow(2,this.p).equals(1) ||
            this.p.prev().remainder(this.g).equals(0) ||
            this.p.prev().remainder(this.g.modInv(this.p)).equals(0)
        );
        
        //Produce other parameters:
        await this.fillIn();
    }
/**
     * it's better to choose the lengthes which are divided evenly by 8.
     * By calling this method, the engine will create a thread to find a safe prime number and
     * then initialize engine using it.
     * @async
     * @param {number} lengthOfOrder indicate the length of Modulus of Group in bit
     */
it's better to choose the lengthes which are divided evenly by 8.
By calling this method, the engine will create a thread to find a safe prime number and
then initialize engine using it.
@async
@param {number} lengthOfOrder indicate the length of Modulus of Group in bit
it ' s better to choose the lengthes which are divided evenly by 8 . By calling this method the engine will create a thread to find a safe prime number and then initialize engine using it . @async @param { number } lengthOfOrder indicate the length of Modulus of Group in bit
async initialize(lengthOfOrder = 4096){
        this.q = undefined;
        do{
            this.q = await bigIntManager.getPrime(lengthOfOrder-1);
            log(this.q, typeof this.q);
            this.p = this.q.shiftLeft(1).add(1);
            log('one prime number produced:', this.p.bitLength());
        }while(!this.p.isPrime());
        do{
            let exponent = await bigIntManager.getInRange(this.p,3);
            this.g = bigInteger[2].modPow(exponent, this.p);
        }while(
            this.g.modPow(this.q,this.p).notEquals(1) ||
            this.g.modPow(2,this.p).equals(1) ||
            this.p.prev().remainder(this.g).equals(0) ||
            this.p.prev().remainder(this.g.modInv(this.p)).equals(0)
        );
        await this.fillIn();
    }
async initialize ( lengthOfOrder = 4096 ) { this . q = undefined ; do { this . q = await bigIntManager . getPrime ( lengthOfOrder - 1 ) ; log ( this . q , typeof this . q ) ; this . p = this . q . shiftLeft ( 1 ) . add ( 1 ) ; log ( 'one prime number produced:' , this . p . bitLength ( ) ) ; } while ( ! this . p . isPrime ( ) ) ; do { let exponent = await bigIntManager . getInRange ( this . p , 3 ) ; this . g = bigInteger [ 2 ] . modPow ( exponent , this . p ) ; } while ( this . g . modPow ( this . q , this . p ) . notEquals ( 1 ) || this . g . modPow ( 2 , this . p ) . equals ( 1 ) || this . p . prev ( ) . remainder ( this . g ) . equals ( 0 ) || this . p . prev ( ) . remainder ( this . g . modInv ( this . p ) ) . equals ( 0 ) ) ; await this . fillIn ( ) ; }
it's better to choose the lengthes which are divided evenly by 8.
it ' s better to choose the lengthes which are divided evenly by 8 .
//produce generator: //Produce other parameters: