crandall

package
v0.0.0-...-3948e75 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(p prime.Crandall) fp.Field

Types

type Field

type Field struct {
	// contains filtered or unexported fields
}

func (Field) Build

func (f Field) Build(ctx *build.Context) fp.Builder

func (Field) ElementBits

func (f Field) ElementBits() int

func (Field) ElementSize

func (f Field) ElementSize() int

func (Field) Limbs

func (f Field) Limbs() int

func (Field) Prime

func (f Field) Prime() *big.Int

func (Field) ReductionMultiplier

func (f Field) ReductionMultiplier() uint32

ReductionMultiplier returns the value an element must be multiplied by to reduce it modulo p upon overflow of the element size. Note that for the Crandall prime we have

2ⁿ - c ≡ 0 (mod p)
2ⁿ ≡ c (mod p)

However n may not be on a limb boundary, so we actually need the identity

2ˡ ≡ 2ˡ⁻ⁿ * c (mod p)

We'll call this the reduction multiplier.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL