Zend Framework  3.0
Static Public Member Functions | Static Protected Member Functions | List of all members
Scrypt Class Reference

Scrypt key derivation function. More...

Static Public Member Functions

static calc ($password, $salt, $n, $r, $p, $length)
 Execute the scrypt algorithm.
 

Static Protected Member Functions

static scryptROMix ($b, $n, $r)
 scryptROMix
 
static scryptBlockMix ($b, $r)
 scryptBlockMix
 
static salsa208Core32 ($b)
 Salsa 20/8 core (32 bit version)
 
static salsa208Core64 ($b)
 Salsa 20/8 core (64 bit version)
 
static integerify ($b)
 Integerify.
 

Detailed Description

Scrypt key derivation function.

See Also
http://www.tarsnap.com/scrypt.html
https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01

Member Function Documentation

static calc (   $password,
  $salt,
  $n,
  $r,
  $p,
  $length 
)
static

Execute the scrypt algorithm.

Parameters
string$password
string$salt
int$nCPU cost
int$rMemory cost
int$pparallelization cost
int$lengthsize of the output key
Returns
string
static integerify (   $b)
staticprotected

Integerify.

Integerify (B[0] ... B[2 * r - 1]) is defined as the result of interpreting B[2 * r - 1] as a little-endian integer. Each block B is a string of 64 bytes.

Parameters
string$b
Returns
int
See Also
https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-4
static salsa208Core32 (   $b)
staticprotected

Salsa 20/8 core (32 bit version)

Parameters
string$b
Returns
string
See Also
https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-2
http://cr.yp.to/salsa20.html
static salsa208Core64 (   $b)
staticprotected

Salsa 20/8 core (64 bit version)

Parameters
string$b
Returns
string
See Also
https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-2
http://cr.yp.to/salsa20.html
static scryptBlockMix (   $b,
  $r 
)
staticprotected

scryptBlockMix

Parameters
string$b
int$r
Returns
string
See Also
https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-3
static scryptROMix (   $b,
  $n,
  $r 
)
staticprotected

scryptROMix

Parameters
string$b
int$n
int$r
Returns
string
See Also
https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-4