How are compressed PubKeys generated? Just read this: https://bitcoin.stackexchange.com/a/1715/

What is the process to generate compressed pub keys via ECDSA?
There is no algorithm for generating compressed pubkeys from private keys keys specifically.  In fact, all internal calculations involving points are done using the both the x and y coordinates of the points involved.  There is no other way to operate on points other than using the (x,y) coordinates.
A compressed representation of the point is useful in data transmission and storage because it only takes 33 bytes as opposed to 65 bytes to convey the point.  It's very easy to go from compressed -&gt; uncompressed when the need arise to perform point related operations, and even easier to go from uncompressed -&gt; compressed representation.
To answer your question, you would generate the public key as you normally would with an uncompressed pubkey, and when you're done, look for even-ness or odd-ness of the y corrdinate.
If it is even, encode only the x coordinate with a prefix 0x02 byte, and if it's odd the prefix is 0x03.
To go back from compressed -&gt; uncompressed (really I just mean find the original y coordinate), you would just solve the curve's equation :

y^2 = x^3 + a*x + b

Specifically for secp256k1, the curve used in Bitcoin, a is zero, which makes this calculation easier, and there is a shortcut: due to a property of the curve's parameter p, where p ≡ 3 mod 4 we are able to derive the y coordinate from an x coordinate simply by calculating:

q = (p+1) * invmod(4)  mod p
y = powmod(y^2,q)      mod p


And there we have the original y coordinate back.