Being new to software development and crypto in general, I thought I would write a simple p2p encrypted chat app using the otr protocol detailed here: https://otr.cypherpunks.ca/Protocol-v3-4.0.0.html
However, I am having an issue calculating g^x and g^y.
I have g =2 for a particular 1536-bit prime, as the protocol says. But when I try to calculate g**x, where x is a random 320 bit number (which I generate with random.getrandbits(320)), then python takes forever to calculate it.
Am I missing something important here? I realize I am trying to calculate an absolutely huge number, but I am absolutely confused because I think I am doing exactly what the protocol dictates. Can anyone point me in the right direction and give me some insight into what I'm doing wrong?