Suppose that $p$ is a safe prime of 2048 bits ($p = 2q + 1$, and $q$ is prime). Suppose that one is given two pairs $(x_1, y_1)$ and $(x_2, y_2)$ such that:
$y_1 = x_1^{r_1} \pmod p$
$y_2 = x_2^{r_2} \pmod p$
Where $r_1$ and $r_2$ are unknowns.
Is it easy or hard to check if $r_1 = r_2$ without further knowledge? Does this problem have a name?
Is there a relation $f$ of $r$ and $x$, $y_1 = f(r,x_1)$, such that it is difficult to extract $r$ from it but it's easy to detect if the same $r$ is used in another pair $y_2=f(r,x_2)$ without leaking $r$?