# What is 'order' in More Modular Exponential (MODP) Diffie-Hellman groups? [closed]

I am investigating on source code of a program called hostapd. And I am looking into Diffii-Hellman part of it.

/* RFC 3526, 3. Group 14 - 2048 Bit MODP
* Generator: 2
* Prime: 2^2048 - 2^1984 - 1 + 2^64 * { [2^1918 pi] + 124476 }
*/
static const u8 dh_group14_generator[1] = { 0x02 };
static const u8 dh_group14_prime[256] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
...
}; /* too long */
static const u8 dh_group14_order[256] = {
0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
...
}; /* too long */


I understand that dh_group14_generator is a generator and dh_group14_prime is a prime for 2048 bit MODP from RFC 3526.

However, I can't find any clue of dh_group14_order. What does it stand for?

## closed as off-topic by e-sushiDec 7 '16 at 15:49

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Programming questions are off-topic even if you are writing or debugging cryptographic code. Unless your question is specifically about how the cryptographic algorithm or protocol works, you should look into asking on Stack Overflow instead." – e-sushi
If this question can be reworded to fit the rules in the help center, please edit the question.

• And, in this specific case, the order is the number of different values $g^i \bmod p$ can take on (for different values of $i$) – poncho Dec 6 '16 at 17:14
$g$ is a generator of a multiplicative group ${Z_p}^*$ if ${Z_p}^*=\{g^i |1\leq i \leq p-1\}$ (every element of the group can be obtained as a power of $g$).
The order of the finite group ${Z_p}^*$is the number of its elements: in this case, $p-1$.
The order of an element $\alpha \in {Z_p}^*$ is the smallest positive integer $r$ that $\alpha^r\equiv 1(mod p)$.
• Two problems: 1) the order of $\mathbb{Z}^*_p$ is $p-1$ (as 0 is not a member of that group), and 2) the question really was about the order of $g$ (which in this case is not a generator of the entire group) – poncho Dec 6 '16 at 19:23
• You might want to state that $p$ has to be a prime, otherwise all but the last statement are wrong. Since the order of the group is something different than the order of an element: You should state that the order of an element can only be a divisor of the group order. – tylo Dec 7 '16 at 12:19