ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_OpenID_DiffieHellman Class Reference
+ Collaboration diagram for Auth_OpenID_DiffieHellman:

Public Member Functions

 Auth_OpenID_DiffieHellman ($mod=null, $gen=null, $private=null, $lib=null)
 getSharedSecret ($composite)
 getPublicKey ()
 usingDefaultValues ()
 xorSecret ($composite, $secret, $hash_func)

Data Fields

 $mod
 $gen
 $private
 $lib = null

Detailed Description

Definition at line 43 of file DiffieHellman.php.

Member Function Documentation

Auth_OpenID_DiffieHellman::Auth_OpenID_DiffieHellman (   $mod = null,
  $gen = null,
  $private = null,
  $lib = null 
)

Definition at line 50 of file DiffieHellman.php.

References $gen, $lib, $mod, $private, Auth_OpenID_getDefaultGen(), Auth_OpenID_getDefaultMod(), and Auth_OpenID_getMathLib().

{
if ($lib === null) {
$this->lib = Auth_OpenID_getMathLib();
} else {
$this->lib = $lib;
}
if ($mod === null) {
$this->mod = $this->lib->init(Auth_OpenID_getDefaultMod());
} else {
$this->mod = $mod;
}
if ($gen === null) {
$this->gen = $this->lib->init(Auth_OpenID_getDefaultGen());
} else {
$this->gen = $gen;
}
if ($private === null) {
$r = $this->lib->rand($this->mod);
$this->private = $this->lib->add($r, 1);
} else {
$this->private = $private;
}
$this->public = $this->lib->powmod($this->gen, $this->private,
$this->mod);
}

+ Here is the call graph for this function:

Auth_OpenID_DiffieHellman::getPublicKey ( )

Definition at line 87 of file DiffieHellman.php.

{
return $this->public;
}
Auth_OpenID_DiffieHellman::getSharedSecret (   $composite)

Definition at line 82 of file DiffieHellman.php.

Referenced by xorSecret().

{
return $this->lib->powmod($composite, $this->private, $this->mod);
}

+ Here is the caller graph for this function:

Auth_OpenID_DiffieHellman::usingDefaultValues ( )

Definition at line 92 of file DiffieHellman.php.

References Auth_OpenID_getDefaultGen(), and Auth_OpenID_getDefaultMod().

{
return ($this->mod == Auth_OpenID_getDefaultMod() &&
$this->gen == Auth_OpenID_getDefaultGen());
}

+ Here is the call graph for this function:

Auth_OpenID_DiffieHellman::xorSecret (   $composite,
  $secret,
  $hash_func 
)

Definition at line 98 of file DiffieHellman.php.

References Auth_OpenID\bytes(), and getSharedSecret().

{
$dh_shared = $this->getSharedSecret($composite);
$dh_shared_str = $this->lib->longToBinary($dh_shared);
$hash_dh_shared = $hash_func($dh_shared_str);
$xsecret = "";
for ($i = 0; $i < Auth_OpenID::bytes($secret); $i++) {
$xsecret .= chr(ord($secret[$i]) ^ ord($hash_dh_shared[$i]));
}
return $xsecret;
}

+ Here is the call graph for this function:

Field Documentation

Auth_OpenID_DiffieHellman::$gen

Definition at line 46 of file DiffieHellman.php.

Referenced by Auth_OpenID_DiffieHellman().

Auth_OpenID_DiffieHellman::$lib = null

Definition at line 48 of file DiffieHellman.php.

Referenced by Auth_OpenID_DiffieHellman().

Auth_OpenID_DiffieHellman::$mod

Definition at line 45 of file DiffieHellman.php.

Referenced by Auth_OpenID_DiffieHellman().

Auth_OpenID_DiffieHellman::$private

Definition at line 47 of file DiffieHellman.php.

Referenced by Auth_OpenID_DiffieHellman().


The documentation for this class was generated from the following file: