Residue Number System
To write "real" cryptography, you've gotta be aware of RNS. A naive implementation of cryptographic schemes, which all rely on modular arithmetic on rather large numbers (and typically with moduli other than native powers of 2), is going to be ridiculously slow without such optimizations.
Thanks to the Chinese Remainder Theorem, given any relatively prime moduli , for all where , there exists a unique representation where . The are called the residues of .
We can make a signed RNS by designating as positive and as negative. The complement of is . Then subtraction is simply .