1
$\begingroup$

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?

$\endgroup$

closed as off-topic by e-sushi Dec 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.

1
$\begingroup$

Order here is not anything to do with how you might "order" a row of pencils in order of height (or some similar behaviour) -- but the number of elements in the group in question.

$\endgroup$
  • 1
    $\begingroup$ 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$) $\endgroup$ – poncho Dec 6 '16 at 17:14
1
$\begingroup$

$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) $.

$\endgroup$
  • 1
    $\begingroup$ 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) $\endgroup$ – poncho Dec 6 '16 at 19:23
  • $\begingroup$ 1) I correct immediately 2) I understood that the question was about the order of the multiplicative group, but I add the definition of the order of an element of the group. $\endgroup$ – M-elman Dec 6 '16 at 19:26
  • $\begingroup$ 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. $\endgroup$ – tylo Dec 7 '16 at 12:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.