| 1 | <?php |
||
| 8 | class KeyDerivation |
||
| 9 | { |
||
| 10 | const HASHER = 'sha512'; |
||
| 11 | const DEFAULT_SALTLEN = 10; |
||
| 12 | const DEFAULT_ITERATIONS = 35000; |
||
| 13 | const SUBKEY_ITERATIONS = 1; |
||
| 14 | const KEYLEN_BITS = 256; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param int $length |
||
| 18 | * @return BufferInterface |
||
| 19 | */ |
||
| 20 | 1 | public static function generateSalt($length = self::DEFAULT_SALTLEN) |
|
| 28 | |||
| 29 | /** |
||
| 30 | * @param BufferInterface $password |
||
| 31 | * @param BufferInterface $salt |
||
| 32 | * @param int $iterations |
||
| 33 | * @return BufferInterface |
||
| 34 | */ |
||
| 35 | 5 | public static function compute(BufferInterface $password, BufferInterface $salt, $iterations = self::DEFAULT_ITERATIONS) |
|
| 40 | } |
||
| 41 |