|
|
size(N)
size(N:long) : int
Returns the size of the number N in bits. |
|
|
|
|
getRandomNumber(N,
randfunc)
getRandomNumber(N:int, randfunc:callable):long
Return an N-bit random number. |
|
|
|
|
GCD(x,
y)
GCD(x:long, y:long): long
Return the GCD of x and y. |
|
|
|
|
inverse(u,
v)
inverse(u:long, u:long):long
Return the inverse of u mod v. |
|
|
|
|
getPrime(N,
randfunc)
getPrime(N:int, randfunc:callable):long
Return a random N-bit prime number. |
|
|
|
|
isPrime(N)
isPrime(N:long):bool
Return true if N is prime. |
|
|
|
|
long_to_bytes(n,
blocksize=0)
long_to_bytes(n:long, blocksize:int) : string
Convert a long integer to a byte string. |
|
|
|
|
bytes_to_long(s)
bytes_to_long(string) : long
Convert a byte string to a long integer. |
|
|
|
|
|
|
|
|