app/Http/Middleware/UserCliente.php
/**
     * @param  BigInteger  $x  Computed private key using identity and salt
     */
@param  BigInteger  $x  Computed private key using identity and salt
@param BigInteger $x Computed private key using identity and salt
public function calculateSessionKey(BigInteger $x): void
    {
        $u = $this->computeRandomScramblingParameter();
        $v = $this->computeVerifier($x);
        $kv = $this->multiplier->multiply($v);
        $aux = $this->secretEphemeralValue->add($u->multiply($x));
        $this->sessionKey = $this->hostPublicEphemeralValue->subtract($kv)->modPow($aux, $this->N);
        $this->strongSessionKey = sha1($this->sessionKey->toHex());
    }
public function calculateSessionKey ( BigInteger $ x ) : void { $ u = $ this -> computeRandomScramblingParameter ( ) ; $ v = $ this -> computeVerifier ( $ x ) ; $ kv = $ this -> multiplier -> multiply ( $ v ) ; $ aux = $ this -> secretEphemeralValue -> add ( $ u -> multiply ( $ x ) ) ; $ this -> sessionKey = $ this -> hostPublicEphemeralValue -> subtract ( $ kv ) -> modPow ( $ aux , $ this -> N ) ; $ this -> strongSessionKey = sha1 ( $ this -> sessionKey -> toHex ( ) ) ; }
@param  BigInteger  $x  Computed private key using identity and salt
@param BigInteger $x Computed private key using identity and salt
// Random scrambling parameter // Session key // Strong session key