Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsInIntervalLEps ¶
IsInIntervalLEps returns true if n ∈ [-2ˡ⁺ᵉ,…,2ˡ⁺ᵉ].
func IsInIntervalLEpsPlus1RootN ¶
IsInIntervalLEpsPlus1RootN returns true if n ∈ [-2¹⁺ˡ⁺ᵉ√N,…,2¹⁺ˡ⁺ᵉ√N], for a Paillier modulus N.
func IsInIntervalLPrimeEps ¶
IsInIntervalLPrimeEps returns true if n ∈ [-2ˡ'⁺ᵉ,…,2ˡ'⁺ᵉ].
func IsValidBigModN ¶
IsValidBigModN checks that ints are all in the range [1,…,N-1] and co-prime to N.
Types ¶
type Modulus ¶
type Modulus struct { // represents modulus n *saferith.Modulus // contains filtered or unexported fields }
Modulus wraps a saferith.Modulus and enables faster modular exponentiation when the factorization is known. When n = p⋅q, xᵉ (mod n) can be computed with only two exponentiations with p and q respectively.
func ModulusFromFactors ¶
ModulusFromFactors creates the necessary cached values to accelerate exponentiation mod n.
func ModulusFromN ¶
ModulusFromN creates a simple wrapper around a given modulus n. The modulus is not copied.