As far as I understood, when using Diffie Hellman, the pre master secret is generated as follows:
- Alice and Bob agree on a generator
gand a primep - Alice chooses a primary key
a, calculatesA = g^a mod pand sends the result to Bob - Bob chooses a primary key
b, calculatesk = A^b mod pand receives the pre master secret as a resultk
However, if I do that with, say, a 4096 bit p, k also has 4096 bits which seems too large, especially because if I want to hand it over to wireshark in a SSLKEYLOGFILE, wireshark truncates the line after 512 bytes, not reading the whole secret. Is my train of thought correct or is the pre master secret something else?