Expand description
Extra generally useful methods.
Functions
- Returns the sum of
a
andb
as two 128-bit words. The first element of the tuple is the high word (guaranteed to be either 0 or 1) and the second is the low word. - Returns the product of
a
andb
, as two 128-bit words. The first element of the tuple is the high word, and the second is the low word. - Returns a quadratic non-residue modulo
p
. That is, it returns an integer $a \in \mathbb{Z} / p\mathbb{Z}$ such that there is no $x$ satisfying $x^2 = a \mod p$. - Returns
x
to the power ofn
, modulom
. - Returns the product of
a
andb
modulom
. This function will panic ifm >= 2^127
. Otherwise, it is guarenteed that there will not be integer overflow. - Shifts
dst
to the rightn
bits, filling in from the left with the least significant bits ofsrc
. - Returns a pseudo-random integer modulo
q
, unique for everyi
between0
andq
. This acts suitably well as a random number generator for several modular arithmetic operations, including randomly searching for quadratic (non) residues.