As part of my cryptography course I came across an exercise that neither me or my friends could figure out.
The problem statement is as follows:
Let $p$ be a large prime of the form $p = 2q + 1$ with $q$ also prime. Let $g$ be a generator of $\mathbb Z^∗_p$ and consider the discrete logarithm problem: given $h = g^x$, find $x$.
Let $G_q$ denote the subgroup of order $q$ and assume you have access to an oracle $O : G_q ×G_q \to \{0, 1\}$ that on input two elements $s, t \in G_q$ with $t = s^y$ returns the least significant bit of $y$. Design an algorithm (using the oracle) to solve the DLP in $G_q$ and an algorithm (again using the oracle) to solve the DLP in $\mathbb Z^∗_p$.
The first part of the question is fairly easy (solve DLP in $G_q$ with the oracle). However, we cannot figure out the second part.
I have solved the first part as follows:
Run the oracle on $t$. On output 0 you know that the LSB of $y$ is 0, hence $y$ is even. $s^y$ can therefor be written as $s^{2*y'}$, which is still equal to $t$. By taking the square root of $t$, $\sqrt(t) = s^{y'}$ I no longer now the LSB of $y'$, but I know it's 1 bit smaller than $y$.
Similarly if the LSB of $y$ is 1 I know I can write $t = s^{y} = s^{y'+1} = s^{y}s$, hence dividing $t$ by $s$ gives me a new pair $s',t'$ on which I can unleash the oracle.
If I repeat the steps above $log_2(q)$ times and store all the LSB's I have found $y$.
Any hints/clues/advice will be most appreciated :).