Given a safe prime $P$ and a generator $g$ which generates all values from $1$ to $P-1$ with
$$g^n \mod P$$
1.) Is there now a function $f$ which assigns a unique value to a range of members
$$f(g^{i-a_i},...,g^{i+b_i}) = f(g^i) = v_{ia_ib_i}$$
2.) Given such a unique value $v_{ia_ib_i}$ the offset to the next $g^{q_i}$ and previous $g^{-q'_i}$ can be computed/approximated in a quite fast time (hours)
Example:
Let those unique values be group members with $g^k \equiv 0 \mod 10000$.
The assignment (1.) would just be the closest such value.
Is there now a way to compute the smallest offset $t$ to find the next unique value $g^r \equiv 0 \mod 1000 $ with
$$g^k\cdot g^t = g^r$$
Same for previous unique value (both with $|t| \min$)
More details:
- the number of unique values will be much smaller than $P$
- one random unique number will always be given. Computing the assignment 1.) don't need to be fast. (I guess if there is some solution it can't be fast else solving dlog would be easy)
- 2.) dont need to be an exact calculation. Some kind of search in between a small set of possible values is fine too. But it always need to lead to the very next/previous unique value
- not all group members need to be assigned to such a unique value
-the interval length ($a+b+1$) should different (in most cases) for ever unique value
So every value which can be generated with $g^{i-a_i}$ to $g^{i+b_i}$
is assigned to $f(g^i)$.
Unless the assignment changes the interval ($a,b$) also changes just by one. So for $g^{i+1}$:
$$a_{i+1} = a_i +1$$
$$b_{i+1} = b_i -1$$
($b = 0$ would be the border of the assignment)