Subversion Repositories php_utils

Rev

Rev 68 | Rev 70 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68 Rev 69
Line 173... Line 173...
173
                                $bin_hash = hash_hmac($algo, $str_password, $str_salt, true);
173
                                $bin_hash = hash_hmac($algo, $str_password, $str_salt, true);
174
                        }
174
                        }
175
                } else if ($mode == 'pbkdf2') {
175
                } else if ($mode == 'pbkdf2') {
176
                        if (!hash_pbkdf2_supported_natively($algo) && str_starts_with($algo, 'sha3-') && method_exists('\bb\Sha3\Sha3', 'hash_pbkdf2')) {
176
                        if (!hash_pbkdf2_supported_natively($algo) && str_starts_with($algo, 'sha3-') && method_exists('\bb\Sha3\Sha3', 'hash_pbkdf2')) {
177
                                if ($iterations == 0) {
177
                                if ($iterations == 0) {
178
                                        $iterations = 2000; // because userland implementations are much slower, we must choose a small value...
178
                                        $iterations = 100; // because the userland implementation is EXTREMELY slow, we must choose a small value, sorry...
179
                                }
179
                                }
180
                                $bits = explode('-',$algo)[1];
180
                                $bits = explode('-',$algo)[1];
181
                                $bin_hash = \bb\Sha3\Sha3::hash_pbkdf2($str_password, $str_salt, $iterations, $bits, 0, true);
181
                                $bin_hash = \bb\Sha3\Sha3::hash_pbkdf2($str_password, $str_salt, $iterations, $bits, 0, true);
182
                        } else {
182
                        } else {
183
                                if ($iterations == 0) {
183
                                if ($iterations == 0) {