go/src/crypto/internal/bigmod/nat_test.go

func (n *Nat) String() string {}

// Generate generates an even nat. It's used by testing/quick to produce random
// *nat values for quick.Check invocations.
func (*Nat) Generate(r *rand.Rand, size int) reflect.Value {}

func testModAddCommutative(a *Nat, b *Nat) bool {}

func TestModAddCommutative(t *testing.T) {}

func testModSubThenAddIdentity(a *Nat, b *Nat) bool {}

func TestModSubThenAddIdentity(t *testing.T) {}

func TestMontgomeryRoundtrip(t *testing.T) {}

func TestShiftIn(t *testing.T) {}

func TestModulusAndNatSizes(t *testing.T) {}

func TestSetBytes(t *testing.T) {}

func TestExpand(t *testing.T) {}

func TestMod(t *testing.T) {}

func TestModSub(t *testing.T) {}

func TestModAdd(t *testing.T) {}

func TestExp(t *testing.T) {}

func TestExpShort(t *testing.T) {}

// TestMulReductions tests that Mul reduces results equal or slightly greater
// than the modulus. Some Montgomery algorithms don't and need extra care to
// return correct results. See https://go.dev/issue/13907.
func TestMulReductions(t *testing.T) {}

func natBytes(n *Nat) []byte {}

func natFromBytes(b []byte) *Nat {}

func modulusFromBytes(b []byte) *Modulus {}

// maxModulus returns the biggest modulus that can fit in n limbs.
func maxModulus(n uint) *Modulus {}

func makeBenchmarkModulus() *Modulus {}

func makeBenchmarkValue() *Nat {}

func makeBenchmarkExponent() []byte {}

func BenchmarkModAdd(b *testing.B) {}

func BenchmarkModSub(b *testing.B) {}

func BenchmarkMontgomeryRepr(b *testing.B) {}

func BenchmarkMontgomeryMul(b *testing.B) {}

func BenchmarkModMul(b *testing.B) {}

func BenchmarkExpBig(b *testing.B) {}

func BenchmarkExp(b *testing.B) {}

func TestNewModFromBigZero(t *testing.T) {}