How does the inclusion of a subprime q value affect the Diffie Hellman equation for key exchange? [duplicate]

This is a follow on from this question:
"Diffie-Hellman Key Exchange" in plain English
In the answer to that question, the standard Diffie Hellman key exchange equation is derived:
(g^a mod p)^b mod p = g^ab mod p
(g^b mod p)^a m… Continue reading How does the inclusion of a subprime q value affect the Diffie Hellman equation for key exchange? [duplicate]

ECDH for P-521 (Web Crypto Api) / secp521r1 (NodeJS Crypto) generate a slightly different shared secret

I have generated a public and private key pair with ECDH from NodeJS
function _genPrivateKey(curveName = "secp384r1", encoding = "hex") {
const private_0 = crypto.createECDH(curveName);
private_0.generateKeys();… Continue reading ECDH for P-521 (Web Crypto Api) / secp521r1 (NodeJS Crypto) generate a slightly different shared secret