Documentation

HmacRandomNumberGenerator
in package
implements RandomNumberGeneratorInterface

Table of Contents

Interfaces

RandomNumberGeneratorInterface

Properties

$algorithm  : string
$algSize  : array<string|int, mixed>
$math  : GmpMathInterface
$messageHash  : GMP
$privateKey  : PrivateKeyInterface

Methods

__construct()  : mixed
Hmac constructor.
bits2int()  : GMP
generate()  : GMP
Generate a random number between 0 and the specified upper boundary.
int2octets()  : string
getHashLength()  : int

Properties

$algSize

private array<string|int, mixed> $algSize = array('sha1' => 160, 'sha224' => 224, 'sha256' => 256, 'sha384' => 384, 'sha512' => 512)

Methods

bits2int()

public bits2int(string $bits, GMP $qlen) : GMP
Parameters
$bits : string
  • binary string of bits
$qlen : GMP
  • length of q in bits
Return values
GMP

generate()

Generate a random number between 0 and the specified upper boundary.

public generate(GMP $q) : GMP
Parameters
$q : GMP
Return values
GMP

int2octets()

public int2octets(GMP $int, GMP $rlen) : string
Parameters
$int : GMP
$rlen : GMP
  • rounded octet length
Return values
string

getHashLength()

private getHashLength(string $algorithm) : int
Parameters
$algorithm : string
Return values
int

        
On this page

Search results