Given is prime $p$ and a generator value $g$ with $1 < g < p$. How can we efficiently compute the order of the subgroup that is created by
$g^k \mod p$
I've looked into Eulers Totient function, but can not seem to find an efficient way to compute this with no additional knowledge apart from $p, g$. Am I missing something or can this not be calculated efficiently?