Psr7Middlewares\Utils\CryptTrait::hkdf PHP Method

hkdf() private static method

Get derived key http://tools.ietf.org/html/rfc5869.
private static hkdf ( string $ikm, string $info = '' ) : string
$ikm string Initial Keying Material
$info string What sort of key are we deriving?
return string
    private static function hkdf($ikm, $info = '')
    {
        $salt = str_repeat("", 32);
        $prk = hash_hmac('sha256', $ikm, $salt, true);
        $t = $last_block = '';
        $length = 0;
        for ($block_index = 1; $length < 16; ++$block_index) {
            $last_block = hash_hmac('sha256', $last_block . $info . chr($block_index), $prk, true);
            $t .= $last_block;
            $length = mb_strlen($t, '8bit');
        }
        return mb_substr($t, 0, 16, '8bit');
    }