parameters:
    passwords.driver.argon2_memory_cost: 1024
    passwords.driver.argon2_threads: 2
    passwords.driver.argon2_time_cost: 2
    passwords.driver.bcrypt_cost: 10

services:
# ----- Password management -----
    passwords.manager:
        class: phpbb\passwords\manager
        arguments:
            - '@config'
            - '@passwords.driver_collection'
            - '@passwords.helper'
            - '%passwords.algorithms%'

    passwords.helper:
        class: phpbb\passwords\helper

    passwords.driver_helper:
        class: phpbb\passwords\driver\helper
        arguments:
            - '@config'

# ----- Password's drivers -----
    passwords.driver_collection:
        class: phpbb\di\service_collection
        arguments:
            - '@service_container'
        tags:
            - { name: service_collection, tag: passwords.driver }

    passwords.driver.argon2i:
        class: phpbb\passwords\driver\argon2i
        arguments:
            - '@config'
            - '@passwords.driver_helper'
            - '%passwords.driver.argon2_memory_cost%'
            - '%passwords.driver.argon2_threads%'
            - '%passwords.driver.argon2_time_cost%'
        tags:
            - { name: passwords.driver }

    passwords.driver.argon2id:
        class: phpbb\passwords\driver\argon2id
        parent: passwords.driver.argon2i
        tags:
            - { name: passwords.driver }

    passwords.driver.bcrypt:
        class: phpbb\passwords\driver\bcrypt
        arguments:
            - '@config'
            - '@passwords.driver_helper'
            - '%passwords.driver.bcrypt_cost%'
        tags:
            - { name: passwords.driver }

    passwords.driver.bcrypt_2y:
        class: phpbb\passwords\driver\bcrypt_2y
        arguments:
            - '@config'
            - '@passwords.driver_helper'
            - '%passwords.driver.bcrypt_cost%'
        tags:
            - { name: passwords.driver }

    passwords.driver.bcrypt_wcf2:
        class: phpbb\passwords\driver\bcrypt_wcf2
        arguments:
            - '@passwords.driver.bcrypt'
            - '@passwords.driver_helper'
        tags:
            - { name: passwords.driver }

    passwords.driver.salted_md5:
        class: phpbb\passwords\driver\salted_md5
        arguments:
            - '@config'
            - '@passwords.driver_helper'
        tags:
            - { name: passwords.driver }

    passwords.driver.phpass:
        class: phpbb\passwords\driver\phpass
        arguments:
            - '@config'
            - '@passwords.driver_helper'
        tags:
            - { name: passwords.driver }

    passwords.driver.convert_password:
        class: phpbb\passwords\driver\convert_password
        arguments:
            - '@config'
            - '@passwords.driver_helper'
        tags:
            - { name: passwords.driver }

    passwords.driver.sha1_smf:
        class: phpbb\passwords\driver\sha1_smf
        arguments:
            - '@config'
            - '@passwords.driver_helper'
        tags:
            - { name: passwords.driver }

    passwords.driver.sha1_wcf1:
        class: phpbb\passwords\driver\sha1_wcf1
        arguments:
            - '@config'
            - '@passwords.driver_helper'
        tags:
            - { name: passwords.driver }

    passwords.driver.sha1:
        class: phpbb\passwords\driver\sha1
        arguments:
            - '@config'
            - '@passwords.driver_helper'
        tags:
            - { name: passwords.driver }

    passwords.driver.md5_phpbb2:
        class: phpbb\passwords\driver\md5_phpbb2
        arguments:
            - '@request'
            - '@passwords.driver.salted_md5'
            - '@passwords.driver_helper'
            - '%core.root_path%'
            - '%core.php_ext%'
        tags:
            - { name: passwords.driver }

    passwords.driver.md5_mybb:
        class: phpbb\passwords\driver\md5_mybb
        arguments:
            - '@config'
            - '@passwords.driver_helper'
        tags:
            - { name: passwords.driver }

    passwords.driver.md5_vb:
        class: phpbb\passwords\driver\md5_vb
        arguments:
            - '@config'
            - '@passwords.driver_helper'
        tags:
            - { name: passwords.driver }

    passwords.update.lock:
        class: phpbb\lock\db
        arguments:
            - update_hashes_lock
            - '@config'
            - '@dbal.conn'
