The sample solution to assignment #5 by Tom Bottom is posted
on the homeworks page. All there is fine, except solution to 6.16b.
The solution to this problem can be as follows.
As pointed out in Exercise 6.2, a variation of Shanks' algorithm
working in time O(sqrt(t-s)) can be made if the solution is known
to be in the interval [s,t]. Nibesh has it almost right (except
some minor typos). I describe the solution below.
We will compute #E = log_P(-P) + 1, using 6.16a.
From the Hasse bound, set t = p + 2sqrt(p), s = p - 2(sqrt(p)).
Let Q = -P, hence we aim to find k such that Q = kP. It is known
that s <= k <= t. Set m = ceil(sqrt(t-s)). Note that m is O(p^(1/4)).
Thus if we let k = s + jm + i, then i and j range as in the standard
Shanks' algorithm.
1.
S = sP
i, j range from 0 to m-1
k = s + jm + i
2.
Baby steps i:
Compute 0, P, 2P, ... ,(m-1)P, and store (i,-(i+1)P) = (i,-P-iP) on L1
3.
Giant steps j:
Compute S, S+mP, S+2mP, ... , S+(m-1)P, and store (j,S+jmP) on L2
4.
Intersect second coordinates of L1 and L2 (lists of points on E), which finds
S+jmP = -(i+1)P, hence S+jmP+iP = Q and k = s+jm+i.
Now #E = k+1.