Bits and Bytes
long NumBits(const ZZ& a);
long NumBits(long a);
//a写成二进制的bit数
// returns the number of bits in binary represenation of |a|;
// NumBits(0) = 0
long bit(const ZZ& a, long k);
long bit(long a, long k);
//a二进制表示时的第k位为1还是0(下标从0开始)
// returns bit k of |a|, position 0 being the low-order bit.
// If k < 0 or k >= NumBits(a), returns 0.
long SetBit(ZZ& x, long p);
//将x的第p比特设置为1,本来就是1则不变
// returns original value of p-th bit of |a|, and replaces p-th bit of
// a by 1 if it was zero; low order bit is bit 0; error if p < 0;
// the sign of x is maintained
long SwitchBit(ZZ& x, long p);
//交换x的第p比特,1变成0,0变成1
// returns original value of p-th bit of |a|, and switches the value
// of p-th bit of a; low order bit is bit 0; error if p < 0
// the sign of x is maintained
long weight(const ZZ& a); // returns Hamming weight of |a|
long weight(long a);
// bit-wise Boolean operations, procedural form:
void bit_and(ZZ& x, const ZZ& a, const ZZ& b); // x = |a| AND |b|
void bit_or(ZZ& x, const ZZ& a, const ZZ& b); // x = |a| OR |b|
void bit_xor(ZZ& x, const ZZ& a, const ZZ& b); // x = |a| XOR |b|
// bit-wise Boolean operations, operator notation:
ZZ operator&(const ZZ& a, const ZZ& b);
ZZ operator|(const ZZ& a, const ZZ& b);
ZZ operator^(const ZZ& a, const ZZ& b);
Pseudo-Random Numbers
后续补充