Documentation
¶
Overview ¶
Package nt provides foundational number theory primitives for cryptographic applications.
See README.md for details.
Index ¶
- Variables
- func GeneratePrimePair[N algebra.NatPlusLike[N]](set PrimeSamplable[N], bits uint, prng io.Reader) (p, q N, err error)
- func GenerateSafePrime[N algebra.NatPlusLike[N]](set PrimeSamplable[N], bits uint) (N, error)
- func GenerateSafePrimePair[N algebra.NatPlusLike[N]](set PrimeSamplable[N], bits uint) (p, q N, err error)
- func MillerRabinChecks(bits uint) int
- type PrimeSamplable
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidSize = errs.New("invalid size") ErrIsNil = errs.New("is nil") )
Functions ¶
func GeneratePrimePair ¶
func GeneratePrimePair[N algebra.NatPlusLike[N]](set PrimeSamplable[N], bits uint, prng io.Reader) (p, q N, err error)
GeneratePrimePair generates two distinct prime numbers of the specified bit length using the provided PrimeSamplable set.
func GenerateSafePrime ¶
func GenerateSafePrime[N algebra.NatPlusLike[N]](set PrimeSamplable[N], bits uint) (N, error)
GenerateSafePrime generates a safe prime of the specified bit length using the provided PrimeSamplable set.
func GenerateSafePrimePair ¶
func GenerateSafePrimePair[N algebra.NatPlusLike[N]](set PrimeSamplable[N], bits uint) (p, q N, err error)
GenerateSafePrimePair generates two distinct safe primes of the specified bit length using the provided PrimeSamplable set.
func MillerRabinChecks ¶
MillerRabinChecks returns the number of Miller-Rabin iterations required for a given bit length.
Types ¶
type PrimeSamplable ¶
type PrimeSamplable[E algebra.NatPlusLike[E]] interface { FromBig(*big.Int) (E, error) }
PrimeSamplable is an interface for types that can sample prime numbers.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cardinal provides representations for cardinal numbers (cardinalities) used to express the size of algebraic structures such as groups, rings, and fields.
|
Package cardinal provides representations for cardinal numbers (cardinalities) used to express the size of algebraic structures such as groups, rings, and fields. |
|
Package crt provides Chinese Remainder Theorem (CRT) reconstruction and decomposition for cryptographic applications.
|
Package crt provides Chinese Remainder Theorem (CRT) reconstruction and decomposition for cryptographic applications. |
|
Package modular provides CRT-accelerated modular arithmetic for cryptographic applications such as RSA and Paillier.
|
Package modular provides CRT-accelerated modular arithmetic for cryptographic applications such as RSA and Paillier. |
|
Package num provides arbitrary-precision arithmetic for cryptographic applications.
|
Package num provides arbitrary-precision arithmetic for cryptographic applications. |
|
Package numct provides constant-time arbitrary-precision arithmetic for cryptographic applications.
|
Package numct provides constant-time arbitrary-precision arithmetic for cryptographic applications. |
|
Package znstar provides multiplicative groups of units modulo n, denoted (Z/nZ)*, for cryptographic applications such as RSA and Paillier encryption.
|
Package znstar provides multiplicative groups of units modulo n, denoted (Z/nZ)*, for cryptographic applications such as RSA and Paillier encryption. |
Click to show internal directories.
Click to hide internal directories.