What is Group in Diffie-Hellman?

I understand how Diffie-Hellman key-exchange works. Mainly, two parties agrees in a prime $$p$$ and a generator $$g$$. Then one party selects its private exponenet $$x$$, computes its public value $$g^x \bmod p$$. Then, sends it to the second party. The second party chooses a private exponent $$y$$, then, computes its public value, $$g^y \bmod p$$ and sends it to the first party. Then, both parties, compute $$g^{xy}$$ which is the shared secret.

However, in some protocols descriptions, like TLS 1.3, I find them say the client sends "hello message includes Diffie-Hellman public values for the client's preferred groups". What is "group" refers to??

However, in some protocols descriptions, like TLS 1.3, I find them say the client sends "hello message includes Diffie-Hellman public values for the client's preferred groups". What is "group" refers to??

The term group is a mathematical concept that guarantees that a specific operation doesn't leave a set, that it is associative, that there is a neutral element and that there's an inverse element for each element.

Diffie-Hellman generally operates in such groups.
Just view it like this: Your set is defined by $p$, e.g. for all integers $x$ in the group $0\leq x <p$. You then take an element $g$ from it and apply the group operation (multiplication modulo $p$) a certain number of times to it (whatever your exponent tells you).

Now every choice of $p$ describes its own group and additionally you can choose groups with an entirely different structure such as the points of elliptic curves over prime fields (which makes this ECDH)

• Zp* (or Zn*) excludes 0, and you can't pick just any g: it must generate a subgroup of sufficiently large and nonsmooth order, usually by construction (e.g. 'safe' prime p=2q+1 p and q both prime, then any g whose order isn't 2 is q) Commented Jul 18, 2016 at 3:32
• actually, you do not need a group, A semigroup will be sufficient.
– user27950
Commented Jul 18, 2016 at 16:53