def METHOD_NAME(client_hello, handshake_hashes, psk_configs,
                   tickets=None, res_master_secret=None):
    """
    Sign the Client Hello using TLS 1.3 PSK binders.
    note: the psk_configs should be in the same order as the ones in the
    PreSharedKeyExtension extension (extra ones are ok)
    :param client_hello: ClientHello to sign
    :param handshake_hashes: hashes of messages exchanged so far
    :param psk_configs: PSK identities and secrets
    :param tickets: optional list of tickets received from server
    :param bytearray res_master_secret: secret associated with the
        tickets
    """
    ext = client_hello.extensions[-1]
    if not isinstance(ext, PreSharedKeyExtension):
        raise ValueError("Last extension in client_hello must be "
                         "PreSharedKeyExtension")
    if tickets and not res_master_secret:
        raise ValueError("Tickets require setting res_master_secret")
    hh = handshake_hashes.copy()
    hh.update(client_hello.psk_truncate())
    configs_iter = iter(psk_configs)
    ticket_idens = []
    if tickets:
        ticket_idens = [i.ticket for i in tickets]
    for i, iden in enumerate(ext.identities):
        # identities that are tickets don't carry PSK directly
        if iden.identity in ticket_idens:
            binder_hash = 'sha256' if len(res_master_secret) == 32 \
                else 'sha384'
            psk = HandshakeHelpers.calc_res_binder_psk(
                iden, res_master_secret, tickets)
            external = False
        else:
            try:
                config = next(configs_iter)
                while config[0] != iden.identity:
                    config = next(configs_iter)
            except StopIteration:
                raise ValueError("psk_configs don't match the "
                                 "PreSharedKeyExtension")
            binder_hash = config[2] if len(config) > 2 else 'sha256'
            psk = config[1]
            external = True
        binder = HandshakeHelpers._calc_binder(binder_hash,
                                               psk,
                                               hh,
                                               external)
        # replace the fake value with calculated one
        ext.binders[i] = binder