def _assign_secret_ids(secret_vars):
    """
    Assign consecutive identifiers to secrets.

    Needed for proof statement idenfifiers.

    >>> x, y = Secret(name='x'), Secret(name='y')
    >>> _assign_secret_ids([x, y, x])
    {'x': 0, 'y': 1}

    Args:
        secret_vars: :py:class:`expr.Secret` objects.
    """
    secret_id_map = {}
    counter = 0
    for secret in secret_vars:
        if secret.name not in secret_id_map:
            secret_id_map[secret.name] = counter
            counter += 1
    return secret_id_map