diff options
author | Josh Hoyt <josh@janrain.com> | 2006-01-06 01:37:48 +0000 |
---|---|---|
committer | Josh Hoyt <josh@janrain.com> | 2006-01-06 01:37:48 +0000 |
commit | 4b5be61d4ee37b4b2bee464a3f02b82b2caf1a41 (patch) | |
tree | 6994de3ac7b2d80b49d93774ebab1bd3d951b23b | |
parent | 8fc29714c0d7ebe235eaf9fcd3402bbda4d3c31d (diff) | |
download | php-openid-4b5be61d4ee37b4b2bee464a3f02b82b2caf1a41.zip php-openid-4b5be61d4ee37b4b2bee464a3f02b82b2caf1a41.tar.gz php-openid-4b5be61d4ee37b4b2bee464a3f02b82b2caf1a41.tar.bz2 |
[project @ Fix diffie-hellman test to reflect changes in implementation]
-rw-r--r-- | Tests/Net/OpenID/DiffieHellman.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Tests/Net/OpenID/DiffieHellman.php b/Tests/Net/OpenID/DiffieHellman.php index 7891b27..561aafe 100644 --- a/Tests/Net/OpenID/DiffieHellman.php +++ b/Tests/Net/OpenID/DiffieHellman.php @@ -56,12 +56,14 @@ class Tests_Net_OpenID_DiffieHellman_Exch extends PHPUnit_TestCase { function runTest() { + $lib =& Net_OpenID_MathLibrary::getLibWrapper(); + $shared = $lib->init($this->shared); $dh1 = new Net_OpenID_DiffieHellman(null, null, $this->p1); $dh2 = new Net_OpenID_DiffieHellman(null, null, $this->p2); $sh1 = $dh1->getSharedSecret($dh2->getPublicKey()); $sh2 = $dh2->getSharedSecret($dh1->getPublicKey()); - $this->assertEquals($this->shared, $sh1); - $this->assertEquals($this->shared, $sh2); + $this->assertEquals($lib->cmp($shared, $sh1), 0); + $this->assertEquals($lib->cmp($shared, $sh2), 0); } } @@ -139,7 +141,9 @@ class Tests_Net_OpenID_DiffieHellman extends PHPUnit_TestSuite { $sanity->setName('Check parsing of exch test data'); $this->addTest($sanity); - if (defined('Net_OpenID_math_type')) { + $lib = Net_OpenID_MathLibrary::getLibWrapper(); + + if ($lib->type != 'dumb') { if (defined('Tests_Net_OpenID_DH_thorough')) { $npriv = count($priv_cases); $nexch = count($exch_cases); |