0

I have an exercise that says the following:
Let $p$ be an odd prime, and let $a$ and $b$ be generators $\mathbb{Z}​_p^*$. Suppose that we have an efficient algorithm $A$ for computing discrete logarithms with base $a$. Show how this algorithm can be used to efficiently compute discrete logarithms with base $b$.

With considering a change of base rule, I have done the following:

B(b,x):
    return A(x) / A(b)

Is this correct and the end of the exercise? I would say that it is, but this is very easy compared to the other exercise I'm currently solving, so I think that I have missed something...

Jan
  • 53
  • 4

2 Answers2

1

Is this correct and the end of the exercise?

I can't say to what extent your professor wants you to be explicit, but it is essentially correct (and I'd accept it as an answer if I were grading it). Now, your professor may be expecting you to explain (or give a proof) why this is correct.

poncho
  • 154,064
  • 12
  • 239
  • 382
1

For me, some things are slightly incorrect or missing:

  • If $B$ is an algorithm to “compute discrete logarithms with base $b$”, it does not need an input $b$ (much like $A$ has no input for $a$).
  • It is not detailed exactly what the / operation does, and that's far from trivial. Take $p=2311$, $a=53$, $b=3$, $x=5$. $A(x)\mapsto322$, $A(b)\mapsto989$. How exactly do we find that $B(x)\mapsto1988$ from $322/989$ ?
  • If $A$ works with sufficient probability (including, always), does $B$ work with sufficient probability (or if applicable, always) in order to match what it is asked to prove?
  • It is not told why $B$ is efficient.
fgrieu
  • 149,326
  • 13
  • 324
  • 622