'How does the computer calculate or store Diffie-Hellman values?

So usually the Diffie-Hellman key is 2048 bits as I understand but my computer can barely calculate a 10 digit number. What are some common numbers in Diffie-Hellman?

Here is my code that's suuuper slow:

    $gen = 77;
    $mod = 517165;
    
    $saltA = 1233217;
    $saltB = 5173123;
    
    $calculatedSecretKeyA = gmp_mod(gmp_pow($gen, $saltA), $mod);
    
    $calculatedSecretKeyB = gmp_mod(gmp_pow($gen, $saltB), $mod);

    $calcKeyA = gmp_mod(gmp_pow($calculatedSecretKeyB, $saltA), $mod);
    echo $calculatedSecretKeyB . "^" . $saltA . "" . " mod " . $mod . " = " . $calcKeyA;
    
    
    $calcKeyB = gmp_mod(gmp_pow($calculatedSecretKeyA, $saltB), $mod);
    echo $calculatedSecretKeyA . "^" . $saltB . "" . " mod " . $mod . " = " . $calcKeyB;


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source