Skip to main content

FP

FP​

Kind: global class
this: {"{"}FP{"}"}

new FP(x)​

Creates an instance of FP.

ParamDescription
xFP / BIG instance

fP.zero()​

Set FP to zero

Kind: instance method of FP
this: {"{"}FP{"}"}

fP.rcopy(x)​

copy from a ctx.BIG in ROM

Kind: instance method of FP
this: {"{"}FP{"}"}

ParamDescription
xFP instance to be copied

fP.bcopy(x)​

copy from another ctx.BIG

Kind: instance method of FP
this: {"{"}FP{"}"}

ParamDescription
xFP instance to be copied

fP.copy(x)​

Copy FP to another FP

Kind: instance method of FP
this: {"{"}FP{"}"}

ParamDescription
xFP instance to be copied

fP.cswap()​

Conditional constant time swap of two FP numbers

Kind: instance method of FP
this: {"{"}BIG{"}"}
Parameter: b FP number
Parameter: d Integer

fP.cmove(g, d)​

Conditional copy of FP number

Kind: instance method of FP
this: {"{"}FP{"}"}

ParamDescription
gFP instance
dcopy depends on this value

fP.nres()​

Converts from BIG integer to residue form mod Modulus

Kind: instance method of FP
this: {"{"}FP{"}"}

fP.redc()​

Converts from residue form back to BIG integer form

Kind: instance method of FP
this: {"{"}FP{"}"}

fP.toString()​

convert to hex string

Kind: instance method of FP
this: {"{"}FP{"}"}

fP.iszilch()​

Tests for FP equal to zero

Kind: instance method of FP
this: {"{"}FP{"}"}

fP.reduce()​

Reduces all components of possibly unreduced FP mod Modulus

Kind: instance method of FP
this: {"{"}FP{"}"}

fP.one()​

Set FP to unity

Kind: instance method of FP
this: {"{"}FP{"}"}

fP.norm()​

Normalises the components of an FP

Kind: instance method of FP
this: {"{"}FP{"}"}

fP.mul(b)​

Fast Modular multiplication of two FPs, mod Modulus

Kind: instance method of FP
this: {"{"}FP{"}"}

ParamDescription
bFP number, the multiplier

fP.imul(s)​

Multiplication of an FP by a small integer

Kind: instance method of FP
this: {"{"}FP{"}"}

ParamDescription
sinteger

fP.sqr()​

Fast Squaring of an FP

Kind: instance method of FP
this: {"{"}FP{"}"}

fP.neg(x)​

negate this

Kind: instance method of FP
this: {"{"}FP{"}"}

ParamDescription
xFP instance to be set to one

fP.sub(x)​

subtraction of two FPs

Kind: instance method of FP
this: {"{"}FP{"}"}

ParamDescription
xFP instance

fP.div2()​

Divide an FP by 2

Kind: instance method of FP
this: {"{"}FP{"}"}

fP.fpow()​

return this^(p-3)/4 or this^(p-5)/8

Kind: instance method of FP
this: {"{"}FP{"}"}

fP.inverse()​

Inverting an FP

Kind: instance method of FP
this: {"{"}FP{"}"}

fP.equals(x)​

Tests for equality of two FP instances

Kind: instance method of FP
this: {"{"}FP{"}"}

ParamDescription
xFP instance to compare

fP.pow(e)​

Raises an FP to the power of a BIG

Kind: instance method of FP
this: {"{"}FP{"}"}

ParamDescription
eBIG instance exponent

fP.jacobi()​

return jacobi symbol (this/Modulus)

Kind: instance method of FP
this: {"{"}FP{"}"}

fP.sqrt()​

Fast Modular square root of a an FP, mod Modulus

Kind: instance method of FP
this: {"{"}FP{"}"}

FP.mod()​

reduce a ctx.DBIG to a ctx.BIG using a "special" modulus

Kind: static method of FP
this: {"{"}FP{"}"}