Crypt_DiffieHellman
[ class tree: Crypt_DiffieHellman ] [ index: Crypt_DiffieHellman ] [ all elements ]

Class: Crypt_DiffieHellman_Math

Source Location: /Crypt_DiffieHellman-0.2.6/Crypt/DiffieHellman/Math.php

Class Overview

Crypt_DiffieHellman_Math_BigInteger
   |
   --Crypt_DiffieHellman_Math

Crypt_DiffieHellman_Math class


Author(s):

Version:

  • @package_version@

Copyright:

  • 2005-2007 Pádraic Brady

Methods


Inherited Variables

Inherited Methods

Class: Crypt_DiffieHellman_Math_BigInteger

Crypt_DiffieHellman_Math_BigInteger::__construct()
Constructor; Detects a suitable PHP extension for arbitrary precision math and instantiates the suitable wrapper object.
Crypt_DiffieHellman_Math_BigInteger::factory()
Crypt_DiffieHellman_Math_BigInteger::__call()
Redirect all public method calls to the wrapped extension object.

Class Details

[line 68]
Crypt_DiffieHellman_Math class

Example usage: $math = new Crypt_DiffieHellman_Math; $binaryForm = $math->toBinary('384834813984910010746469093412498181642341794'); $numberForm = $math->fromBinary($binaryForm);

$math = new Crypt_DiffieHellman_Math('gmp'); $randomNumber = $math->rand(2, '384834813984910010746469093412498181642341794');



[ Top ]


Method Detail

btwoc   [line 107]

string btwoc( string $long)

Perform a btwoc operation on the given BigInteger number in binary form which returns the big-endian two's complement.
  • Access: public

Parameters:

string   $long     

[ Top ]

fromBinary   [line 120]

string fromBinary( string $binary)

Convert a Binary value into a BigInteger number
  • Access: public

Parameters:

string   $binary     

[ Top ]

rand   [line 80]

string rand( $minimum, $maximum, string|int $min, string|int $max)

Generate a pseudorandom number within the given range.

Will attempt to read from a systems RNG if it exists.

  • Todo: Even more pseudorandomness would be nice...
  • Access: public

Parameters:

string|int   $min     
string|int   $max     
   $minimum     
   $maximum     

[ Top ]

toBinary   [line 140]

string toBinary( string $big)

Convert a BigInteger number into binary
  • Access: public

Parameters:

string   $big     

[ Top ]


Documentation generated on Sun, 01 Apr 2012 21:30:03 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.